aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-12-21 12:36:23 -0500
committerGitHub <[email protected]>2020-12-21 12:36:23 -0500
commit6c975480189b130c9a4794bf4e9913a93c360e02 (patch)
tree21c0d4579d42b944c938a4ce37b802a55741d2bd
parent374b401198759f23bac435a78c5b1fa2c516aad9 (diff)
parent4a1eb7db944fcb07ee85964ee8b34c19e3630d3d (diff)
Merge pull request #76 from ava-labs/ava_111v0.3.18-rc.1
Upgrade 1.1.1 codec
-rw-r--r--go.mod2
-rw-r--r--go.sum2
-rw-r--r--plugin/evm/tx.go2
-rw-r--r--plugin/evm/vm.go12
4 files changed, 11 insertions, 7 deletions
diff --git a/go.mod b/go.mod
index e496c2d..a34e314 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.14
require (
github.com/VictoriaMetrics/fastcache v1.5.7
- github.com/ava-labs/avalanchego v1.1.0
+ github.com/ava-labs/avalanchego v1.1.1
github.com/davecgh/go-spew v1.1.1
github.com/deckarep/golang-set v1.7.1
github.com/edsrzf/mmap-go v1.0.0
diff --git a/go.sum b/go.sum
index 8e599d3..903c7fa 100644
--- a/go.sum
+++ b/go.sum
@@ -48,6 +48,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/ava-labs/avalanchego v1.1.0 h1:kJuOXGI+kt/jXi1TVJ0F4z1CP68YoDfYUHb4HHpjGHU=
github.com/ava-labs/avalanchego v1.1.0/go.mod h1:Q/I7LaMv2EYL8plNVRbcpBJsDk2py2XISfov0KK1MgU=
+github.com/ava-labs/avalanchego v1.1.1 h1:rsOlMOR5jKTFqvmKgIrHnYjYeCTEA6FarcP+WNOJZwY=
+github.com/ava-labs/avalanchego v1.1.1/go.mod h1:Q/I7LaMv2EYL8plNVRbcpBJsDk2py2XISfov0KK1MgU=
github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
diff --git a/plugin/evm/tx.go b/plugin/evm/tx.go
index 1c0ce48..f325159 100644
--- a/plugin/evm/tx.go
+++ b/plugin/evm/tx.go
@@ -11,11 +11,11 @@ import (
"github.com/ava-labs/coreth/core/state"
+ "github.com/ava-labs/avalanchego/codec"
"github.com/ava-labs/avalanchego/database"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/utils"
- "github.com/ava-labs/avalanchego/utils/codec"
"github.com/ava-labs/avalanchego/utils/crypto"
"github.com/ava-labs/avalanchego/utils/hashing"
"github.com/ava-labs/avalanchego/vms/components/verify"
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 9335b51..50623c3 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -14,6 +14,8 @@ import (
"sync/atomic"
"time"
+ "github.com/ava-labs/avalanchego/codec/linearcodec"
+
"github.com/ava-labs/coreth"
"github.com/ava-labs/coreth/core"
"github.com/ava-labs/coreth/core/state"
@@ -34,13 +36,13 @@ import (
"github.com/ava-labs/avalanchego/api/admin"
"github.com/ava-labs/avalanchego/cache"
+ "github.com/ava-labs/avalanchego/codec"
"github.com/ava-labs/avalanchego/database"
"github.com/ava-labs/avalanchego/database/prefixdb"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/snow/choices"
"github.com/ava-labs/avalanchego/snow/consensus/snowman"
- "github.com/ava-labs/avalanchego/utils/codec"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/crypto"
"github.com/ava-labs/avalanchego/utils/formatting"
@@ -122,14 +124,14 @@ var Codec codec.Manager
func init() {
Codec = codec.NewDefaultManager()
- c := codec.NewDefault()
+ c := linearcodec.NewDefault()
errs := wrappers.Errs{}
errs.Add(
c.RegisterType(&UnsignedImportTx{}),
c.RegisterType(&UnsignedExportTx{}),
)
- c.Skip(3)
+ c.SkipRegistrations(3)
errs.Add(
c.RegisterType(&secp256k1fx.TransferInput{}),
c.RegisterType(&secp256k1fx.MintOutput{}),
@@ -199,7 +201,7 @@ type VM struct {
genlock sync.Mutex
txSubmitChan <-chan struct{}
atomicTxSubmitChan chan struct{}
- baseCodec codec.Codec
+ baseCodec codec.Registry
codec codec.Manager
clock timer.Clock
txFee uint64
@@ -418,7 +420,7 @@ func (vm *VM) Initialize(
// so [vm.baseCodec] is a dummy codec use to fulfill the secp256k1fx VM
// interface. The fx will register all of its types, which can be safely
// ignored by the VM's codec.
- vm.baseCodec = codec.NewDefault()
+ vm.baseCodec = linearcodec.NewDefault()
return vm.fx.Initialize(vm)
}