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

Add AddressToUintMap #3150

Merged
merged 6 commits into from Feb 1, 2022
Merged

Conversation

gaspardip
Copy link
Contributor

Continuing the work of #3073, this PR adds the new AddressToUintMap map type, which is very useful for storing balances.

I've added tests and a changelog entry.

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

@frangio frangio mentioned this pull request Jan 31, 2022
3 tasks
@frangio frangio changed the title feat(EnumerableMap): add AddressToUintMap Add AddressToUintMap Jan 31, 2022
contracts/utils/structs/EnumerableMap.sol Outdated Show resolved Hide resolved
contracts/utils/structs/EnumerableMap.sol Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
contracts/utils/structs/EnumerableMap.sol Outdated Show resolved Hide resolved
test/utils/structs/EnumerableMap/helpers.js Outdated Show resolved Hide resolved
gaspardip and others added 3 commits January 31, 2022 23:07
"overrides": [
{
"files": "*.sol",
"options": {
"singleQuote": false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need these changes to .prettierrc ? Can you explain what they do exactly ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The lint config doesn't match the prettier config for what I've noticed using the vscode prettier extension (although running the package.json lint scripts would give the same result)

@Amxx
Copy link
Collaborator

Amxx commented Feb 1, 2022

For the EnumerableSet, we have a single mock file (mocks/EnumerableSetMock.sol) that contains multiple contracts.
I think we should do the same for EnumerableMap

@Amxx Amxx merged commit ca755ce into OpenZeppelin:master Feb 1, 2022
@gaspardip gaspardip deleted the feature/AddressToUintMap branch February 1, 2022 19:11
brandonlehmann added a commit to brandonlehmann/openzeppelin-contracts that referenced this pull request Feb 13, 2022
* add AddressToUintMap

* Update contracts/utils/structs/EnumerableMap.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* address comments

* lint code

* merge mocks into a single file

* add PR link to changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
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.

None yet

3 participants