Skip to content

Commit

Permalink
Fix EnumerableSetMock for 2.5.rc1 (#2069)
Browse files Browse the repository at this point in the history
* Drafted Enumerable.sol.

* Drafted test framework.

* Tweaked the tests to follow oz structure.

* Coded EnumerableSet.

* Moved EnumerableSet to `utils`.

* Fixed linting.

* Improved comments.

* Tweaked contract description.

* Renamed struct to AddressSet.

* Relaxed version pragma to 0.5.0

* Removed events.

* Revert on useless operations.

* Small comment.

* Created AddressSet factory method.

* Failed transactions return false.

* Transactions now return false on failure.

* Remove comments from mock

* Rename mock functions

* Adapt tests to code style, use test-helpers

* Fix bug in remove, improve tests.

* Add changelog entry

* Add entry on Utils doc

* Add optimization for removal of last slot

* Update docs

* Fix headings of utilities documentation

* Simplified mock.

* Fixed comment.

* Revert "Fixed comment."

This reverts commit 39627f9.

* Revert "Simplified mock."

This reverts commit 67468e4.

* Simplified mock.

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
  • Loading branch information
alcueca and nventuro authored Jan 30, 2020
1 parent 6102ddf commit 8975289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/mocks/EnumerableSetMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ contract EnumerableSetMock{
}

function contains(address value) public view returns (bool) {
return EnumerableSet.contains(set, value);
return set.contains(value);
}

function add(address value) public {
bool result = EnumerableSet.add(set, value);
bool result = set.add(value);
emit TransactionResult(result);
}

function remove(address value) public {
bool result = EnumerableSet.remove(set, value);
bool result = set.remove(value);
emit TransactionResult(result);
}

function enumerate() public view returns (address[] memory) {
return EnumerableSet.enumerate(set);
return set.enumerate();
}
}

0 comments on commit 8975289

Please sign in to comment.