[marketplace] inline the requestAcceptsProofs() function
It was only used in one place
This commit is contained in:
parent
1316682a6f
commit
e828529e90
|
@ -261,7 +261,8 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
|
||||||
|
|
||||||
function requestEnd(RequestId requestId) public view returns (uint256) {
|
function requestEnd(RequestId requestId) public view returns (uint256) {
|
||||||
uint256 end = _context(requestId).endsAt;
|
uint256 end = _context(requestId).endsAt;
|
||||||
if (_requestAcceptsProofs(requestId)) {
|
RequestState state = requestState(requestId);
|
||||||
|
if (state == RequestState.New || state == RequestState.Started) {
|
||||||
return end;
|
return end;
|
||||||
} else {
|
} else {
|
||||||
return Math.min(end, block.timestamp - 1);
|
return Math.min(end, block.timestamp - 1);
|
||||||
|
@ -351,16 +352,6 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice returns true when the request is accepting proof submissions from hosts occupying slots.
|
|
||||||
/// @dev Request state must be new or started, and must not be cancelled, finished, or failed.
|
|
||||||
/// @param requestId id of the request for which to obtain state info
|
|
||||||
function _requestAcceptsProofs(
|
|
||||||
RequestId requestId
|
|
||||||
) internal view returns (bool) {
|
|
||||||
RequestState state = requestState(requestId);
|
|
||||||
return state == RequestState.New || state == RequestState.Started;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct RequestContext {
|
struct RequestContext {
|
||||||
RequestState state;
|
RequestState state;
|
||||||
uint256 slotsFilled;
|
uint256 slotsFilled;
|
||||||
|
|
Loading…
Reference in New Issue