revm_primitives::db::components::state

Trait StateRef

Source
pub trait StateRef {
    type Error;

    // Required methods
    fn basic(
        &self,
        address: Address,
    ) -> Result<Option<AccountInfo>, Self::Error>;
    fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>;
    fn storage(
        &self,
        address: Address,
        index: U256,
    ) -> Result<U256, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Get basic account information.

Source

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Get account code by its hash

Source

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Get storage value of address at index.

Implementations on Foreign Types§

Source§

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

Source§

type Error = <T as StateRef>::Error

Source§

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Source§

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

Source§

type Error = <T as StateRef>::Error

Source§

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Source§

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

Source§

type Error = <T as StateRef>::Error

Source§

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Source§

impl<T: StateRef + ?Sized> StateRef for Rc<T>

Source§

type Error = <T as StateRef>::Error

Source§

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Source§

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

Source§

type Error = <T as StateRef>::Error

Source§

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error>

Implementors§