Open PaulRBerg opened 1 year ago
Related:
For the time being, PSA: forge-std
has a number of modifiers to help filter out these specific cases (I think added by OP): https://github.com/foundry-rs/forge-std/blob/75b3fcf052cc7886327e4c2eac3d1a1f36942b41/src/StdCheats.sol#L208-L278
The general request is still relevant so leaving the ticket open
Interested in take a stab at this!
Interested in take a stab at this!
assigned!
@PaulRBerg have you run into the scenario where you might want to toss-out multiple kinds of reverts for the same external call (while surfacing others)? Considering adding that functionality.
@emo-eth I have. I think this is what I was trying to get at with the OP — reverts due to USDC blacklisted addresses should be ignored.
@PaulRBerg Sorry, to be more specific, I mean multiple kinds of errors with different data, to cover a set of anticipated & acceptable revert reasons that might arise from one specific call. Think I have that working either way, but curious if you've run into that scenario.
I don't think I have.
Component
Forge
Describe the feature you would like
The use case is fork + fuzz tests - certain tokens like USDC have blacklists that prevent the transfer of assets between certain accounts (see lines 837 and 838 here). When Foundry fuzzes a blacklisted account, the Forge test will fail because of the following error:
However, this is a false negative. The user's test should not have failed.
It would be great if there were two config options for filtering revert reason strings and custom errors.