From a7a168d4e54f9ecbdf6b314210f8a7cc6065f4ad Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "core: remove unused ContractCode method from BlockChain (#27186)" This reverts commit 317d990522bb53252b25a60ef6b9ae28c8c58551. --- core/blockchain_reader.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/blockchain_reader.go b/core/blockchain_reader.go index fd65cb2db3..a04323255c 100644 --- a/core/blockchain_reader.go +++ b/core/blockchain_reader.go @@ -299,6 +299,12 @@ func (bc *BlockChain) TrieNode(hash common.Hash) ([]byte, error) { return bc.stateCache.TrieDB().Node(hash) } +// ContractCode retrieves a blob of data associated with a contract hash +// either from ephemeral in-memory cache, or from persistent storage. +func (bc *BlockChain) ContractCode(hash common.Hash) ([]byte, error) { + return bc.stateCache.ContractCode(common.Hash{}, hash) +} + // ContractCodeWithPrefix retrieves a blob of data associated with a contract // hash either from ephemeral in-memory cache, or from persistent storage. //