aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/vm.go
diff options
context:
space:
mode:
authoraaronbuchwald <aaron.buchwald56@gmail.com>2020-12-21 12:36:23 -0500
committerGitHub <noreply@github.com>2020-12-21 12:36:23 -0500
commit6c975480189b130c9a4794bf4e9913a93c360e02 (patch)
tree21c0d4579d42b944c938a4ce37b802a55741d2bd /plugin/evm/vm.go
parent374b401198759f23bac435a78c5b1fa2c516aad9 (diff)
parent4a1eb7db944fcb07ee85964ee8b34c19e3630d3d (diff)
Merge pull request #76 from ava-labs/ava_111v0.3.18-rc.1
Upgrade 1.1.1 codec
Diffstat (limited to 'plugin/evm/vm.go')
-rw-r--r--plugin/evm/vm.go12
1 files changed, 7 insertions, 5 deletions
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)
}