Skip to main content

EvmStateProvider

Trait EvmStateProvider 

Source
pub trait EvmStateProvider {
    // 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

Provides the state necessary for EVM execution.

Required Methods§

Source

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

Returns the account, or None if it does not exist.

Source

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

Returns the block hash, or None if the block does not exist.

Source

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

Returns bytecode by its hash.

Source

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

Returns the storage value of the given account and slot.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + EvmStateProvider + ?Sized> EvmStateProvider for &'a T

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: EvmStateProvider + ?Sized> EvmStateProvider for Arc<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: EvmStateProvider + ?Sized> EvmStateProvider for Box<T>

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§