laconicd-deprecated/tests-solidity/suites/staking/contracts/test/mocks/CheckpointingMock.sol
Brett Sun c9639c3860
tests: add solidity test suites (#487)
* tests: add solidity test suite

* tests: remove require strings

* Update tests-solidity/init-test-node.sh

* Update tests-solidity/init-test-node.sh

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-09-01 17:16:28 -04:00

31 lines
687 B
Solidity

pragma solidity 0.5.17;
import "../../lib/Checkpointing.sol";
contract CheckpointingMock {
using Checkpointing for Checkpointing.History;
Checkpointing.History history;
function add(uint64 value, uint256 time) public {
history.add(value, time);
}
function getLast() public view returns (uint256) {
return history.getLast();
}
function get(uint64 time) public view returns (uint256) {
return history.get(time);
}
function getHistorySize() public view returns (uint256) {
return history.history.length;
}
function lastUpdate() public view returns (uint256) {
return history.lastUpdate();
}
}