marketplace: no longer expose forciblyFreeSlot in tests

reason: freeSlot() will call forciblyFreeSlot when contract is not
finished, so we can use that instead
This commit is contained in:
Mark Spanbroek 2025-05-27 10:52:21 +02:00
parent 47f3c1e36d
commit 2cd45214cf
3 changed files with 3 additions and 7 deletions

View File

@ -14,10 +14,6 @@ contract TestMarketplace is Marketplace {
IGroth16Verifier verifier
) Marketplace(config, vault, verifier) {}
function forciblyFreeSlot(SlotId slotId) public {
_forciblyFreeSlot(slotId);
}
function getSlotBalance(SlotId slotId) public view returns (uint256) {
Slot storage slot = _slots[slotId];
FundId fund = slot.requestId.asFundId();

View File

@ -954,7 +954,7 @@ describe("Marketplace", function () {
for (let i = 0; i <= request.ask.maxSlotLoss; i++) {
slot.index = i
let id = slotId(slot)
await marketplace.forciblyFreeSlot(id)
await marketplace.freeSlot(id)
}
expect(await marketplace.requestState(slot.request)).to.equal(New)
})

View File

@ -50,7 +50,7 @@ async function waitUntilFailed(contract, request) {
for (let i = 0; i <= request.ask.maxSlotLoss; i++) {
slot.index = i
let id = slotId(slot)
await contract.forciblyFreeSlot(id)
await contract.freeSlot(id)
}
}
@ -59,7 +59,7 @@ async function waitUntilSlotFailed(contract, request, slot) {
let freed = 0
while (freed <= request.ask.maxSlotLoss) {
if (index !== slot.index) {
await contract.forciblyFreeSlot(slotId({ ...slot, index }))
await contract.freeSlot(slotId({ ...slot, index }))
freed++
}
index++