sales: fix another flaky test

This commit is contained in:
Mark Spanbroek 2024-03-03 09:47:10 +01:00
parent 293ec2d788
commit 648881f1bb
No known key found for this signature in database
GPG Key ID: FBE3E9548D427C00
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ asyncchecksuite "sales state 'simulated-proving'":
proc advanceToNextPeriod(market: Market) {.async.} =
let periodicity = await market.periodicity()
clock.advance(periodicity.seconds.truncate(int64))
let current = periodicity.periodOf(clock.now().u256)
let periodEnd = periodicity.periodEnd(current)
clock.set(periodEnd.truncate(int64) + 1)
proc waitForProvingRounds(market: Market, rounds: int) {.async.} =
var rnds = rounds - 1 # proof round runs prior to advancing