EngineDatabaseInterface

Trait EngineDatabaseInterface 

Source
pub trait EngineDatabaseInterface:
    DatabaseRef
    + Send
    + Sync {
    type Error;

    // Required methods
    fn init_account(
        &self,
        address: Address,
        account: AccountInfo,
        permanent_storage: Option<HashMap<U256, U256>>,
        mocked: bool,
    ) -> Result<(), <Self as EngineDatabaseInterface>::Error>;
    fn clear_temp_storage(
        &mut self,
    ) -> Result<(), <Self as EngineDatabaseInterface>::Error>;
    fn get_current_block(&self) -> Option<BlockHeader>;
}

Required Associated Types§

Required Methods§

Source

fn init_account( &self, address: Address, account: AccountInfo, permanent_storage: Option<HashMap<U256, U256>>, mocked: bool, ) -> Result<(), <Self as EngineDatabaseInterface>::Error>

Sets up a single account

Full control over setting up an accounts. Allows to set up EOAs as well as smart contracts.

§Arguments
  • address - Address of the account
  • account - The account information
  • permanent_storage - Storage to init the account with this storage can only be updated manually.
  • mocked - Whether this account should be considered mocked. For mocked accounts, nothing is downloaded from a node; all data must be inserted manually.
Source

fn clear_temp_storage( &mut self, ) -> Result<(), <Self as EngineDatabaseInterface>::Error>

Source

fn get_current_block(&self) -> Option<BlockHeader>

Gets the block header that this database is operating at.

§Returns
  • Option<BlockHeader> - The current block header, or None if no block is set

Implementors§