mirror of
https://github.com/codex-storage/codex-contracts-eth.git
synced 2025-02-19 22:58:25 +00:00
change getRequestFromSlotId to getActiveSlot
This commit is contained in:
parent
9751b0de5e
commit
945c501ce6
@ -219,7 +219,7 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
|
|||||||
return _slots[slotId].host;
|
return _slots[slotId].host;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRequestFromSlotId(SlotId slotId)
|
function getActiveSlot(SlotId slotId)
|
||||||
public
|
public
|
||||||
view
|
view
|
||||||
slotIsNotFree(slotId)
|
slotIsNotFree(slotId)
|
||||||
|
@ -141,16 +141,16 @@ describe("Marketplace", function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("fails to retrieve a request of an empty slot", async 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"
|
"Slot is free"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("allows retrieval of request of a filled slot", async function () {
|
it("allows retrieval of request of a filled slot", async function () {
|
||||||
await marketplace.fillSlot(slot.request, slot.index, proof)
|
await marketplace.fillSlot(slot.request, slot.index, proof)
|
||||||
expect(
|
expect(await marketplace.getActiveSlot(slotId(slot))).to.be.request(
|
||||||
await marketplace.getRequestFromSlotId(slotId(slot))
|
(request, slot.index)
|
||||||
).to.be.request((request, slot.index))
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("is rejected when proof is incorrect", async function () {
|
it("is rejected when proof is incorrect", async function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user