From e828529e90c9427894a672dde809300d2a1a225a Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 16 Jan 2023 17:39:27 +0100 Subject: [PATCH] [marketplace] inline the requestAcceptsProofs() function It was only used in one place --- contracts/Marketplace.sol | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/contracts/Marketplace.sol b/contracts/Marketplace.sol index bb658fd..ea67038 100644 --- a/contracts/Marketplace.sol +++ b/contracts/Marketplace.sol @@ -261,7 +261,8 @@ contract Marketplace is Collateral, Proofs, StateRetrieval { function requestEnd(RequestId requestId) public view returns (uint256) { uint256 end = _context(requestId).endsAt; - if (_requestAcceptsProofs(requestId)) { + RequestState state = requestState(requestId); + if (state == RequestState.New || state == RequestState.Started) { return end; } else { 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 { RequestState state; uint256 slotsFilled;