Support custom error selectors in revertedWithCustomError
Chai matcher
#6484
Labels
status:ready
This issue is ready to be worked on
Uh oh!
There was an error while loading. Please reload this page.
Describe the feature
What is the reasoning behind requiring an interface to be passed to
revertedWithCustomError
? The error name string itself should be enough to run the assertion.In my case, the contract I'm testing takes a custom error selector as a parameter and reverts with that error using assembly. The errors do not exist in the contract ABI, so I have to pass in a fake interface to the matcher.
If this process could be encapsulated within the matcher code, the matcher could be used like this:
Maybe the
withArgs
extension needs the full interface to process its arguments. In that case, maybe require the full error signature?Search terms
revertedWithCustomError
Similar to #5818, but more specifically related to errors that do not exist on the contract being tested.
The text was updated successfully, but these errors were encountered: