forked from Synthetixio/synthetix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestableAddressSet.sol
37 lines (27 loc) · 913 Bytes
/
TestableAddressSet.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pragma solidity ^0.5.16;
import "../AddressSetLib.sol";
contract TestableAddressSet {
using AddressSetLib for AddressSetLib.AddressSet;
AddressSetLib.AddressSet internal set;
function contains(address candidate) public view returns (bool) {
return set.contains(candidate);
}
function getPage(uint index, uint pageSize) public view returns (address[] memory) {
return set.getPage(index, pageSize);
}
function add(address element) public {
set.add(element);
}
function remove(address element) public {
set.remove(element);
}
function size() public view returns (uint) {
return set.elements.length;
}
function element(uint index) public view returns (address) {
return set.elements[index];
}
function index(address element) public view returns (uint) {
return set.indices[element];
}
}