Add hasCodeOrNonce

This commit is contained in:
coffeepots 2018-09-03 19:24:55 +01:00
parent 4a9b1a4a1f
commit 350bf7e672
1 changed files with 3 additions and 0 deletions

View File

@ -138,3 +138,6 @@ proc getCode*(db: AccountStateDB, address: EthAddress): ByteRange =
proc dumpAccount*(db: AccountStateDB, addressS: string): string =
let address = addressS.parseAddress
return fmt"{addressS}: Storage: {db.getStorage(address, 0.u256)}; getAccount: {db.getAccount address}"
proc hasCodeOrNonce*(account: AccountStateDB, address: EthAddress): bool {.inline.} =
account.getNonce(address) != 0 or account.getCodeHash(address) != EMPTY_SHA3