aboutsummaryrefslogtreecommitdiffstats
path: root/tests/state_test_util.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-09-23 03:04:58 +0800
committerFelix Lange <fjl@twurst.com>2016-09-26 16:09:52 +0800
commita59a93f476434f2805c8fd3e10bf1b2f579b078f (patch)
tree17d1f3abefabfd7f8cb9149994a4788d2c0f08bc /tests/state_test_util.go
parente859f3696783ec75d9bb39c0c66eda3a88cea8c6 (diff)
downloaddexon-a59a93f476434f2805c8fd3e10bf1b2f579b078f.tar.gz
dexon-a59a93f476434f2805c8fd3e10bf1b2f579b078f.tar.zst
dexon-a59a93f476434f2805c8fd3e10bf1b2f579b078f.zip
core/state: track all accounts in canon state
This change introduces a global, per-state cache that keeps account data in the canon state. Thanks to @karalabe for lots of fixes.
Diffstat (limited to 'tests/state_test_util.go')
-rw-r--r--tests/state_test_util.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 36fa30881..67e4bf832 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -97,7 +97,7 @@ func benchStateTest(ruleSet RuleSet, test VmTest, env map[string]string, b *test
db, _ := ethdb.NewMemDatabase()
statedb, _ := state.New(common.Hash{}, db)
for addr, account := range test.Pre {
- obj := StateObjectFromAccount(db, addr, account)
+ obj := StateObjectFromAccount(db, addr, account, statedb.MarkStateObjectDirty)
statedb.SetStateObject(obj)
for a, v := range account.Storage {
obj.SetState(common.HexToHash(a), common.HexToHash(v))
@@ -136,7 +136,7 @@ func runStateTest(ruleSet RuleSet, test VmTest) error {
db, _ := ethdb.NewMemDatabase()
statedb, _ := state.New(common.Hash{}, db)
for addr, account := range test.Pre {
- obj := StateObjectFromAccount(db, addr, account)
+ obj := StateObjectFromAccount(db, addr, account, statedb.MarkStateObjectDirty)
statedb.SetStateObject(obj)
for a, v := range account.Storage {
obj.SetState(common.HexToHash(a), common.HexToHash(v))
@@ -187,7 +187,7 @@ func runStateTest(ruleSet RuleSet, test VmTest) error {
}
for addr, value := range account.Storage {
- v := obj.GetState(common.HexToHash(addr))
+ v := statedb.GetState(obj.Address(), common.HexToHash(addr))
vexp := common.HexToHash(value)
if v != vexp {