-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: hardhat-chai-matchers - add check byte32 string to reverted matcher #5738
Conversation
🦋 Changeset detectedLatest commit: 36a8891 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (receipt === null) { | ||
// If the receipt is null, maybe the string is a bytes32 string | ||
if (isByte32String(hash)) { | ||
assert(false, "Expected transaction to be reverted"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it also can throw an error:
throw new TypeError(
`Expected a valid transaction hash, but got bytes32 '${hash}'`
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Tested with the code example provided in the issue and it works. Thanks @iosh!
Add when receipt is null, check if value is a byte32 string. minimal changes were in PRto resolve #4725
I see the following comment in the code
So i think maybe we can change the check to :
This way, we can enable other data types to pass the test, but they will be broken change.