pub trait CheatcodesExecutor<FEN>where
FEN: FoundryEvmNetwork,{
// Required methods
fn exec_message(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
message: &mut MessageExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageExt>,
) -> Result<MessageResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageResultExt>, ExecutionError>;
fn nested_transaction(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>,
env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>;
fn transact(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
fork_id: Option<Uint<256, 4>>,
transaction: FixedBytes<32>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>;
fn transact_from_tx(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>,
env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>;
fn console_log(&mut self, msg: &str);
// Provided method
fn tracing_inspector(&mut self) -> Option<&mut TracingInspector> { ... }
}Expand description
Runs nested executions on behalf of cheatcodes.
The executor owns the inspectors besides Cheatcodes, so nested executions are observed by
the whole inspector stack: tracing, logs, coverage and cheatcodes themselves.
Required Methods§
Sourcefn exec_message(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
message: &mut MessageExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageExt>,
) -> Result<MessageResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageResultExt>, ExecutionError>
fn exec_message( &mut self, cheats: &mut Cheatcodes<FEN>, backend: &mut dyn CheatcodesBackend<FEN>, evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>, message: &mut MessageExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageExt>, ) -> Result<MessageResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::MessageResultExt>, ExecutionError>
Executes message as a nested frame of the transaction evm is running, with cheats
active, such as for deployCode or storage-hook callbacks.
Sourcefn nested_transaction(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>,
env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
fn nested_transaction( &mut self, cheats: &mut Cheatcodes<FEN>, backend: &mut dyn CheatcodesBackend<FEN>, evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>, depth: u16, tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>, env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>, ) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
Executes tx as a nested transaction of the transaction evm is running, with env or
the running environment, and merges its changes so that they survive reverts of the
enclosing calls, such as for executeTransaction. A failed transaction only keeps its nonce
increment.
depth is the depth of the cheatcode call; the nested transaction’s root frame duplicates
it, so its children run one level deeper.
Sourcefn transact(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
fork_id: Option<Uint<256, 4>>,
transaction: FixedBytes<32>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
fn transact( &mut self, cheats: &mut Cheatcodes<FEN>, backend: &mut dyn CheatcodesBackend<FEN>, evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>, depth: u16, fork_id: Option<Uint<256, 4>>, transaction: FixedBytes<32>, ) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
Replays a mined transaction of fork fork_id, or of the active fork, for vm.transact.
The replayed transaction runs with cheats active over a throwaway copy of backend, so
its cheatcodes cannot modify backend. Its root frame is a call below the cheatcode call
at depth.
Sourcefn transact_from_tx(
&mut self,
cheats: &mut Cheatcodes<FEN>,
backend: &mut dyn CheatcodesBackend<FEN>,
evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>,
depth: u16,
tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>,
env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>,
) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
fn transact_from_tx( &mut self, cheats: &mut Cheatcodes<FEN>, backend: &mut dyn CheatcodesBackend<FEN>, evm: &mut Evm<'_, <<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>, depth: u16, tx: &Recovered<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::Tx>, env: Option<EvmEnv<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types>>, ) -> Result<TxResultExt<<<<FEN as FoundryEvmNetwork>::EvmFactory as FoundryEvmFactory>::Types as EvmTypesHost>::TxResultExt>, Report>
Executes a signed transaction as a nested transaction, such as for
broadcastRawTransaction.
The transaction runs with cheats active over a throwaway copy of backend, in env or
the running environment for None. Its root frame is a call below the cheatcode call at
depth.
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".