pub trait EvmStateProvider {
// Required methods
fn basic_account(
&self,
address: &Address,
) -> Result<Option<Account>, ProviderError>;
fn block_hash(
&self,
number: u64,
) -> Result<Option<FixedBytes<32>>, ProviderError>;
fn bytecode_by_hash(
&self,
code_hash: &FixedBytes<32>,
) -> Result<Option<Bytecode>, ProviderError>;
fn storage(
&self,
account: Address,
storage_key: FixedBytes<32>,
) -> Result<Option<Uint<256, 4>>, ProviderError>;
}Available on crate feature
provider only.Expand description
Provides the state necessary for EVM execution.
Required Methods§
Sourcefn basic_account(
&self,
address: &Address,
) -> Result<Option<Account>, ProviderError>
fn basic_account( &self, address: &Address, ) -> Result<Option<Account>, ProviderError>
Returns the account, or None if it does not exist.
Sourcefn block_hash(
&self,
number: u64,
) -> Result<Option<FixedBytes<32>>, ProviderError>
fn block_hash( &self, number: u64, ) -> Result<Option<FixedBytes<32>>, ProviderError>
Returns the block hash, or None if the block does not exist.
Sourcefn bytecode_by_hash(
&self,
code_hash: &FixedBytes<32>,
) -> Result<Option<Bytecode>, ProviderError>
fn bytecode_by_hash( &self, code_hash: &FixedBytes<32>, ) -> Result<Option<Bytecode>, ProviderError>
Returns bytecode by its hash.
Sourcefn storage(
&self,
account: Address,
storage_key: FixedBytes<32>,
) -> Result<Option<Uint<256, 4>>, ProviderError>
fn storage( &self, account: Address, storage_key: FixedBytes<32>, ) -> Result<Option<Uint<256, 4>>, ProviderError>
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".