feat(cheatcodes): inversion of control for CheatcodesExecutor#13651
Closed
figtracer wants to merge 1 commit intofoundry-rs:masterfrom
Closed
feat(cheatcodes): inversion of control for CheatcodesExecutor#13651figtracer wants to merge 1 commit intofoundry-rs:masterfrom
CheatcodesExecutor#13651figtracer wants to merge 1 commit intofoundry-rs:masterfrom
Conversation
2 tasks
0cf1f87 to
b2d9e9e
Compare
mablr
reviewed
Mar 6, 2026
Collaborator
mablr
left a comment
There was a problem hiding this comment.
We may skip this one to merge directly #13652 since NestedEvmExt is immediately replaced ? Is this okay @figtracer ?
The free function approach with a closure seems lighter.
Collaborator
Author
For sure, might be more contained this way |
443ed1f to
a6a759b
Compare
Remove `get_inspector()` which returned `Box<dyn InspectorExt>` (Eth-bound). Instead, the executor now assembles the inspector internally and owns the entire operation: - `with_nested_evm`: runs closure with nested EVM cloned from context - `with_fresh_nested_evm`: runs closure with fresh EVM from raw db+env - `transact_on_db`: replays historical transaction - `transact_from_tx_on_db`: executes a TransactionRequest `InspectorExt` no longer appears on the `CheatcodesExecutor` trait boundary. It only lives inside the impl bodies of `InspectorStackInner` and `TransparentCheatcodesExecutor`.
a6a759b to
ddc8e38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_inspector() -> Box<dyn InspectorExt>fromCheatcodesExecutorwith_nested_evm,with_fresh_nested_evm,transact_on_db,transact_from_tx_on_dbInspectorExtno longer appears on theCheatcodesExecutortrait boundaryStack: #13650 → PR 2/3 → #next
Depends on #13650
Test plan
cargo checkpasses (zero errors, zero warnings)