Skip to content
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

Change behavior of ceilDiv(0, 0) and improve test coverage #4348

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

ernestognw
Copy link
Member

Description

Addresses last pending comment in #4261 about testing coverage.

I fixed some uncovered branches but is difficult to check for exhaustivity, and also some new added branches are difficult to reach specially because they're errors.

@changeset-bot
Copy link

changeset-bot bot commented Jun 14, 2023

🦋 Changeset detected

Latest commit: 1c02d6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

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

Amxx
Amxx previously approved these changes Jun 14, 2023
Copy link
Collaborator

@Amxx Amxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small comment

contracts/utils/math/Math.sol Show resolved Hide resolved
@ernestognw ernestognw requested review from Amxx and frangio June 14, 2023 19:36
@frangio frangio changed the title Improve tests after custom errors Change behavior of ceilDiv(0, 0) and improve test coverage Jun 14, 2023
@frangio frangio merged commit 2477534 into OpenZeppelin:master Jun 14, 2023
'openzeppelin-solidity': minor
---

`Math`: Make `ceilDiv` to revert on 0 division even if the numerator is 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its actually a panic. But this is already merge so whatever.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changeset is correct, it reverts with a Panic error.

@pcaversaccio
Copy link
Contributor

FYI, I got a question here 2477534#r118328369.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants