pub trait NestedEvm {
type Tx;
type Block;
type Spec;
// Required methods
fn journal_inner_mut(&mut self) -> &mut JournaledState;
fn run_execution(
&mut self,
frame: FrameInput,
) -> Result<FrameResult, EVMError<DatabaseError>>;
fn transact(
&mut self,
tx: Self::Tx,
) -> Result<ResultAndState<HaltReason>, EVMError<DatabaseError>>;
fn to_evm_env(&self) -> EvmEnv<Self::Spec, Self::Block>;
}Expand description
Object-safe trait exposing the operations that cheatcode nested EVM closures need.
This abstracts over the concrete EVM type (FoundryEvm, future TempoEvm, etc.)
so that cheatcode impls can build and run nested EVMs without knowing the concrete type.
Required Associated Types§
Required Methods§
Sourcefn journal_inner_mut(&mut self) -> &mut JournaledState
fn journal_inner_mut(&mut self) -> &mut JournaledState
Returns a mutable reference to the journal inner state (JournaledState).
Sourcefn run_execution(
&mut self,
frame: FrameInput,
) -> Result<FrameResult, EVMError<DatabaseError>>
fn run_execution( &mut self, frame: FrameInput, ) -> Result<FrameResult, EVMError<DatabaseError>>
Runs a single execution frame (create or call) through the EVM handler loop.
Sourcefn transact(
&mut self,
tx: Self::Tx,
) -> Result<ResultAndState<HaltReason>, EVMError<DatabaseError>>
fn transact( &mut self, tx: Self::Tx, ) -> Result<ResultAndState<HaltReason>, EVMError<DatabaseError>>
Executes a full transaction with the given tx env.
Sourcefn to_evm_env(&self) -> EvmEnv<Self::Spec, Self::Block>
fn to_evm_env(&self) -> EvmEnv<Self::Spec, Self::Block>
Returns a snapshot of the current EVM environment (cfg + block).