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

API improvements for EnumerableSet #2151

Merged
merged 7 commits into from
Mar 27, 2020

Conversation

nventuro
Copy link
Contributor

The old code did error-out on out of bounds accesses, but with an invalid opcode instead of a proper revert reason.

@nventuro nventuro requested a review from frangio March 26, 2020 22:04
@nventuro
Copy link
Contributor Author

In the interest of speed I ended up also doing some internal renaming (values -> keys) on this PR, so that it can be used to build on top of when working on #2072.

Sorry if you find this too messy. Reviewing commit by commit should be fine though.

@nventuro
Copy link
Contributor Author

This ended up being a mish-mash of unrelated improvements. After experimenting with EnumerableMap, I decided that get(index) looked weird and would be better suited as get(key) -> value, so I renamed it to at(index).

contracts/utils/EnumerableSet.sol Outdated Show resolved Hide resolved
contracts/utils/EnumerableSet.sol Outdated Show resolved Hide resolved
contracts/mocks/EnumerableSetMock.sol Show resolved Hide resolved
@nventuro nventuro changed the title Add revert reason to EnumerableSet.get. API improvements for EnumerableSet Mar 27, 2020
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

👌

@nventuro nventuro merged commit 7415ebe into OpenZeppelin:master Mar 27, 2020
@nventuro nventuro deleted the enumerable-set-get-errors branch March 27, 2020 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants