@@ -189,7 +189,46 @@ ethersuite "On-Chain Market":
189189 let missingPeriod =
190190 periodicity.periodOf ((await ethProvider.currentTime ()).truncate (uint64 ))
191191 await advanceToNextPeriod ()
192- check (await market.canProofBeMarkedAsMissing (slotId, missingPeriod)) == true
192+ check (await market.canMarkProofAsMissing (slotId, missingPeriod)) == true
193+
194+ test " can check whether a proof cannot be marked as missing when the slot is free" :
195+ let slotId = slotId (request, slotIndex)
196+ await market.requestStorage (request)
197+ await market.reserveSlot (request.id, slotIndex)
198+ await market.fillSlot (request.id, slotIndex, proof, request.ask.collateralPerSlot)
199+ await waitUntilProofRequired (slotId)
200+
201+ await market.freeSlot (slotId (request.id, slotIndex))
202+
203+ let missingPeriod =
204+ periodicity.periodOf ((await ethProvider.currentTime ()).truncate (uint64 ))
205+ await advanceToNextPeriod ()
206+ check (await market.canMarkProofAsMissing (slotId, missingPeriod)) == false
207+
208+ test " can check whether a proof cannot be marked as missing before a proof is required" :
209+ let slotId = slotId (request, slotIndex)
210+ await market.requestStorage (request)
211+ await market.reserveSlot (request.id, slotIndex)
212+ await market.fillSlot (request.id, slotIndex, proof, request.ask.collateralPerSlot)
213+
214+ let missingPeriod =
215+ periodicity.periodOf ((await ethProvider.currentTime ()).truncate (uint64 ))
216+ await advanceToNextPeriod ()
217+ check (await market.canMarkProofAsMissing (slotId, missingPeriod)) == false
218+
219+ test " can check whether a proof cannot be marked as missing if the proof was submitted" :
220+ let slotId = slotId (request, slotIndex)
221+ await market.requestStorage (request)
222+ await market.reserveSlot (request.id, slotIndex)
223+ await market.fillSlot (request.id, slotIndex, proof, request.ask.collateralPerSlot)
224+ await waitUntilProofRequired (slotId)
225+
226+ await market.submitProof (slotId (request.id, slotIndex), proof)
227+
228+ let missingPeriod =
229+ periodicity.periodOf ((await ethProvider.currentTime ()).truncate (uint64 ))
230+ await advanceToNextPeriod ()
231+ check (await market.canMarkProofAsMissing (slotId, missingPeriod)) == false
193232
194233 test " supports slot filled subscriptions" :
195234 await market.requestStorage (request)
@@ -575,7 +614,7 @@ ethersuite "On-Chain Market":
575614 switchAccount (host)
576615 await market.reserveSlot (request.id, 0 .uint64 )
577616 await market.fillSlot (request.id, 0 .uint64 , proof, request.ask.collateralPerSlot)
578- let filledAt = ( await ethProvider.currentTime () )
617+ let filledAt = await ethProvider.blockTime ( BlockTag .latest )
579618
580619 for slotIndex in 1 ..< request.ask.slots:
581620 await market.reserveSlot (request.id, slotIndex.uint64 )
0 commit comments