Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trace): properly report fallback() fn #9287

Merged
merged 5 commits into from
Nov 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Execute test with traces
  • Loading branch information
grandizzy committed Nov 10, 2024
commit 3bee48f48559a89313346acd195bde7f65c93734
16 changes: 15 additions & 1 deletion crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
@@ -2443,12 +2443,26 @@ contract GasReportFallbackTest is Test {
)
.unwrap();

cmd.args(["test", "--mt", "test_fallback_gas_report", "--gas-report"])
cmd.args(["test", "--mt", "test_fallback_gas_report", "-vvvv", "--gas-report"])
.assert_success()
.stdout_eq(str![[r#"
...
Ran 1 test for test/DelegateProxyTest.sol:GasReportFallbackTest
[PASS] test_fallback_gas_report() ([GAS])
Traces:
[331067] GasReportFallbackTest::test_fallback_gas_report()
├─ [106511] → new ProxiedContract@[..]
│ └─ ← [Return] 246 bytes of code
├─ [108698] → new DelegateProxy@[..]
│ └─ ← [Return] 143 bytes of code
├─ [29396] DelegateProxy::fallback(100)
│ ├─ [3320] ProxiedContract::deposit(100) [delegatecall]
│ │ └─ ← [Stop]
│ └─ ← [Return]
├─ [21160] DelegateProxy::deposit()
│ └─ ← [Stop]
└─ ← [Stop]

Suite result: ok. 1 passed; 0 failed; 0 skipped; [ELAPSED]
| test/DelegateProxyTest.sol:DelegateProxy contract | | | | | |
|---------------------------------------------------|-----------------|-------|--------|-------|---------|