Skip to content

Remove Math.min64 and Math.max64#1156

Merged
nventuro merged 3 commits into
OpenZeppelin:masterfrom
frangio:remove-64bit-min-max
Aug 6, 2018
Merged

Remove Math.min64 and Math.max64#1156
nventuro merged 3 commits into
OpenZeppelin:masterfrom
frangio:remove-64bit-min-max

Conversation

@frangio

@frangio frangio commented Aug 5, 2018

Copy link
Copy Markdown
Contributor

These two functions were added at a point where we used uint64 values in a contract, but we have since made everything uint256 and this is what we recommend so we should remove the 64-bit variants.

@frangio frangio added kind:improvement contracts Smart contract code. breaking change Changes that break backwards compatibility of the public API. labels Aug 5, 2018
@frangio frangio requested a review from nventuro August 5, 2018 23:55

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Woohoo deprecation!

This is not strictly related to this PR, but the min and max tests are not what you'd call comprehensive (there's only one test for each ffs), shouldn't we address this?

Comment thread contracts/mocks/MathMock.sol Outdated
contract MathMock {
uint64 public result64;
uint256 public result256;
uint256 public result;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a need for this? I'd remove it altogether and have the functions return the result (like SafeMathMock does).

@frangio

frangio commented Aug 6, 2018

Copy link
Copy Markdown
Contributor Author

@nventuro Please review again. 🙂

@nventuro nventuro merged commit bf34911 into OpenZeppelin:master Aug 6, 2018
@frangio frangio deleted the remove-64bit-min-max branch August 6, 2018 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants