fix test_blockchain_json -> add a call to accounts_cache.persist
This commit is contained in:
parent
46e9c11d3f
commit
079579c1cb
|
@ -14,7 +14,7 @@ import
|
||||||
../premix/parser, test_config,
|
../premix/parser, test_config,
|
||||||
../nimbus/vm/interpreter/vm_forks,
|
../nimbus/vm/interpreter/vm_forks,
|
||||||
../nimbus/[vm_state, utils, vm_types, errors, transaction, constants],
|
../nimbus/[vm_state, utils, vm_types, errors, transaction, constants],
|
||||||
../nimbus/db/[db_chain, state_db],
|
../nimbus/db/[db_chain, accounts_cache],
|
||||||
../nimbus/utils/header,
|
../nimbus/utils/header,
|
||||||
../nimbus/p2p/[executor, dao],
|
../nimbus/p2p/[executor, dao],
|
||||||
../nimbus/config
|
../nimbus/config
|
||||||
|
@ -299,6 +299,7 @@ proc assignBlockRewards(minedBlock: PlainBlock, vmState: BaseVMState, fork: Fork
|
||||||
# Reward beneficiary
|
# Reward beneficiary
|
||||||
vmState.mutateStateDB:
|
vmState.mutateStateDB:
|
||||||
db.addBalance(minedBlock.header.coinbase, mainReward)
|
db.addBalance(minedBlock.header.coinbase, mainReward)
|
||||||
|
db.persist()
|
||||||
|
|
||||||
let stateDb = vmState.accountDb
|
let stateDb = vmState.accountDb
|
||||||
if minedBlock.header.stateRoot != stateDb.rootHash:
|
if minedBlock.header.stateRoot != stateDb.rootHash:
|
||||||
|
@ -698,6 +699,7 @@ proc testFixture(node: JsonNode, testStatusIMPL: var TestStatus, debugMode = fal
|
||||||
|
|
||||||
vmState.mutateStateDB:
|
vmState.mutateStateDB:
|
||||||
setupStateDB(fixture["pre"], db)
|
setupStateDB(fixture["pre"], db)
|
||||||
|
db.persist()
|
||||||
|
|
||||||
let obtainedHash = $(vmState.readOnlyStateDB.rootHash)
|
let obtainedHash = $(vmState.readOnlyStateDB.rootHash)
|
||||||
check obtainedHash == $(tester.genesisBlockHeader.stateRoot)
|
check obtainedHash == $(tester.genesisBlockHeader.stateRoot)
|
||||||
|
|
Loading…
Reference in New Issue