diff --git a/tests/contracts/testClock.nim b/tests/contracts/testClock.nim index 40f7aed0..abc47496 100644 --- a/tests/contracts/testClock.nim +++ b/tests/contracts/testClock.nim @@ -30,7 +30,7 @@ ethersuite "On-Chain Clock": let waiting = clock.waitUntil(future) discard await ethProvider.send("evm_setNextBlockTimestamp", @[%future]) discard await ethProvider.send("evm_mine") - check await waiting.withTimeout(chronos.milliseconds(100)) + check await waiting.withTimeout(chronos.milliseconds(500)) test "can wait until a certain time is reached by the wall-clock": let future = clock.now() + 1 # seconds diff --git a/tests/contracts/testMarket.nim b/tests/contracts/testMarket.nim index a836628c..996fe893 100644 --- a/tests/contracts/testMarket.nim +++ b/tests/contracts/testMarket.nim @@ -114,8 +114,7 @@ ethersuite "On-Chain Market": receivedAsks.add(ask) let subscription = await market.subscribeRequests(onRequest) await market.requestStorage(request) - check receivedIds == @[request.id] - check receivedAsks == @[request.ask] + check eventually receivedIds == @[request.id] and receivedAsks == @[request.ask] await subscription.unsubscribe() test "supports filling of slots": @@ -181,8 +180,7 @@ ethersuite "On-Chain Market": let subscription = await market.subscribeSlotFilled(onSlotFilled) await market.reserveSlot(request.id, slotIndex) await market.fillSlot(request.id, slotIndex, proof, request.ask.collateral) - check receivedIds == @[request.id] - check receivedSlotIndices == @[slotIndex] + check eventually receivedIds == @[request.id] and receivedSlotIndices == @[slotIndex] await subscription.unsubscribe() test "subscribes only to a certain slot": @@ -194,10 +192,9 @@ ethersuite "On-Chain Market": let subscription = await market.subscribeSlotFilled(request.id, slotIndex, onSlotFilled) await market.reserveSlot(request.id, otherSlot) await market.fillSlot(request.id, otherSlot, proof, request.ask.collateral) - check receivedSlotIndices.len == 0 await market.reserveSlot(request.id, slotIndex) await market.fillSlot(request.id, slotIndex, proof, request.ask.collateral) - check receivedSlotIndices == @[slotIndex] + check eventually receivedSlotIndices == @[slotIndex] await subscription.unsubscribe() test "supports slot freed subscriptions": @@ -211,8 +208,7 @@ ethersuite "On-Chain Market": receivedIdxs.add(idx) let subscription = await market.subscribeSlotFreed(onSlotFreed) await market.freeSlot(slotId(request.id, slotIndex)) - check receivedRequestIds == @[request.id] - check receivedIdxs == @[slotIndex] + check eventually receivedRequestIds == @[request.id] and receivedIdxs == @[slotIndex] await subscription.unsubscribe() test "supports slot reservations full subscriptions": @@ -235,8 +231,7 @@ ethersuite "On-Chain Market": switchAccount(account3) await market.reserveSlot(request.id, slotIndex) - check receivedRequestIds == @[request.id] - check receivedIdxs == @[slotIndex] + check eventually receivedRequestIds == @[request.id] and receivedIdxs == @[slotIndex] await subscription.unsubscribe() test "support fulfillment subscriptions": @@ -248,7 +243,7 @@ ethersuite "On-Chain Market": for slotIndex in 0..