pub trait State {
    type Error;

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

Required Associated Types§

Required Methods§

source

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

Get basic account information.

source

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

Get account code by its hash

source

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

Get storage value of address at index.

Implementations on Foreign Types§

source§

impl<T> State for Arc<T>where T: StateRef,

§

type Error = <T as StateRef>::Error

source§

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

source§

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

source§

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

source§

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

§

type Error = <T as State>::Error

source§

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

source§

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

source§

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

source§

impl<T> State for &Twhere T: StateRef,

§

type Error = <T as StateRef>::Error

source§

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

source§

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

source§

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

source§

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

§

type Error = <T as State>::Error

source§

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

source§

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

source§

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

Implementors§