From 44109410613204f68e1645fcf4f374b3a886cff8 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 11 Jun 2025 17:00:52 +0200 Subject: [PATCH] marketplace: add test for hosts that makes request fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Adam Uhlíř --- test/Marketplace.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/Marketplace.test.js b/test/Marketplace.test.js index 8a9ca49..dac82ed 100644 --- a/test/Marketplace.test.js +++ b/test/Marketplace.test.js @@ -711,6 +711,18 @@ describe("Marketplace", function () { ) }) + it("does not pay host that made the request fail", async function () { + await waitUntilStarted(marketplace, request, proof, token) + for (let i = 0; i <= request.ask.maxSlotLoss; i++) { + slot.index = i + await marketplace.freeSlot(slotId(slot)) + } + await waitUntilFinished(marketplace, requestId(request)) + await expect(marketplace.freeSlot(slotId(slot))).to.be.revertedWith( + "Marketplace_InvalidSlotHost" + ) + }) + it("pays only once", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFinished(marketplace, requestId(request))