Eric Mastro fd74268a8a Remove proof extension, test clean up
1. Remove proof extension as it is not needed. Host are required to provide proofs from the moment they fill a slot, for the duration specified by the contract. This means that the ending of their requirements will be staggered at the end, as they were at the start, but this is more predicable for determining the cost of a request.
2. The proof end time was modified so that if the request state is not accepting proofs, it takes the min of the slot proof end time, the request end time, or block.timestamp - 1, which ensures that it returns a time in the past. If the slot is accepting proofs, it returns the slot end time.
3. Modify marketplace tests so that `waitUntilFinished` advances time to the proof ending of the last slot filled.
2022-10-25 12:38:19 +11:00

71 lines
1.5 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,
uint256 _probability,
uint256 _duration
) public {
_expectProofs(id, _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);
}
}