Remove cancelTransaction, add period cadence to testproofs

This commit is contained in:
Eric 2023-10-25 17:28:55 +11:00
parent bc0652aeb6
commit 3964f868f5
No known key found for this signature in database
3 changed files with 6 additions and 15 deletions

View File

@ -77,9 +77,6 @@ method getActiveSlot*(
raiseAssert("not implemented")
method cancelTransaction(market: Market, nonce: UInt256) {.base, async.} =
raiseAssert("not implemented")
method fillSlot*(market: Market,
requestId: RequestId,
slotIndex: UInt256,

View File

@ -205,9 +205,6 @@ proc emitRequestFailed*(market: MockMarket, requestId: RequestId) =
subscription.requestId.isNone:
subscription.callback(requestId)
proc cancelTransaction(market: Market, nonce: UInt256) {.async.} =
discard
proc fillSlot*(market: MockMarket,
requestId: RequestId,
slotIndex: UInt256,

View File

@ -344,11 +344,6 @@ multinodesuite "Simulate invalid proofs",
return id
proc waitUntilPurchaseIsFinished(purchaseId: PurchaseId, duration: int) {.async.} =
let client = clients()[0].node.client
check eventually(client.purchaseStateIs(purchaseId, "finished"), duration * 1000)
# TODO: these are very loose tests in that they are not testing EXACTLY how
# proofs were marked as missed by the validator. These tests should be
# tightened so that they are showing, as an integration test, that specific
@ -362,13 +357,15 @@ multinodesuite "Simulate invalid proofs",
let purchaseId = await requestStorage(duration=totalProofs.periods)
check eventually clientRestClient.purchaseStateIs(purchaseId, "started")
# await waitUntilPurchaseIsFinished(purchaseId, duration=totalProofs.periods.int)
let duration = (totalProofs.periods.int + 2) * 10 # 10 seconds per period
check eventually(
clientRestClient.purchaseStateIs(purchaseId, "finished"), duration * 1000
)
for _ in 0..<totalProofs.periods.int:
if clientRestClient.purchaseStateIs(purchaseId, "finished"):
break
else:
await advanceToNextPeriod()
await sleepAsync(1.seconds)
check eventually (
(await token.balanceOf(!provider1.address)) >