Skip to content

vm.assume(collateralAmount != 0) Not Working As Expected #1699

Answered by PatrickAlphaC
0xriyadh asked this question in Q&A
Discussion options

You must be logged in to vote

So vm.assume(_amountCollateral != 0); is sort of "dumb" with how it works with fuzz runs. In the video, that was actually a bit of a mistake of mine.

vm.assume(); will blindly toss the run if it sees a condition that is not satisfied, and essentially reverts. Since we have set fail_on_revert to true, this means that anytime vm.assume() hits a condition that evaluates to false the run is considered failed.

Does that make sense?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@0xriyadh
Comment options

@EngrPips
Comment options

Comment options

You must be logged in to vote
2 replies
@EngrPips
Comment options

@0xriyadh
Comment options

Answer selected by 0xriyadh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants