[marketplace] remove unused _isSlotCancelled()
This commit is contained in:
parent
fffd0dcb86
commit
9aa4773392
|
@ -261,15 +261,6 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
|
|||
return slot.requestId;
|
||||
}
|
||||
|
||||
/// @notice Return true if the request state the slot belongs to is RequestState.Cancelled or if the request expiry time has elapsed and the request was never started.
|
||||
/// @dev Handles the case when a request may have been cancelled, but the client has not withdrawn its funds yet, and therefore the state has not yet been updated.
|
||||
/// @param slotId the id of the slot
|
||||
/// @return true if request is cancelled
|
||||
function _isSlotCancelled(SlotId slotId) internal view returns (bool) {
|
||||
RequestId requestId = _getRequestIdForSlot(slotId);
|
||||
return _isCancelled(requestId);
|
||||
}
|
||||
|
||||
function getHost(SlotId slotId) public view returns (address) {
|
||||
return slots[slotId].host;
|
||||
}
|
||||
|
|
|
@ -34,10 +34,6 @@ contract TestMarketplace is Marketplace {
|
|||
return _isCancelled(requestId);
|
||||
}
|
||||
|
||||
function isSlotCancelled(SlotId slotId) public view returns (bool) {
|
||||
return _isSlotCancelled(slotId);
|
||||
}
|
||||
|
||||
function forciblyFreeSlot(SlotId slotId) public {
|
||||
_forciblyFreeSlot(slotId);
|
||||
}
|
||||
|
|
|
@ -659,19 +659,6 @@ describe("Marketplace", function () {
|
|||
await expect(await marketplace.isCancelled(slot.request)).to.be.true
|
||||
})
|
||||
|
||||
it("rejects isSlotCancelled when slot is empty", async function () {
|
||||
await expect(
|
||||
marketplace.isSlotCancelled(slotId(slot))
|
||||
).to.be.revertedWith("Slot empty")
|
||||
})
|
||||
|
||||
it("changes isSlotCancelled to true once request is cancelled", async function () {
|
||||
await marketplace.fillSlot(slot.request, slot.index, proof)
|
||||
await expect(await marketplace.isSlotCancelled(slotId(slot))).to.be.false
|
||||
await waitUntilCancelled(request)
|
||||
await expect(await marketplace.isSlotCancelled(slotId(slot))).to.be.true
|
||||
})
|
||||
|
||||
it("changes proofEnd to the past when request is cancelled", async function () {
|
||||
await marketplace.fillSlot(slot.request, slot.index, proof)
|
||||
await expect(await marketplace.proofEnd(slotId(slot))).to.be.gt(
|
||||
|
|
Loading…
Reference in New Issue