pub trait CheatcodesExecutor<FEN: FoundryEvmNetwork> {
// Required methods
fn with_nested_evm(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
f: NestedEvmClosureFor<'_, FEN>,
) -> Result<(), EVMError<DatabaseError>>;
fn transact_on_db(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
fork_id: Option<U256>,
transaction: B256,
) -> Result<ContextUpdateFor<EvmFactoryFor<FEN>>>;
fn transact_from_tx_on_db(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
tx: TxEnvFor<FEN>,
) -> Result<()>;
fn with_fresh_nested_evm(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
chain_context: ChainFor<FEN>,
f: NestedEvmClosureFor<'_, FEN>,
) -> Result<EvmEnv<SpecFor<FEN>, BlockEnvFor<FEN>>, EVMError<DatabaseError>>;
fn console_log(&mut self, msg: &str);
// Provided method
fn tracing_inspector(&mut self) -> Option<&mut TracingInspector> { ... }
}Expand description
Helper trait for running nested EVM operations from inside cheatcode implementations.
Required Methods§
Sourcefn with_nested_evm(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
f: NestedEvmClosureFor<'_, FEN>,
) -> Result<(), EVMError<DatabaseError>>
fn with_nested_evm( &mut self, cheats: &mut Cheatcodes<FEN>, ecx: &mut FoundryContextFor<'_, FEN>, f: NestedEvmClosureFor<'_, FEN>, ) -> Result<(), EVMError<DatabaseError>>
Runs a closure with a nested EVM built from the current context. The inspector is assembled internally — never exposed to the caller.
Sourcefn transact_on_db(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
fork_id: Option<U256>,
transaction: B256,
) -> Result<ContextUpdateFor<EvmFactoryFor<FEN>>>
fn transact_on_db( &mut self, cheats: &mut Cheatcodes<FEN>, ecx: &mut FoundryContextFor<'_, FEN>, fork_id: Option<U256>, transaction: B256, ) -> Result<ContextUpdateFor<EvmFactoryFor<FEN>>>
Replays a historical transaction on the database. Inspector is assembled internally.
Sourcefn transact_from_tx_on_db(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
tx: TxEnvFor<FEN>,
) -> Result<()>
fn transact_from_tx_on_db( &mut self, cheats: &mut Cheatcodes<FEN>, ecx: &mut FoundryContextFor<'_, FEN>, tx: TxEnvFor<FEN>, ) -> Result<()>
Executes a TransactionRequest on the database. Inspector is assembled internally.
Sourcefn with_fresh_nested_evm(
&mut self,
cheats: &mut Cheatcodes<FEN>,
ecx: &mut FoundryContextFor<'_, FEN>,
chain_context: ChainFor<FEN>,
f: NestedEvmClosureFor<'_, FEN>,
) -> Result<EvmEnv<SpecFor<FEN>, BlockEnvFor<FEN>>, EVMError<DatabaseError>>
fn with_fresh_nested_evm( &mut self, cheats: &mut Cheatcodes<FEN>, ecx: &mut FoundryContextFor<'_, FEN>, chain_context: ChainFor<FEN>, f: NestedEvmClosureFor<'_, FEN>, ) -> Result<EvmEnv<SpecFor<FEN>, BlockEnvFor<FEN>>, EVMError<DatabaseError>>
Runs a closure with a fresh nested EVM using the current environment and database.
Unlike with_nested_evm, this starts an independent journal and does not write back.
The caller is responsible for state merging. Used by executeTransactionCall.
Returns the final EVM environment after the closure runs (consumed without cloning).
Sourcefn console_log(&mut self, msg: &str)
fn console_log(&mut self, msg: &str)
Simulates console.log invocation.
Provided Methods§
Sourcefn tracing_inspector(&mut self) -> Option<&mut TracingInspector>
fn tracing_inspector(&mut self) -> Option<&mut TracingInspector>
Returns a mutable reference to the tracing inspector if it is available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".