mirror of https://github.com/status-im/nim-eth.git
AbstractChainDB.getStateDb() renamed to getTrieDB()
This commit is contained in:
parent
4ac8812707
commit
1481c824fa
|
@ -347,7 +347,7 @@ method getBlockBody*(db: AbstractChainDB, blockHash: KeccakHash): BlockBodyRef {
|
||||||
method getReceipt*(db: AbstractChainDB, hash: KeccakHash): ReceiptRef {.base, gcsafe.} =
|
method getReceipt*(db: AbstractChainDB, hash: KeccakHash): ReceiptRef {.base, gcsafe.} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getStateDb*(db: AbstractChainDB): TrieDatabaseRef {.base, gcsafe.} =
|
method getTrieDB*(db: AbstractChainDB): TrieDatabaseRef {.base, gcsafe.} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getCodeByHash*(db: AbstractChainDB, hash: KeccakHash): Blob {.base, gcsafe.} =
|
method getCodeByHash*(db: AbstractChainDB, hash: KeccakHash): Blob {.base, gcsafe.} =
|
||||||
|
|
|
@ -15,11 +15,11 @@ proc getAccount*(db: TrieDatabaseRef,
|
||||||
proc getContractCode*(chain: AbstractChainDB, req: ContractCodeRequest): Blob {.gcsafe.} =
|
proc getContractCode*(chain: AbstractChainDB, req: ContractCodeRequest): Blob {.gcsafe.} =
|
||||||
let b = chain.getBlockHeader(req.blockHash)
|
let b = chain.getBlockHeader(req.blockHash)
|
||||||
if b.hasData:
|
if b.hasData:
|
||||||
let acc = getAccount(chain.getStateDb, b.stateRoot, req.key)
|
let acc = getAccount(chain.getTrieDB, b.stateRoot, req.key)
|
||||||
result = chain.getCodeByHash(acc.codeHash)
|
result = chain.getCodeByHash(acc.codeHash)
|
||||||
|
|
||||||
proc getStorageNode*(chain: AbstractChainDB, hash: KeccakHash): Blob =
|
proc getStorageNode*(chain: AbstractChainDB, hash: KeccakHash): Blob =
|
||||||
let db = chain.getStateDb
|
let db = chain.getTrieDB
|
||||||
return db.get(hash.data)
|
return db.get(hash.data)
|
||||||
# let trie = initSecureHexaryTrie(db, emptyRlpHash) # TODO emptyRlpHash is not correct here
|
# let trie = initSecureHexaryTrie(db, emptyRlpHash) # TODO emptyRlpHash is not correct here
|
||||||
# return trie.get(unnecessary_OpenArrayToRange hash.data)
|
# return trie.get(unnecessary_OpenArrayToRange hash.data)
|
||||||
|
|
Loading…
Reference in New Issue