Trait TrieDBProvider

Source
pub trait TrieDBProvider: TrieProvider {
    // Required methods
    fn bytecode_by_hash(&self, code_hash: B256) -> Result<Bytes, Self::Error>;
    fn header_by_hash(&self, hash: B256) -> Result<Header, Self::Error>;
}
Expand description

The TrieDBProvider trait defines the synchronous interface for fetching EVM bytecode hash preimages as well as Header preimages.

Required Methods§

Source

fn bytecode_by_hash(&self, code_hash: B256) -> Result<Bytes, Self::Error>

Fetches the preimage of the bytecode hash provided.

§Takes
  • hash: The hash of the bytecode.
§Returns
  • Ok(Bytes): The bytecode of the contract.
  • Err(Self::Error): If the bytecode hash could not be fetched.
Source

fn header_by_hash(&self, hash: B256) -> Result<Header, Self::Error>

Fetches the preimage of Header hash provided.

§Takes
  • hash: The hash of the RLP-encoded Header.
§Returns
  • Ok(Bytes): The Header.
  • Err(Self::Error): If the Header could not be fetched.

Implementors§