Skip to main content

BackingDb

Trait BackingDb 

Source
pub trait BackingDb:
    FoundryDatabase
    + Send
    + Sync
    + 'static {
    // Required method
    fn clone_backing(&self) -> Box<dyn BackingDb>;
}
Expand description

A shareable backing database: every fork and every nested transaction reads through its own handle to the same source.

Required Methods§

Source

fn clone_backing(&self) -> Box<dyn BackingDb>

Returns another handle to the same source.

Trait Implementations§

Source§

impl FoundryDatabase for Box<dyn BackingDb>

Source§

fn is_forked_mode(&self) -> bool

Whether the database is currently in forked mode.
Source§

fn active_fork_source_chain_id(&self) -> Option<u64>

Returns the source chain ID of the active fork, independent of execution overrides.
Source§

fn evict_account(&self, address: &Address)

Drops remotely cached state of address, so the next read refetches it.
Source§

fn evict_storage(&self, address: &Address, slot: &U256)

Drops a remotely cached storage slot, so the next read refetches it.
Source§

fn set_eip161(&self, eip161: bool)

Sets whether the execution reading this database applies EIP-161, under which empty accounts do not exist.
Source§

fn prefetch_call( &self, caller: Address, target: Address, value: U256, input: Bytes, local: Option<&Cache>, overrides: bool, )

Prefetches the remote state a call is about to read, if this database reads a remote fork. With overrides, the local state over this database goes along as overrides. A call sent without overrides is skipped when the fork loaded its target without code. It is also skipped when local holds its target but the fork never loaded it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D: FoundryDatabase + Clone + Send + Sync + 'static> BackingDb for D