Skip to main content

sync_tx_after_env_override_restore

Function sync_tx_after_env_override_restore 

Source
fn sync_tx_after_env_override_restore<FEN: FoundryEvmNetwork>(
    ccx: &mut CheatsCtxt<'_, '_, FEN>,
)
Expand description

Syncs the real tx fields to match restored env_overrides.

evm_clone / set_evm only save/restore cfg+block, not tx. When a cheatcode like vm.blobhashes or vm.txGasPrice mutates both the override and the real tx, reverting to a snapshot where the override was absent would leave the real tx field stale. This brings them back into sync so callers that read the tx directly also see the rolled-back state.