anvil::eth::backend::db

Trait MaybeForkedDatabase

Source
pub trait MaybeForkedDatabase {
    // Required methods
    fn maybe_reset(
        &mut self,
        _url: Option<String>,
        block_number: BlockId,
    ) -> Result<(), String>;
    fn maybe_flush_cache(&self) -> Result<(), String>;
    fn maybe_inner(&self) -> Result<&BlockchainDb, String>;
}
Expand description

Helper trait to reset the DB if it’s forked

Required Methods§

Source

fn maybe_reset( &mut self, _url: Option<String>, block_number: BlockId, ) -> Result<(), String>

Source

fn maybe_flush_cache(&self) -> Result<(), String>

Source

fn maybe_inner(&self) -> Result<&BlockchainDb, String>

Implementations on Foreign Types§

Source§

impl<T: DatabaseRef<Error = DatabaseError>> MaybeForkedDatabase for CacheDB<T>

Source§

fn maybe_reset( &mut self, _url: Option<String>, _block_number: BlockId, ) -> Result<(), String>

Source§

fn maybe_flush_cache(&self) -> Result<(), String>

Source§

fn maybe_inner(&self) -> Result<&BlockchainDb, String>

Implementors§