2021-11-01 12:30:35 +01:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.0;
|
|
|
|
|
|
|
|
import "./Proofs.sol";
|
|
|
|
|
|
|
|
// exposes internal functions of Proofs for testing
|
|
|
|
contract TestProofs is Proofs {
|
2023-01-10 12:11:20 +01:00
|
|
|
mapping(SlotId => uint256) private ends;
|
|
|
|
|
2022-03-10 10:19:21 +01:00
|
|
|
constructor(
|
|
|
|
uint256 __period,
|
|
|
|
uint256 __timeout,
|
|
|
|
uint8 __downtime
|
|
|
|
)
|
|
|
|
Proofs(__period, __timeout, __downtime)
|
2022-03-02 15:44:58 +01:00
|
|
|
// solhint-disable-next-line no-empty-blocks
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-01-10 12:11:20 +01:00
|
|
|
function proofEnd(SlotId slotId) public view override returns (uint256) {
|
|
|
|
return ends[slotId];
|
|
|
|
}
|
|
|
|
|
2022-03-02 15:44:58 +01:00
|
|
|
function period() public view returns (uint256) {
|
|
|
|
return _period();
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|
|
|
|
|
2022-03-02 15:44:58 +01:00
|
|
|
function timeout() public view returns (uint256) {
|
|
|
|
return _timeout();
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|
|
|
|
|
2023-01-10 12:11:20 +01:00
|
|
|
function expectProofs(SlotId slot, uint256 _probability) public {
|
|
|
|
_expectProofs(slot, _probability);
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function unexpectProofs(SlotId id) public {
|
2022-09-13 17:18:55 +10:00
|
|
|
_unexpectProofs(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function isProofRequired(SlotId id) public view returns (bool) {
|
2022-03-08 15:58:08 +01:00
|
|
|
return _isProofRequired(id);
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function willProofBeRequired(SlotId id) public view returns (bool) {
|
2022-04-05 11:27:02 +02:00
|
|
|
return _willProofBeRequired(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function getChallenge(SlotId id) public view returns (bytes32) {
|
2022-03-10 13:04:46 +01:00
|
|
|
return _getChallenge(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function getPointer(SlotId id) public view returns (uint8) {
|
2022-03-10 13:35:41 +01:00
|
|
|
return _getPointer(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 14:20:59 +01:00
|
|
|
function markProofAsMissing(SlotId id, uint256 _period) public {
|
2022-03-08 15:58:08 +01:00
|
|
|
_markProofAsMissing(id, _period);
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|
2022-09-29 20:07:55 +10:00
|
|
|
|
2023-01-10 12:11:20 +01:00
|
|
|
function setProofEnd(SlotId id, uint256 end) public {
|
|
|
|
ends[id] = end;
|
2022-09-29 20:07:55 +10:00
|
|
|
}
|
2021-11-01 12:30:35 +01:00
|
|
|
}
|