Closed morbius13 closed 1 year ago
revertedWith() takes one argument i.e some error string that you want to assert for while revertedWithCustomError() takes two argument contract and CustomError
@morbius13 Yes, in the latest versions of hardhat errors
are considered as Custom Error and for handling them we need to use revertedWithCustomError()
Describe the enhancement
I kept getting errors when I used revertedWith() on custom errors. Only when I replaced it to revertedWithCustomError() it worked.
For example:
Instead of:
This: