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 {
|
2023-01-16 15:31:04 +00:00
|
|
|
mapping(SlotId => SlotState) private states;
|
2023-01-10 11:11:20 +00:00
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-01-16 15:31:04 +00:00
|
|
|
function slotState(SlotId slotId) internal view override returns (SlotState) {
|
|
|
|
return states[slotId];
|
2023-01-10 11:11:20 +00:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:51:26 +00:00
|
|
|
function startRequiringProofs(SlotId slot, uint256 _probability) public {
|
|
|
|
_startRequiringProofs(slot, _probability);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2023-01-09 13:20:59 +00:00
|
|
|
function isProofRequired(SlotId id) public view returns (bool) {
|
2022-03-08 14:58:08 +00:00
|
|
|
return _isProofRequired(id);
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|
|
|
|
|
2023-01-09 13:20:59 +00:00
|
|
|
function willProofBeRequired(SlotId id) public view returns (bool) {
|
2022-04-05 09:27:02 +00:00
|
|
|
return _willProofBeRequired(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 13:20:59 +00:00
|
|
|
function getChallenge(SlotId id) public view returns (bytes32) {
|
2022-03-10 12:04:46 +00:00
|
|
|
return _getChallenge(id);
|
|
|
|
}
|
|
|
|
|
2023-01-09 13:20:59 +00:00
|
|
|
function getPointer(SlotId id) public view returns (uint8) {
|
2022-03-10 12:35:41 +00:00
|
|
|
return _getPointer(id);
|
|
|
|
}
|
|
|
|
|
2023-01-10 13:16:32 +00:00
|
|
|
function markProofAsMissing(SlotId id, Period _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
|
|
|
|
2023-01-16 15:31:04 +00:00
|
|
|
function setSlotState(SlotId id, SlotState state) public {
|
|
|
|
states[id] = state;
|
2022-09-29 10:07:55 +00:00
|
|
|
}
|
2021-11-01 11:30:35 +00:00
|
|
|
}
|