Trait revm::precompile::primitives::db::Database
source · pub trait Database {
type Error;
// Required methods
fn basic(
&mut self,
address: Address
) -> Result<Option<AccountInfo>, Self::Error>;
fn code_by_hash(
&mut self,
code_hash: FixedBytes<32>
) -> Result<Bytecode, Self::Error>;
fn storage(
&mut self,
address: Address,
index: Uint<256, 4>
) -> Result<Uint<256, 4>, Self::Error>;
fn block_hash(
&mut self,
number: Uint<256, 4>
) -> Result<FixedBytes<32>, Self::Error>;
}
Expand description
EVM database interface.
Required Associated Types§
Required Methods§
sourcefn basic(
&mut self,
address: Address
) -> Result<Option<AccountInfo>, Self::Error>
fn basic( &mut self, address: Address ) -> Result<Option<AccountInfo>, Self::Error>
Get basic account information.
sourcefn code_by_hash(
&mut self,
code_hash: FixedBytes<32>
) -> Result<Bytecode, Self::Error>
fn code_by_hash( &mut self, code_hash: FixedBytes<32> ) -> Result<Bytecode, Self::Error>
Get account code by its hash.
sourcefn storage(
&mut self,
address: Address,
index: Uint<256, 4>
) -> Result<Uint<256, 4>, Self::Error>
fn storage( &mut self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, Self::Error>
Get storage value of address at index.
sourcefn block_hash(
&mut self,
number: Uint<256, 4>
) -> Result<FixedBytes<32>, Self::Error>
fn block_hash( &mut self, number: Uint<256, 4> ) -> Result<FixedBytes<32>, Self::Error>
Get block hash by block number.