supportRevertedWithCustomError
doesn't check if revert happened from the same contract address
#6148
Labels
supportRevertedWithCustomError
doesn't check if revert happened from the same contract address
#6148
Version of Hardhat
2.22.15
Version of hardhat chai matchers
@nomicfoundation/[email protected]
What happened?
Assume I have the following:
The above will succeed even though the error is emitted from
multisig
instead ofblaxblux
. After looking the src code here, I realize that you don't check if the contract addresses match. The code comes to this but nowhere, you assert if the contract address from which revert happened matches the expected one.What's the rationale for this ? this seems dangerous as tests could silently succeed even though they shouldn't.
Minimal reproduction steps
I didn't want to yet produce the example as src code I provided for hardhat-chai-matchers clearly doesn't have what I am asking. If necessary, I will provide the example code.
Search terms
No response
The text was updated successfully, but these errors were encountered: