aboutsummaryrefslogtreecommitdiffstats
path: root/tests/state_test_util.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-10-31 18:32:05 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-11-13 17:44:06 +0800
commit5cd86443ee071b5e3abe4995c777ce467c29f2c5 (patch)
tree0d67d118efab52c09a877c4be9560b9c9020f775 /tests/state_test_util.go
parent779ddb183275ed506ebae972876fe04098c738e5 (diff)
downloaddexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar.gz
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar.bz2
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar.lz
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar.xz
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.tar.zst
dexon-5cd86443ee071b5e3abe4995c777ce467c29f2c5.zip
tests: added new EIP158 tests
Diffstat (limited to 'tests/state_test_util.go')
-rw-r--r--tests/state_test_util.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 6427537b4..c8899392a 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -110,7 +110,7 @@ func runStateTests(chainConfig *params.ChainConfig, tests map[string]VmTest, ski
}
for name, test := range tests {
- if skipTest[name] /*|| name != "callcodecallcode_11" */ {
+ if skipTest[name] /*|| name != "NonZeroValue_CALL_ToEmpty"*/ {
glog.Infoln("Skipping state test", name)
continue
}
@@ -221,7 +221,6 @@ func RunState(chainConfig *params.ChainConfig, statedb *state.StateDB, env, tx m
}
// Set pre compiled contracts
vm.Precompiled = vm.PrecompiledContracts()
- snapshot := statedb.Snapshot()
gaspool := new(core.GasPool).AddGas(common.Big(env["currentGasLimit"]))
key, _ := hex.DecodeString(tx["secretKey"])
@@ -229,6 +228,12 @@ func RunState(chainConfig *params.ChainConfig, statedb *state.StateDB, env, tx m
message := NewMessage(addr, to, data, value, gas, price, nonce)
vmenv := NewEnvFromMap(chainConfig, statedb, env, tx)
vmenv.origin = addr
+
+ root, _ := statedb.Commit(false)
+ statedb.Reset(root)
+
+ snapshot := statedb.Snapshot()
+
ret, _, err := core.ApplyMessage(vmenv, message, gaspool)
if core.IsNonceErr(err) || core.IsInvalidTxErr(err) || core.IsGasLimitErr(err) {
statedb.RevertToSnapshot(snapshot)