diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-10-06 22:14:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-06 22:14:22 +0800 |
commit | 7335a70a020517cc9cebe7ae82c0e49ba133abf1 (patch) | |
tree | cc63625fa07bf3fb28326a01d5c8255a83a83bd1 /tests/vm_test_util.go | |
parent | 07caa3fccdfe11bbee084c043ac11e7cfae9a6b7 (diff) | |
parent | 3c836dd71b192de24774b1848173a4eb0ca9a63b (diff) | |
download | go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar.gz go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar.bz2 go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar.lz go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar.xz go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.tar.zst go-tangerine-7335a70a020517cc9cebe7ae82c0e49ba133abf1.zip |
Merge pull request #3092 from fjl/state-journal
core/state: implement reverts by journaling all changes
Diffstat (limited to 'tests/vm_test_util.go')
-rw-r--r-- | tests/vm_test_util.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go index 4ad72d91c..c269f21e0 100644 --- a/tests/vm_test_util.go +++ b/tests/vm_test_util.go @@ -101,14 +101,7 @@ func BenchVmTest(p string, conf bconf, b *testing.B) error { func benchVmTest(test VmTest, env map[string]string, b *testing.B) { b.StopTimer() db, _ := ethdb.NewMemDatabase() - statedb, _ := state.New(common.Hash{}, db) - for addr, account := range test.Pre { - obj := StateObjectFromAccount(db, addr, account, statedb.MarkStateObjectDirty) - statedb.SetStateObject(obj) - for a, v := range account.Storage { - obj.SetState(common.HexToHash(a), common.HexToHash(v)) - } - } + statedb := makePreState(db, test.Pre) b.StartTimer() RunVm(statedb, env, test.Exec) @@ -152,14 +145,7 @@ func runVmTests(tests map[string]VmTest, skipTests []string) error { func runVmTest(test VmTest) error { db, _ := ethdb.NewMemDatabase() - statedb, _ := state.New(common.Hash{}, db) - for addr, account := range test.Pre { - obj := StateObjectFromAccount(db, addr, account, statedb.MarkStateObjectDirty) - statedb.SetStateObject(obj) - for a, v := range account.Storage { - obj.SetState(common.HexToHash(a), common.HexToHash(v)) - } - } + statedb := makePreState(db, test.Pre) // XXX Yeah, yeah... env := make(map[string]string) |