diff options
Diffstat (limited to 'plugin/evm/vm.go')
-rw-r--r-- | plugin/evm/vm.go | 12 |
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) } |