2021-11-01 11:30:35 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.0;
|
|
|
|
|
|
|
|
import "./Proofs.sol";
|
|
|
|
|
|
|
|
// exposes internal functions of Proofs for testing
|
|
|
|
contract TestProofs is Proofs {
|
2022-03-10 09:19:21 +00:00
|
|
|
constructor(
|
|
|
|
uint256 __period,
|
|
|
|
uint256 __timeout,
|
|
|
|
uint8 __downtime
|
|
|
|
)
|
|
|
|
Proofs(__period, __timeout, __downtime)
|
2022-03-02 14:44:58 +00:00
|
|
|
// solhint-disable-next-line no-empty-blocks
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function period() public view returns (uint256) {
|
|
|
|
return _period();
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2022-03-02 14:44:58 +00:00
|
|
|
function timeout() public view returns (uint256) {
|
|
|
|
return _timeout();
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-29 10:31:57 +00:00
|
|
|
function end(EndId id) public view returns (uint256) {
|
2021-11-03 12:24:50 +00:00
|
|
|
return _end(id);
|
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function missed(ProofId id) public view returns (uint256) {
|
2021-11-01 11:30:35 +00:00
|
|
|
return _missed(id);
|
|
|
|
}
|
|
|
|
|
2022-03-08 14:58:08 +00:00
|
|
|
function expectProofs(
|
2022-09-29 10:18:02 +00:00
|
|
|
ProofId id,
|
|
|
|
EndId endId,
|
2022-09-29 10:07:55 +00:00
|
|
|
uint256 _probability
|
2022-03-08 14:58:08 +00:00
|
|
|
) public {
|
2022-09-29 10:07:55 +00:00
|
|
|
_expectProofs(id, endId, _probability);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function unexpectProofs(ProofId id) public {
|
2022-09-13 07:18:55 +00:00
|
|
|
_unexpectProofs(id);
|
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function isProofRequired(ProofId id) public view returns (bool) {
|
2022-03-08 14:58:08 +00:00
|
|
|
return _isProofRequired(id);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function willProofBeRequired(ProofId id) public view returns (bool) {
|
2022-04-05 09:27:02 +00:00
|
|
|
return _willProofBeRequired(id);
|
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function getChallenge(ProofId id) public view returns (bytes32) {
|
2022-03-10 12:04:46 +00:00
|
|
|
return _getChallenge(id);
|
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function getPointer(ProofId id) public view returns (uint8) {
|
2022-03-10 12:35:41 +00:00
|
|
|
return _getPointer(id);
|
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function submitProof(ProofId id, bytes calldata proof) public {
|
2022-03-08 14:58:08 +00:00
|
|
|
_submitProof(id, proof);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-29 10:18:02 +00:00
|
|
|
function markProofAsMissing(ProofId id, uint256 _period) public {
|
2022-03-08 14:58:08 +00:00
|
|
|
_markProofAsMissing(id, _period);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
2022-09-29 10:07:55 +00:00
|
|
|
|
2022-09-29 10:31:57 +00:00
|
|
|
function setProofEnd(EndId id, uint256 ending) public {
|
2022-09-29 10:07:55 +00:00
|
|
|
_setProofEnd(id, ending);
|
|
|
|
}
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|