API improvements for EnumerableSet (#2151)

* Add revert reason to EnumerableSet.get.

* Rename EnumerableSet values to keys

* Rename get to at

* Add changelog entry

* Rename keys to values

* Add leading underscore to struct members
This commit is contained in:
Nicolás Venturo
2020-03-27 18:39:18 -03:00
committed by GitHub
parent 24c37c1f9e
commit 7415ebe8bc
5 changed files with 42 additions and 31 deletions

View File

@ -2,7 +2,7 @@ pragma solidity ^0.6.0;
import "../utils/EnumerableSet.sol";
contract EnumerableSetMock{
contract EnumerableSetMock {
using EnumerableSet for EnumerableSet.AddressSet;
event TransactionResult(bool result);
@ -31,7 +31,7 @@ contract EnumerableSetMock{
return _set.length();
}
function get(uint256 index) public view returns (address) {
return _set.get(index);
function at(uint256 index) public view returns (address) {
return _set.at(index);
}
}