You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.7 KiB
93 lines
2.7 KiB
2 years ago
|
// SPDX-License-Identifier: MIT
|
||
|
// This file was procedurally generated from scripts/generate/templates/CheckpointsMock.js.
|
||
|
|
||
|
pragma solidity ^0.8.0;
|
||
|
|
||
|
import "../utils/Checkpoints.sol";
|
||
|
|
||
|
contract CheckpointsMock {
|
||
|
using Checkpoints for Checkpoints.History;
|
||
|
|
||
|
Checkpoints.History private _totalCheckpoints;
|
||
|
|
||
|
function latest() public view returns (uint256) {
|
||
|
return _totalCheckpoints.latest();
|
||
|
}
|
||
|
|
||
|
function push(uint256 value) public returns (uint256, uint256) {
|
||
|
return _totalCheckpoints.push(value);
|
||
|
}
|
||
|
|
||
|
function getAtBlock(uint256 blockNumber) public view returns (uint256) {
|
||
|
return _totalCheckpoints.getAtBlock(blockNumber);
|
||
|
}
|
||
|
|
||
|
function getAtRecentBlock(uint256 blockNumber) public view returns (uint256) {
|
||
|
return _totalCheckpoints.getAtRecentBlock(blockNumber);
|
||
|
}
|
||
|
|
||
|
function length() public view returns (uint256) {
|
||
|
return _totalCheckpoints._checkpoints.length;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
contract Checkpoints224Mock {
|
||
|
using Checkpoints for Checkpoints.Trace224;
|
||
|
|
||
|
Checkpoints.Trace224 private _totalCheckpoints;
|
||
|
|
||
|
function latest() public view returns (uint224) {
|
||
|
return _totalCheckpoints.latest();
|
||
|
}
|
||
|
|
||
|
function push(uint32 key, uint224 value) public returns (uint224, uint224) {
|
||
|
return _totalCheckpoints.push(key, value);
|
||
|
}
|
||
|
|
||
|
function lowerLookup(uint32 key) public view returns (uint224) {
|
||
|
return _totalCheckpoints.lowerLookup(key);
|
||
|
}
|
||
|
|
||
|
function upperLookup(uint32 key) public view returns (uint224) {
|
||
|
return _totalCheckpoints.upperLookup(key);
|
||
|
}
|
||
|
|
||
|
function upperLookupRecent(uint32 key) public view returns (uint224) {
|
||
|
return _totalCheckpoints.upperLookupRecent(key);
|
||
|
}
|
||
|
|
||
|
function length() public view returns (uint256) {
|
||
|
return _totalCheckpoints._checkpoints.length;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
contract Checkpoints160Mock {
|
||
|
using Checkpoints for Checkpoints.Trace160;
|
||
|
|
||
|
Checkpoints.Trace160 private _totalCheckpoints;
|
||
|
|
||
|
function latest() public view returns (uint160) {
|
||
|
return _totalCheckpoints.latest();
|
||
|
}
|
||
|
|
||
|
function push(uint96 key, uint160 value) public returns (uint160, uint160) {
|
||
|
return _totalCheckpoints.push(key, value);
|
||
|
}
|
||
|
|
||
|
function lowerLookup(uint96 key) public view returns (uint160) {
|
||
|
return _totalCheckpoints.lowerLookup(key);
|
||
|
}
|
||
|
|
||
|
function upperLookup(uint96 key) public view returns (uint160) {
|
||
|
return _totalCheckpoints.upperLookup(key);
|
||
|
}
|
||
|
|
||
|
function upperLookupRecent(uint96 key) public view returns (uint224) {
|
||
|
return _totalCheckpoints.upperLookupRecent(key);
|
||
|
}
|
||
|
|
||
|
function length() public view returns (uint256) {
|
||
|
return _totalCheckpoints._checkpoints.length;
|
||
|
}
|
||
|
}
|