From 3b0e93eab4eccec58107aa11bef7958c26372b5b Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Fri, 3 Jun 2022 08:09:53 +1000 Subject: [PATCH] [chore] bump nim-ethers to 0.1.7 (#107) * [chore] bump nim-ethers to 0.1.7 * [chore] make block handler callback async nim-ethers 0.1.7 makes the subscription callbacks async. --- codex.nimble | 2 +- codex/contracts/clock.nim | 4 ++-- vendor/nim-ethers | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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