You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We return non-helpful errors when there is a problem with a known cheat code. For instance, here we know we are inside ffi but we return BadCheatCode with sig which doesn't add much debugging value.
Ideally, in the error, we should have the method + args like ffi(string[]) and a failure reason.
The text was updated successfully, but these errors were encountered:
Thanks for this! I have done some work on this, but for the life of me I can't find a way to test it 😆 Please see PR #503
There, the file test/contracts/pass/cheatCodeErrors.sol is what's supposed to trigger the error. However, it seems like the interpreter ignores that there are too few arguments (1 instead of 2). I can't seem to make the interpreter die. If you change the 0x24 to 0x44 there, the hevm.deal works, so indeed it is a correct call.
So I'm stuck at testing my new fix. Do you know how could I write that inline assembly such that the interpreter will die with a BadCheatcode and I could test my error code? On bad selector, it reverts, on incorrect parameters it just runs happily ever after, I'm confused how to actually trigger one of these 😆
We return non-helpful errors when there is a problem with a known cheat code. For instance, here we know we are inside
ffi
but we returnBadCheatCode
withsig
which doesn't add much debugging value.Ideally, in the error, we should have the method + args like
ffi(string[])
and a failure reason.The text was updated successfully, but these errors were encountered: