fix test_generalstate_json -> add a call to accounts_cache.persist
This commit is contained in:
parent
9cce8d695b
commit
46e9c11d3f
|
@ -96,7 +96,10 @@ proc testFixtureIndexes(tester: Tester, testStatusIMPL: var TestStatus) =
|
||||||
vmState.mutateStateDB:
|
vmState.mutateStateDB:
|
||||||
setupStateDB(tester.pre, db)
|
setupStateDB(tester.pre, db)
|
||||||
|
|
||||||
#vmState.accountDB.updateOriginalRoot()
|
# this is an important step when using accounts_cache
|
||||||
|
# it will affect the account storage's location
|
||||||
|
# during the next call to `getComittedStorage`
|
||||||
|
db.persist()
|
||||||
|
|
||||||
defer:
|
defer:
|
||||||
let obtainedHash = "0x" & `$`(vmState.readOnlyStateDB.rootHash).toLowerAscii
|
let obtainedHash = "0x" & `$`(vmState.readOnlyStateDB.rootHash).toLowerAscii
|
||||||
|
@ -128,6 +131,12 @@ proc testFixtureIndexes(tester: Tester, testStatusIMPL: var TestStatus) =
|
||||||
if db.isEmptyAccount(miner):
|
if db.isEmptyAccount(miner):
|
||||||
db.deleteAccount(miner)
|
db.deleteAccount(miner)
|
||||||
|
|
||||||
|
# this is an important step when using accounts_cache
|
||||||
|
# it will affect the account storage's location
|
||||||
|
# during the next call to `getComittedStorage`
|
||||||
|
# and the result of rootHash
|
||||||
|
db.persist()
|
||||||
|
|
||||||
proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus,
|
proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus,
|
||||||
trace = false, debugMode = false, supportedForks: set[Fork] = supportedForks) =
|
trace = false, debugMode = false, supportedForks: set[Fork] = supportedForks) =
|
||||||
var tester: Tester
|
var tester: Tester
|
||||||
|
|
|
@ -149,11 +149,6 @@ proc setupStateDB*(wantedState: JsonNode, stateDB: var AccountsCache) =
|
||||||
stateDB.setCode(account, code)
|
stateDB.setCode(account, code)
|
||||||
stateDB.setBalance(account, balance)
|
stateDB.setBalance(account, balance)
|
||||||
|
|
||||||
# this is an important step when using accounts_cache
|
|
||||||
# it will affect the account storage's location
|
|
||||||
# during the next call to `getComittedStorage`
|
|
||||||
stateDB.persist()
|
|
||||||
|
|
||||||
proc verifyStateDB*(wantedState: JsonNode, stateDB: ReadOnlyStateDB) =
|
proc verifyStateDB*(wantedState: JsonNode, stateDB: ReadOnlyStateDB) =
|
||||||
for ac, accountData in wantedState:
|
for ac, accountData in wantedState:
|
||||||
let account = ethAddressFromHex(ac)
|
let account = ethAddressFromHex(ac)
|
||||||
|
|
Loading…
Reference in New Issue