Skip to main content

fork_env_op

Function fork_env_op 

Source
fn fork_env_op<CTX: EthCheatCtx, T: SolValue>(
    ccx: &mut CheatsCtxt<'_, CTX>,
    f: impl FnOnce(&mut dyn DatabaseExt<CTX::Block, CTX::Tx, <CTX::Cfg as Cfg>::Spec>, &mut EvmEnv<<CTX::Cfg as Cfg>::Spec, CTX::Block>, &mut CTX::Tx, &mut JournaledState) -> Result<T>,
) -> Result
Expand description

Clones the EVM and tx environments, runs a fork operation that may modify them, then writes them back. This is the common pattern for all fork-switching cheatcodes (rollFork, selectFork, createSelectFork).