LedgerRef: stateOrVoid become stateEmptyOrVoid (#2394)
This commit is contained in:
parent
c8ae6b1a92
commit
0e5fd3ffc9
|
@ -479,9 +479,9 @@ proc state*(col: CoreDbColRef): CoreDbRc[Hash256] =
|
||||||
# Note: tracker will be silent if `vid` is NIL
|
# Note: tracker will be silent if `vid` is NIL
|
||||||
col.ifTrackNewApi: debug newApiTxt, api, elapsed, col, result
|
col.ifTrackNewApi: debug newApiTxt, api, elapsed, col, result
|
||||||
|
|
||||||
proc stateOrVoid*(col: CoreDbColRef): Hash256 =
|
proc stateEmptyOrVoid*(col: CoreDbColRef): bool =
|
||||||
## Convenience wrapper, returns `EMPTY_ROOT_HASH` where `state()` would fail.
|
## Convenience wrapper, returns `true` where `stateEmpty()` would fail.
|
||||||
col.state.valueOr: EMPTY_ROOT_HASH
|
col.stateEmpty.valueOr: true
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Public Merkle Patricia Tree, hexary trie constructors
|
# Public Merkle Patricia Tree, hexary trie constructors
|
||||||
|
|
|
@ -458,7 +458,7 @@ proc contractCollision*(ac: AccountsLedgerRef, address: EthAddress): bool =
|
||||||
return
|
return
|
||||||
acc.statement.nonce != 0 or
|
acc.statement.nonce != 0 or
|
||||||
acc.statement.codeHash != EMPTY_CODE_HASH or
|
acc.statement.codeHash != EMPTY_CODE_HASH or
|
||||||
acc.statement.storage.stateOrVoid != EMPTY_ROOT_HASH
|
not acc.statement.storage.stateEmptyOrVoid
|
||||||
|
|
||||||
proc accountExists*(ac: AccountsLedgerRef, address: EthAddress): bool =
|
proc accountExists*(ac: AccountsLedgerRef, address: EthAddress): bool =
|
||||||
let acc = ac.getAccount(address, false)
|
let acc = ac.getAccount(address, false)
|
||||||
|
|
Loading…
Reference in New Issue