-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Update chai matchers #4899
Update chai matchers #4899
Conversation
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@nomicfoundation/hardhat-chai-matchers@2.0.3 |
@@ -15,7 +15,7 @@ describe('Panic', function () { | |||
for (const [name, code] of Object.entries({ | |||
GENERIC: 0x0, | |||
ASSERT: PANIC_CODES.ASSERTION_ERROR, | |||
UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_UNDER_OR_OVERFLOW, | |||
UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_OVERFLOW, |
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.
We might want to update UNDER_OVERFLOW
in Panic.sol
as well.
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.
Needs approval from @Amxx
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.
Just realized we need to remove the changeset. Sorry 😅
mstore(0x00, shl(0xe0, 0x4e487b71)) | ||
mstore(0x04, code) | ||
revert(0x00, 0x24) | ||
mstore(0x00, 0x4e487b71) | ||
mstore(0x20, code) | ||
revert(0x1c, 0x24) |
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.
Cool
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.
LGTM, thanks @RenanSouza2
Let's wait on @Amxx
💯 |
contracts/utils/Panic.sol
Outdated
/// @dev arithmetic underflow or overflow | ||
uint256 internal constant UNDER_OVERFLOW = 0x11; | ||
/// @dev arithmetic overflow | ||
uint256 internal constant OVERFLOW = 0x11; |
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 agree that overflow is a better name, and hardhat was right to change it, but this file is supposed to follow https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h
This PR jumps to 2.0.6, not 2.0.5.
I'm not seeing any simplification of the vesting wallet tests in this PR. Can you showcase how what the improvements are? |
yes, they released 2.0.6 in the meanwile, I should have updated the comment here
I didn't want to put the simplifications in this PR to no overblow it but I made the changes here: it removes the parts I was least sure about when migrating the finance tests |
If I'm getting it correctly, the update improves support for The changes don't look too big. I'm fine either merging this PR and then making the test simplification or including it in this same PR. Consider I'll need to re-review if it's the later. |
Considering the assembly change in this PR I suggest using 2 PRs |
Right, almost forgot! Then I'd be in favor of merging this. Still requires approval from @Amxx |
Hey this PR updates the hardhat-chai-matchers library form version 2.0.3 to 2.0,5,
Rationale: version 2.0.5 also includes the ethers.Typed in the address verification, needed to simplify vesting wallet tests
version 2.0.4 changed the name of an internal variable from
ARITHMETIC_UNDER_OR_OVERFLOW
toARITHMETIC_OVERFLOW
PR Checklist
npx changeset add
)