diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-03-24 06:20:51 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-03-24 06:20:51 +0800 |
commit | 75c86f8646ed6a21116d6c5f5e400dd966bb218d (patch) | |
tree | 6c979fd121e7721328b9502f1855387b602dcd87 /tests | |
parent | 9866f19d6af607f629be311cb1c879e8f6472773 (diff) | |
parent | 0cfa21fc7f34d9da93abc41541dd4a98d70eb9dd (diff) | |
download | go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar.gz go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar.bz2 go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar.lz go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar.xz go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.tar.zst go-tangerine-75c86f8646ed6a21116d6c5f5e400dd966bb218d.zip |
Merge pull request #2141 from obscuren/evm-init
core, core/vm, tests: changed the initialisation behaviour of the EVM
Diffstat (limited to 'tests')
-rw-r--r-- | tests/state_test_util.go | 1 | ||||
-rw-r--r-- | tests/util.go | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 7d1701ff2..50be3a1ac 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -235,7 +235,6 @@ func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, vm.Log } // Set pre compiled contracts vm.Precompiled = vm.PrecompiledContracts() - vm.Debug = false snapshot := statedb.Copy() gaspool := new(core.GasPool).AddGas(common.Big(env["currentGasLimit"])) diff --git a/tests/util.go b/tests/util.go index 29f4c9b72..a0eb8158e 100644 --- a/tests/util.go +++ b/tests/util.go @@ -28,8 +28,13 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/logger/glog" ) +func init() { + glog.SetV(0) +} + func checkLogs(tlog []Log, logs vm.Logs) error { if len(tlog) != len(logs) { @@ -143,12 +148,15 @@ type Env struct { logs []vm.StructLog vmTest bool + + evm *vm.EVM } func NewEnv(state *state.StateDB) *Env { - return &Env{ + env := &Env{ state: state, } + return env } func (self *Env) StructLogs() []vm.StructLog { @@ -171,9 +179,12 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues env.gasLimit = common.Big(envValues["currentGasLimit"]) env.Gas = new(big.Int) + env.evm = vm.New(env, nil) + return env } +func (self *Env) Vm() vm.Vm { return self.evm } func (self *Env) Origin() common.Address { return self.origin } func (self *Env) BlockNumber() *big.Int { return self.number } func (self *Env) Coinbase() common.Address { return self.coinbase } |