[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.
This commit is contained in:
parent
6ce7e23767
commit
3b0e93eab4
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 0549800af6551525cbca2998ce51d0a66f25a3ec
|
||||
Subproject commit 270d358b869d02a4c625dde971f799db336670fb
|
Loading…
Reference in New Issue