Skip to content

Commit

Permalink
DEBUG: clock updates
Browse files Browse the repository at this point in the history
  • Loading branch information
markspanbroek committed Nov 13, 2024
1 parent bf5404b commit b188834
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion codex/contracts/clock.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ proc update(clock: OnChainClock, blck: Block) =
proc update(clock: OnChainClock) {.async.} =
try:
if latest =? (await clock.provider.getBlock(BlockTag.latest)):
debugEcho "clock update latest block number", latest.number

Check warning on line 37 in codex/contracts/clock.nim

View check run for this annotation

Codecov / codecov/patch

codex/contracts/clock.nim#L37

Added line #L37 was not covered by tests
clock.update(latest)
except CancelledError as error:
raise error
Expand All @@ -45,7 +46,8 @@ method start*(clock: OnChainClock) {.async.} =
if clock.started:
return

proc onBlock(_: Block) =
proc onBlock(blck: Block) =
debugEcho "clock onBlock block number: ", blck.number

Check warning on line 50 in codex/contracts/clock.nim

View check run for this annotation

Codecov / codecov/patch

codex/contracts/clock.nim#L49-L50

Added lines #L49 - L50 were not covered by tests
# ignore block parameter; hardhat may call this with pending blocks
asyncSpawn clock.update()

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/testpurchasing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ twonodessuite "Purchasing", debug1 = true, debug2 = false:
nodes=3.uint,
tolerance=1.uint).get
check eventually(client1.purchaseStateIs(id, "submitted"), timeout = 10*1000)

debugEcho "client state: ", client1.getPurchase(id).?state
node1.restart()
client1.restart()

Expand Down

0 comments on commit b188834

Please sign in to comment.