change getRequestFromSlotId to getActiveSlot

This commit is contained in:
Eric Mastro 2023-02-13 17:29:27 +11:00
parent 9751b0de5e
commit 945c501ce6
No known key found for this signature in database
GPG Key ID: 141E3048D95A4E63
2 changed files with 5 additions and 5 deletions

View File

@ -219,7 +219,7 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
return _slots[slotId].host;
}
function getRequestFromSlotId(SlotId slotId)
function getActiveSlot(SlotId slotId)
public
view
slotIsNotFree(slotId)

View File

@ -141,16 +141,16 @@ describe("Marketplace", function () {
})
it("fails to retrieve a request of an empty slot", async function () {
expect(marketplace.getRequestFromSlotId(slotId(slot))).to.be.revertedWith(
expect(marketplace.getActiveSlot(slotId(slot))).to.be.revertedWith(
"Slot is free"
)
})
it("allows retrieval of request of a filled slot", async function () {
await marketplace.fillSlot(slot.request, slot.index, proof)
expect(
await marketplace.getRequestFromSlotId(slotId(slot))
).to.be.request((request, slot.index))
expect(await marketplace.getActiveSlot(slotId(slot))).to.be.request(
(request, slot.index)
)
})
it("is rejected when proof is incorrect", async function () {