codex-contracts-eth/contracts/TestMarketplace.sol
Eric Mastro 716b864f02 [marketplace] update state getter
Update `Marketplace.state` getter to to take `isCancelled` into account. This state can then be used internally and externally.

Add checks to `proofEnd`, `isProofRequired`, `willProofBeRequired`, and `getChallenge` that understands if the request is in a state to accept proofs. If not, return other values.

Add `slotMustAcceptProofs` modifier, originally introduced in a later PR, which requires the request to be in state of the request accepting proofs.

Add tests for all the above.
2022-09-20 15:59:03 +10:00

28 lines
689 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Marketplace.sol";
// exposes internal functions of Marketplace for testing
contract TestMarketplace is Marketplace {
constructor(
IERC20 _token,
uint256 _collateral,
uint256 _proofPeriod,
uint256 _proofTimeout,
uint8 _proofDowntime
)
Marketplace(_token, _collateral, _proofPeriod,_proofTimeout,_proofDowntime)
// solhint-disable-next-line no-empty-blocks
{
}
function isCancelled(bytes32 requestId) public view returns (bool) {
return _isCancelled(requestId);
}
function isSlotCancelled(bytes32 slotId) public view returns (bool) {
return _isSlotCancelled(slotId);
}
}