premix: fixes debug tool, dispose db changes

This commit is contained in:
andri lim 2019-02-06 17:21:02 +07:00 committed by zah
parent 2f208c32e0
commit 601350d8d0
1 changed files with 5 additions and 1 deletions

View File

@ -20,14 +20,18 @@ proc executeBlock(blockEnv: JsonNode, memoryDB: TrieDatabaseRef, blockNumber: Ui
body = chainDB.getBlockBody(header.blockHash)
let
transaction = memoryDB.beginTransaction()
vmState = newBaseVMState(parent, chainDB)
validationResult = processBlock(chainDB, parent, header, body, vmState)
if validationResult != ValidationResult.OK:
if validationResult != ValidationResult.OK:
error "block validation error", validationResult
else:
info "block validation success", validationResult, blockNumber
# success or not dispose it
transaction.dispose()
dumpDebuggingMetaData(chainDB, header, body, vmState, false)
let
fileName = "debug" & $blockNumber & ".json"