mirror of
https://github.com/status-im/nim-ethers.git
synced 2025-01-12 16:44:23 +00:00
Fix intermittently failing test
eth_getFilterChanges returns the current block for new subscriptions, which made the test fail.
This commit is contained in:
parent
1b151d589d
commit
76bd3090d1
@ -42,6 +42,7 @@ for url in ["ws://localhost:8545", "http://localhost:8545"]:
|
|||||||
|
|
||||||
test "subscribes to new blocks":
|
test "subscribes to new blocks":
|
||||||
let oldBlock = !await provider.getBlock(BlockTag.latest)
|
let oldBlock = !await provider.getBlock(BlockTag.latest)
|
||||||
|
discard await provider.send("evm_mine")
|
||||||
var newBlock: Block
|
var newBlock: Block
|
||||||
let blockHandler = proc(blck: Block) {.async.} = newBlock = blck
|
let blockHandler = proc(blck: Block) {.async.} = newBlock = blck
|
||||||
let subscription = await provider.subscribe(blockHandler)
|
let subscription = await provider.subscribe(blockHandler)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user