Trait revm::primitives::db::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: FixedBytes<32>
    ) -> Result<Bytecode, Self::Error>;
    fn storage(
        &self,
        address: Address,
        index: Uint<256, 4>
    ) -> Result<Uint<256, 4>, 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: FixedBytes<32> ) -> Result<Bytecode, Self::Error>

Get account code by its hash

source

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

Get storage value of address at index.

Implementations on Foreign Types§

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &self, address: Address ) -> Result<Option<AccountInfo>, <&'a T as StateRef>::Error>

source§

fn code_by_hash( &self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <&'a T as StateRef>::Error>

source§

fn storage( &self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <&'a T as StateRef>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &self, address: Address ) -> Result<Option<AccountInfo>, <&'a mut T as StateRef>::Error>

source§

fn code_by_hash( &self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <&'a mut T as StateRef>::Error>

source§

fn storage( &self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <&'a mut T as StateRef>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &self, address: Address ) -> Result<Option<AccountInfo>, <Box<T> as StateRef>::Error>

source§

fn code_by_hash( &self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <Box<T> as StateRef>::Error>

source§

fn storage( &self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <Box<T> as StateRef>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &self, address: Address ) -> Result<Option<AccountInfo>, <Rc<T> as StateRef>::Error>

source§

fn code_by_hash( &self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <Rc<T> as StateRef>::Error>

source§

fn storage( &self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <Rc<T> as StateRef>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &self, address: Address ) -> Result<Option<AccountInfo>, <Arc<T> as StateRef>::Error>

source§

fn code_by_hash( &self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <Arc<T> as StateRef>::Error>

source§

fn storage( &self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <Arc<T> as StateRef>::Error>

Implementors§