pub(crate) trait Cheatcode: CheatcodeDef {
// Provided methods
fn apply_context(&self, _state: &mut CheatcodesCore) -> Result { ... }
fn apply_stateful<FEN: FoundryEvmNetwork>(
&self,
ccx: &mut CheatsCtxt<'_, '_, FEN>,
) -> Result { ... }
fn apply_full<FEN: FoundryEvmNetwork>(
&self,
ccx: &mut CheatsCtxt<'_, '_, FEN>,
executor: &mut dyn CheatcodesExecutor<FEN>,
) -> Result { ... }
fn apply_context_free(&self) -> Result { ... }
}Expand description
Cheatcode implementation.
Provided Methods§
Sourcefn apply_context(&self, _state: &mut CheatcodesCore) -> Result
fn apply_context(&self, _state: &mut CheatcodesCore) -> Result
Applies this cheatcode to the given state.
Implement this function if you need cheatcode state but no access to the EVM context.
Sourcefn apply_stateful<FEN: FoundryEvmNetwork>(
&self,
ccx: &mut CheatsCtxt<'_, '_, FEN>,
) -> Result
fn apply_stateful<FEN: FoundryEvmNetwork>( &self, ccx: &mut CheatsCtxt<'_, '_, FEN>, ) -> Result
Applies this cheatcode to the given context.
Implement this function if you need access to the EVM data.
Sourcefn apply_full<FEN: FoundryEvmNetwork>(
&self,
ccx: &mut CheatsCtxt<'_, '_, FEN>,
executor: &mut dyn CheatcodesExecutor<FEN>,
) -> Result
fn apply_full<FEN: FoundryEvmNetwork>( &self, ccx: &mut CheatsCtxt<'_, '_, FEN>, executor: &mut dyn CheatcodesExecutor<FEN>, ) -> Result
Applies this cheatcode to the given context and executor.
Implement this function if you need access to the executor.
Sourcefn apply_context_free(&self) -> Result
fn apply_context_free(&self) -> Result
Applies this cheatcode without accessing cheatcode state or the EVM context.
This may still read or modify external host state, such as environment variables.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".