Skip to content

refactor(cheatcodes): CheatcodesExecutor generic #13774

Merged
zerosnacks merged 1 commit intofoundry-rs:masterfrom
figtracer:refactor/generic-cheatcodes-executor
Mar 16, 2026
Merged

refactor(cheatcodes): CheatcodesExecutor generic #13774
zerosnacks merged 1 commit intofoundry-rs:masterfrom
figtracer:refactor/generic-cheatcodes-executor

Conversation

@figtracer
Copy link
Contributor

Makes CheatcodesExecutor<CTX> use generic env types from ContextTr instead of concrete EvmEnv/TxEnv:

  • evm_env: EvmEnvEvmEnv<<CTX::Cfg as Cfg>::Spec, CTX::Block>
  • tx_env: TxEnvCTX::Tx

Adds equality constraints (Block = BlockEnv, Tx = TxEnv, Cfg = CfgEnv) to CheatsCtxExt so existing Eth impls keep compiling. Relaxes bounds to ContextTr where possible (pauseTracing, resumeTracing, startDebugTraceRecording, stopAndReturnDebugTraceRecording, skip_1Call).

The trait is now network-generic; the impls remain Eth-bound via CheatsCtxExt.

…types from `ContextTr`

Replace concrete `EvmEnv`/`TxEnv` in `with_fresh_nested_evm` with
`EvmEnv<<CTX::Cfg as Cfg>::Spec, CTX::Block>` and `CTX::Tx` to support
non-Eth networks. Add `FoundryContextTr` trait as fully generic
counterpart to the concrete `FoundryContextExt`. Remove unused
`clone_to_cfg_env`/`apply_cfg_env` from `FoundryCfg`.
@zerosnacks zerosnacks merged commit 69ab6d6 into foundry-rs:master Mar 16, 2026
16 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Mar 16, 2026
@figtracer figtracer deleted the refactor/generic-cheatcodes-executor branch March 16, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants