Trait reth_revm::database::EvmStateProvider

source ·
pub trait EvmStateProvider: Send + Sync {
    // Required methods
    fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>>;
    fn block_hash(&self, number: BlockNumber) -> ProviderResult<Option<B256>>;
    fn bytecode_by_hash(
        &self,
        code_hash: B256,
    ) -> ProviderResult<Option<Bytecode>>;
    fn storage(
        &self,
        account: Address,
        storage_key: StorageKey,
    ) -> ProviderResult<Option<StorageValue>>;
}
Expand description

A helper trait responsible for providing state necessary for EVM execution.

This serves as the data layer for Database.

Required Methods§

source

fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>>

Get basic account information.

Returns None if the account doesn’t exist.

source

fn block_hash(&self, number: BlockNumber) -> ProviderResult<Option<B256>>

Get the hash of the block with the given number. Returns None if no block with this number exists.

source

fn bytecode_by_hash(&self, code_hash: B256) -> ProviderResult<Option<Bytecode>>

Get account code by hash.

source

fn storage( &self, account: Address, storage_key: StorageKey, ) -> ProviderResult<Option<StorageValue>>

Get storage of the given account.

Implementors§

source§

impl<T: StateProvider> EvmStateProvider for T