From ae38665a356c3f3d1c12f5ddc8800768e2f29283 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Fri, 5 Oct 2018 12:33:23 +0200 Subject: [PATCH] core/vm: Remove EnableWagon after merge Wagon should be enabled by default when having EWASMBlock set to 0. --- cmd/ewasm/main.go | 2 +- core/vm/evm.go | 5 ++--- tests/ewasm_test.go | 1 - tests/init.go | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/ewasm/main.go b/cmd/ewasm/main.go index 8030dfd065..80908f44bf 100644 --- a/cmd/ewasm/main.go +++ b/cmd/ewasm/main.go @@ -85,7 +85,7 @@ func runCmd(ctx *cli.Context) error { contract := coreVM.NewContract(coreVM.AccountRef(callerAddr), coreVM.AccountRef(contractAddr), big.NewInt(100), gas) contract.Code = code - evm := coreVM.NewEVM(coreVM.Context{}, statedb, ¶ms.ChainConfig{}, coreVM.Config{EnableWagon: true}) + evm := coreVM.NewEVM(coreVM.Context{}, statedb, ¶ms.ChainConfig{}, coreVM.Config{}) // &ewasm.Contract{ // StateDB: statedb, // Gas: 100, diff --git a/core/vm/evm.go b/core/vm/evm.go index e07a2aa329..b52f2455be 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -140,7 +140,7 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon } if chainConfig.IsEWASM(ctx.BlockNumber) { - // to be implemented by EVM-C and Wagon PRs. + // to be implemented by EVM-C. // if vmConfig.EWASMInterpreter != "" { // extIntOpts := strings.Split(vmConfig.EWASMInterpreter, ":") // path := extIntOpts[0] @@ -150,9 +150,8 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon // } // evm.interpreters = append(evm.interpreters, NewEVMVCInterpreter(evm, vmConfig, options)) // } else { - evm.interpreters = append(evm.interpreters, NewEWASMInterpreter(evm, vmConfig)) + evm.interpreters = append(evm.interpreters, NewEWASMInterpreter(evm, vmConfig)) // } - panic("No supported ewasm interpreter yet.") } // vmConfig.EVMInterpreter will be used by EVM-C, it won't be checked here diff --git a/tests/ewasm_test.go b/tests/ewasm_test.go index 2158aaffc7..8b4314521c 100644 --- a/tests/ewasm_test.go +++ b/tests/ewasm_test.go @@ -36,7 +36,6 @@ func TestEWASMVM(t *testing.T) { t.Skip("constantinople not supported yet") } withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { - vmconfig.EnableWagon = true _, err := test.Run(subtest, vmconfig) return st.checkFailure(t, name, err) }) diff --git a/tests/init.go b/tests/init.go index f0a4943c13..9617b3a78d 100644 --- a/tests/init.go +++ b/tests/init.go @@ -52,6 +52,7 @@ var Forks = map[string]*params.ChainConfig{ EIP158Block: big.NewInt(0), DAOForkBlock: big.NewInt(0), ByzantiumBlock: big.NewInt(0), + EWASMBlock: big.NewInt(0), }, "Constantinople": { ChainID: big.NewInt(1),