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

Migrate math tests to ethers.js v6 #4769

Merged
merged 9 commits into from
Dec 4, 2023

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Nov 29, 2023

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Amxx Amxx added tests Test suite and helpers. ignore-changeset labels Nov 29, 2023
@Amxx Amxx added this to the tests migration milestone Nov 29, 2023
@Amxx Amxx requested a review from ernestognw November 29, 2023 14:41
Copy link

changeset-bot bot commented Nov 29, 2023

⚠️ No Changeset found

Latest commit: 1f7e47f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Amxx Amxx mentioned this pull request Nov 29, 2023
Comment on lines 5 to 7
const max = (...values) => values.slice(1).reduce((x, y) => (x > y ? x : y), values.at(0));
const min = (...values) => values.slice(1).reduce((x, y) => (x < y ? x : y), values.at(0));
const sum = (...values) => values.slice(1).reduce((x, y) => x + y, values.at(0));
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about keeping this in math.js and reexporting them here in ./iterate?

Alternative I'd propose getting rid of math.js, I just feel this is redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could also put them in math.js, and remove them completelly (not reexport) from iterate.js.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's put them in math.js makes sense to me. Also, just found out that this sum implementation returns undefined for an empty array. Not sure if we want that

Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

LGTM. I consider the comments for both moving the iterate functions to math and putting testCommutative in a single place are non-blocking 👍🏻

ernestognw
ernestognw previously approved these changes Dec 1, 2023
@Amxx Amxx requested a review from ernestognw December 4, 2023 16:41
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 💪🏻

@ernestognw ernestognw merged commit cffb2f1 into OpenZeppelin:master Dec 4, 2023
@Amxx Amxx deleted the test/migrations/math branch December 4, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-changeset tests Test suite and helpers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants