mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-28 15:25:46 +00:00
ad040cfee6
Allow proof ending to be extending once a contract is started, so that all filled slots share an ending time that is equal to the contract end time. Added tests. Add a mapping for proof id to endId so that proof expectations can be extended for all proofs that share a given endId. Add function modifiers that require the request state to allow proofs, with accompanying tests. General clean up of each function’s request state context, with accompanying tests. General clean up of all tests, including state change “wait” functions and normalising the time advancement functions.
76 lines
1.6 KiB
Solidity
76 lines
1.6 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
import "./Proofs.sol";
|
|
|
|
// exposes internal functions of Proofs for testing
|
|
contract TestProofs is Proofs {
|
|
constructor(
|
|
uint256 __period,
|
|
uint256 __timeout,
|
|
uint8 __downtime
|
|
)
|
|
Proofs(__period, __timeout, __downtime)
|
|
// solhint-disable-next-line no-empty-blocks
|
|
{
|
|
|
|
}
|
|
|
|
function period() public view returns (uint256) {
|
|
return _period();
|
|
}
|
|
|
|
function timeout() public view returns (uint256) {
|
|
return _timeout();
|
|
}
|
|
|
|
function end(bytes32 id) public view returns (uint256) {
|
|
return _end(id);
|
|
}
|
|
|
|
function missed(bytes32 id) public view returns (uint256) {
|
|
return _missed(id);
|
|
}
|
|
|
|
function expectProofs(
|
|
bytes32 id,
|
|
bytes32 endId,
|
|
uint256 _probability,
|
|
uint256 _duration
|
|
) public {
|
|
_expectProofs(id, endId, _probability, _duration);
|
|
}
|
|
|
|
function unexpectProofs(bytes32 id) public {
|
|
_unexpectProofs(id);
|
|
}
|
|
|
|
function isProofRequired(bytes32 id) public view returns (bool) {
|
|
return _isProofRequired(id);
|
|
}
|
|
|
|
function willProofBeRequired(bytes32 id) public view returns (bool) {
|
|
return _willProofBeRequired(id);
|
|
}
|
|
|
|
function getChallenge(bytes32 id) public view returns (bytes32) {
|
|
return _getChallenge(id);
|
|
}
|
|
|
|
function getPointer(bytes32 id) public view returns (uint8) {
|
|
return _getPointer(id);
|
|
}
|
|
|
|
function submitProof(bytes32 id, bytes calldata proof) public {
|
|
_submitProof(id, proof);
|
|
}
|
|
|
|
function markProofAsMissing(bytes32 id, uint256 _period) public {
|
|
_markProofAsMissing(id, _period);
|
|
}
|
|
|
|
function extendProofEndTo(bytes32 id, uint256 ending) public {
|
|
_extendProofEndTo(id, ending);
|
|
}
|
|
}
|