diff options
Diffstat (limited to 'tests/helper/vm.go')
-rw-r--r-- | tests/helper/vm.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/helper/vm.go b/tests/helper/vm.go index 5f1a3e345..e29a2d8ee 100644 --- a/tests/helper/vm.go +++ b/tests/helper/vm.go @@ -27,9 +27,8 @@ type Env struct { difficulty *big.Int gasLimit *big.Int - logs state.Logs - vmTest bool + logs []vm.StructLog } func NewEnv(state *state.StateDB) *Env { @@ -38,6 +37,14 @@ func NewEnv(state *state.StateDB) *Env { } } +func (self *Env) StructLogs() []vm.StructLog { + return self.logs +} + +func (self *Env) AddStructLog(log vm.StructLog) { + self.logs = append(self.logs, log) +} + func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues map[string]string) *Env { env := NewEnv(state) @@ -183,7 +190,7 @@ func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state. vmenv := NewEnvFromMap(statedb, env, tx) vmenv.origin = common.BytesToAddress(keyPair.Address()) ret, _, err := core.ApplyMessage(vmenv, message, coinbase) - if core.IsNonceErr(err) || core.IsInvalidTxErr(err) { + if core.IsNonceErr(err) || core.IsInvalidTxErr(err) || state.IsGasLimitErr(err) { statedb.Set(snapshot) } statedb.Update() |