Commit 0d2a1d3
fix(cheatcodes): fix vm.expectRevert for direct precompile calls (#13460)
Precompile calls don't create an interpreter frame, so
`initialize_interp` never fires and `max_depth` never gets bumped
beyond the cheatcode call depth. This causes the depth check in
`handle_expect_revert` to fail with "call didn't revert at a lower
depth than cheatcode call depth".
Track `max_depth` in the `call` hook as well, accounting for the
callee depth (`curr_depth + 1`).
Amp-Thread-ID: https://ampcode.com/threads/T-019c63a2-2c36-7334-ab55-2931a174b59c
Co-authored-by: Amp <amp@ampcode.com>1 parent f8e3dfa commit 0d2a1d3
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
769 | 776 | | |
770 | 777 | | |
771 | 778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
416 | 428 | | |
417 | 429 | | |
418 | 430 | | |
| |||
0 commit comments