mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-20 03:03:44 +00:00
Remove cancelTransaction, add period cadence to testproofs
This commit is contained in:
parent
bc0652aeb6
commit
3964f868f5
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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)) >
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user