From 945c501ce628d73552764d0324bf385d47166294 Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Mon, 13 Feb 2023 17:29:27 +1100 Subject: [PATCH] change getRequestFromSlotId to getActiveSlot --- contracts/Marketplace.sol | 2 +- test/Marketplace.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/Marketplace.sol b/contracts/Marketplace.sol index 41d4acb..a84e923 100644 --- a/contracts/Marketplace.sol +++ b/contracts/Marketplace.sol @@ -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) diff --git a/test/Marketplace.test.js b/test/Marketplace.test.js index 8a529a2..a7f28e1 100644 --- a/test/Marketplace.test.js +++ b/test/Marketplace.test.js @@ -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 () {