change in testRevertsIfCollateralIsNotAllowed in advaned Foundry
#42
0xshubhs
started this conversation in
Show and tell
Replies: 1 comment
-
|
Hey @0xshubhs, Thank you so much for this heads-up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
theres a change nw we have to use abi.encodeWithSelector for expected reverts for Token Not Allowed
for eg this doesnt work
because the error is defined with a parameter address token. When using vm.expectRevert with a custom error that has parameters, you need to encode the full error with its parameters, not just use the selector, so changing
vm.expectRevert(DSCEngine.DSCEngine__TokenNotAllowed.selector)tovm.expectRevert(abi.encodeWithSelector(DSCEngine.DSCEngine__TokenNotAllowed.selector, address(meowToken)))since the error includes the token address as a parameter.PS: meowToken is ranToken lol , this is in latest update of foundry
Beta Was this translation helpful? Give feedback.
All reactions