Update docs

This commit is contained in:
github-actions
2022-06-29 09:01:40 +00:00
parent 0627757030
commit 1722dabc84
141 changed files with 14658 additions and 6699 deletions

View File

@ -131,3 +131,89 @@ contract Bytes32ToBytes32MapMock {
return _map.get(key, errorMessage);
}
}
// UintToUintMap
contract UintToUintMapMock {
using EnumerableMap for EnumerableMap.UintToUintMap;
event OperationResult(bool result);
EnumerableMap.UintToUintMap private _map;
function contains(uint256 key) public view returns (bool) {
return _map.contains(key);
}
function set(uint256 key, uint256 value) public {
bool result = _map.set(key, value);
emit OperationResult(result);
}
function remove(uint256 key) public {
bool result = _map.remove(key);
emit OperationResult(result);
}
function length() public view returns (uint256) {
return _map.length();
}
function at(uint256 index) public view returns (uint256 key, uint256 value) {
return _map.at(index);
}
function tryGet(uint256 key) public view returns (bool, uint256) {
return _map.tryGet(key);
}
function get(uint256 key) public view returns (uint256) {
return _map.get(key);
}
function getWithMessage(uint256 key, string calldata errorMessage) public view returns (uint256) {
return _map.get(key, errorMessage);
}
}
// Bytes32ToUintMap
contract Bytes32ToUintMapMock {
using EnumerableMap for EnumerableMap.Bytes32ToUintMap;
event OperationResult(bool result);
EnumerableMap.Bytes32ToUintMap private _map;
function contains(bytes32 key) public view returns (bool) {
return _map.contains(key);
}
function set(bytes32 key, uint256 value) public {
bool result = _map.set(key, value);
emit OperationResult(result);
}
function remove(bytes32 key) public {
bool result = _map.remove(key);
emit OperationResult(result);
}
function length() public view returns (uint256) {
return _map.length();
}
function at(uint256 index) public view returns (bytes32 key, uint256 value) {
return _map.at(index);
}
function tryGet(bytes32 key) public view returns (bool, uint256) {
return _map.tryGet(key);
}
function get(bytes32 key) public view returns (uint256) {
return _map.get(key);
}
function getWithMessage(bytes32 key, string calldata errorMessage) public view returns (uint256) {
return _map.get(key, errorMessage);
}
}