Skip to main content

fork_env_op

Function fork_env_op 

Source
fn fork_env_op<CTX: FoundryContextExt, T: SolValue>(
    ecx: &mut CTX,
    f: impl FnOnce(&mut CTX::Db, &mut EvmEnv<CTX::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).