example_cheatcode_inspector

Trait DatabaseExt

Source
pub(crate) trait DatabaseExt: Journal {
    // Required methods
    fn method_that_takes_inspector_as_argument<InspectorT, BlockT, TxT, CfgT, PrecompileT>(
        &mut self,
        env: Env<BlockT, TxT, CfgT>,
        inspector: InspectorT,
    ) -> Result<()>
       where InspectorT: Inspector<Context<BlockT, TxT, CfgT, InMemoryDB, Backend>, EthInterpreter> + GetInspector<Context<BlockT, TxT, CfgT, InMemoryDB, Backend>, EthInterpreter>,
             BlockT: Block,
             TxT: Transaction,
             CfgT: Cfg,
             PrecompileT: PrecompileProvider<Context = InspectorContext<InspectorT, InMemoryDB, Context<BlockT, TxT, CfgT, InMemoryDB, Backend>>, Output = InterpreterResult, Error = EVMError<Infallible, InvalidTransaction>>;
    fn method_that_constructs_inspector<BlockT, TxT, CfgT>(
        &mut self,
        env: Env<BlockT, TxT, CfgT>,
    ) -> Result<()>
       where BlockT: Block,
             TxT: Transaction,
             CfgT: Cfg;
}
Expand description

Used in Foundry to provide extended functionality to cheatcodes. The methods are called from the Cheatcodes inspector.

Required Methods§

Source

fn method_that_takes_inspector_as_argument<InspectorT, BlockT, TxT, CfgT, PrecompileT>( &mut self, env: Env<BlockT, TxT, CfgT>, inspector: InspectorT, ) -> Result<()>
where InspectorT: Inspector<Context<BlockT, TxT, CfgT, InMemoryDB, Backend>, EthInterpreter> + GetInspector<Context<BlockT, TxT, CfgT, InMemoryDB, Backend>, EthInterpreter>, BlockT: Block, TxT: Transaction, CfgT: Cfg, PrecompileT: PrecompileProvider<Context = InspectorContext<InspectorT, InMemoryDB, Context<BlockT, TxT, CfgT, InMemoryDB, Backend>>, Output = InterpreterResult, Error = EVMError<Infallible, InvalidTransaction>>,

Mimics DatabaseExt::transact See commit_transaction for the generics

Source

fn method_that_constructs_inspector<BlockT, TxT, CfgT>( &mut self, env: Env<BlockT, TxT, CfgT>, ) -> Result<()>
where BlockT: Block, TxT: Transaction, CfgT: Cfg,

Mimics DatabaseExt::roll_fork_to_transaction

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§