LedgerRef: stateOrVoid become stateEmptyOrVoid (#2394)

This commit is contained in:
andri lim 2024-06-19 19:14:36 +07:00 committed by GitHub
parent c8ae6b1a92
commit 0e5fd3ffc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -479,9 +479,9 @@ proc state*(col: CoreDbColRef): CoreDbRc[Hash256] =
# Note: tracker will be silent if `vid` is NIL
col.ifTrackNewApi: debug newApiTxt, api, elapsed, col, result
proc stateOrVoid*(col: CoreDbColRef): Hash256 =
## Convenience wrapper, returns `EMPTY_ROOT_HASH` where `state()` would fail.
col.state.valueOr: EMPTY_ROOT_HASH
proc stateEmptyOrVoid*(col: CoreDbColRef): bool =
## Convenience wrapper, returns `true` where `stateEmpty()` would fail.
col.stateEmpty.valueOr: true
# ------------------------------------------------------------------------------
# Public Merkle Patricia Tree, hexary trie constructors

View File

@ -458,7 +458,7 @@ proc contractCollision*(ac: AccountsLedgerRef, address: EthAddress): bool =
return
acc.statement.nonce != 0 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 =
let acc = ac.getAccount(address, false)