Files
openzeppelin-contracts/contracts/mocks/CheckpointsImpl.sol
Hadrien Croubois 35090c1bf1 Add tests for improved coverage (#3448)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-06-02 23:01:55 +00:00

28 lines
705 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Checkpoints.sol";
contract CheckpointsImpl {
using Checkpoints for Checkpoints.History;
Checkpoints.History private _totalCheckpoints;
function latest() public view returns (uint256) {
return _totalCheckpoints.latest();
}
function getAtBlock(uint256 blockNumber) public view returns (uint256) {
return _totalCheckpoints.getAtBlock(blockNumber);
}
function push(uint256 value) public returns (uint256, uint256) {
return _totalCheckpoints.push(value);
}
function length() public view returns (uint256) {
return _totalCheckpoints._checkpoints.length;
}
}