pub trait Database {
    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>;
    fn block_hash(&mut self, number: U256) -> Result<B256, 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.

source

fn block_hash(&mut self, number: U256) -> Result<B256, Self::Error>

Implementations on Foreign Types§

source§

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

§

type Error = <T as Database>::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§

fn block_hash(&mut self, number: U256) -> Result<B256, Self::Error>

source§

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

§

type Error = <T as Database>::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§

fn block_hash(&mut self, number: U256) -> Result<B256, Self::Error>

Implementors§

source§

impl<'a, Error> Database for RefDBWrapper<'a, Error>

§

type Error = Error

source§

impl<S: State, BH: BlockHash> Database for DatabaseComponents<S, BH>