add slot index to SlotFreed event

This commit is contained in:
Eric Mastro 2023-06-16 13:58:35 +10:00
parent dde661649a
commit 8d254f8385
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View File

@ -162,7 +162,7 @@ contract Marketplace is Proofs, StateRetrieval {
delete _slots[slotId];
context.slotsFilled -= 1;
emit SlotFreed(requestId, slotId);
emit SlotFreed(requestId, slot.slotIndex, slotId);
resetMissingProofs(slotId);
Request storage request = _requests[requestId];
@ -319,7 +319,11 @@ contract Marketplace is Proofs, StateRetrieval {
uint256 indexed slotIndex,
SlotId slotId
);
event SlotFreed(RequestId indexed requestId, SlotId slotId);
event SlotFreed(
RequestId indexed requestId,
uint256 slotIndex,
SlotId slotId
);
event RequestCancelled(RequestId indexed requestId);
modifier marketplaceInvariant() {

View File

@ -375,7 +375,7 @@ describe("Marketplace", function () {
await waitUntilStarted(marketplace, request, proof, token)
await expect(await marketplace.freeSlot(id))
.to.emit(marketplace, "SlotFreed")
.withArgs(slot.request, id)
.withArgs(slot.request, slot.index, id)
})
})