Verify that the provider is hosting the request by checking the slots from the smart contracts instead of looking into the reservations

This commit is contained in:
Arnaud 2025-07-02 19:05:33 +02:00
parent 69b0bf3b8a
commit ff0de4d3e0
No known key found for this signature in database
GPG Key ID: B8FBC178F10CA7AE

View File

@ -65,14 +65,24 @@ marketplacesuite(name = "Marketplace"):
let purchase = (await client.getPurchase(id)).get
check purchase.error == none string
let state = await marketplace.requestState(purchase.requestId)
check state == RequestState.Started
let availabilities = (await host.getAvailabilities()).get
check availabilities.len == 1
let newSize = availabilities[0].freeSize
check newSize > 0 and newSize < size
let reservations = (await host.getAvailabilityReservations(availability.id)).get
check reservations.len == 3
check reservations[0].requestId == purchase.requestId
let signer = ethProvider.getSigner(hostAccount)
let marketplaceWithProviderSigner = marketplace.connect(signer)
let slots = await marketplaceWithProviderSigner.mySlots()
check slots.len == 3
for slotId in slots:
let slot = await marketplaceWithProviderSigner.getActiveSlot(slotId)
check slot.request.id == purchase.requestId
test "node slots gets paid out and rest of tokens are returned to client",
marketplaceConfig: