diff --git a/codex.nimble b/codex.nimble index d3e017aa..e3348d80 100644 --- a/codex.nimble +++ b/codex.nimble @@ -13,7 +13,7 @@ requires "nim >= 1.2.0", "chronicles >= 0.7.2", "chronos >= 2.5.2", "confutils", - "ethers >= 0.1.6 & < 0.2.0", + "ethers >= 0.1.7 & < 0.2.0", "libbacktrace", "libp2p", "metrics", diff --git a/codex/contracts/clock.nim b/codex/contracts/clock.nim index 718c7ce4..dd17986f 100644 --- a/codex/contracts/clock.nim +++ b/codex/contracts/clock.nim @@ -21,13 +21,13 @@ proc start*(clock: OnChainClock) {.async.} = return clock.started = true - proc onBlock(blck: Block) {.gcsafe, upraises:[].} = + proc onBlock(blck: Block) {.async, upraises:[].} = let blockTime = blck.timestamp.truncate(int64) let computerTime = getTime().toUnix clock.offset = blockTime - computerTime if latestBlock =? (await clock.provider.getBlock(BlockTag.latest)): - onBlock(latestBlock) + await onBlock(latestBlock) clock.subscription = await clock.provider.subscribe(onBlock) diff --git a/vendor/nim-ethers b/vendor/nim-ethers index 0549800a..270d358b 160000 --- a/vendor/nim-ethers +++ b/vendor/nim-ethers @@ -1 +1 @@ -Subproject commit 0549800af6551525cbca2998ce51d0a66f25a3ec +Subproject commit 270d358b869d02a4c625dde971f799db336670fb