Ethers.js: WaitForTransaction can be faster (like it used to be) by checking immediately.

Created on 15 Feb 2019  路  4Comments  路  Source: ethers-io/ethers.js

The fix to issue
https://github.com/ethers-io/ethers.js/issues/410 introduces a delay in waitForTransaction significantly impacting Blockchains with very short blocktimes (Ganache, G枚rli, PoA, etc).

This can be fixed by checking immediately for a receipt instead of waiting for the next block, which was introduced by moving waitForTransaction to use the event handler instead of manually polling, which was not cancellable.

bug fixed

Most helpful comment

@ricmoo Fix works for us, tests are even slightly faster 馃帀
Thanks for the fast response (again) 鉂わ笍

All 4 comments

@elenadimitrova - I've Added a fix for what I think is your problem to the GitHub repo (not published on NPM). Can you try out this version and see if it solves your slow-down issue?

Thanks! :)

@ricmoo Fix works for us, tests are even slightly faster 馃帀
Thanks for the fast response (again) 鉂わ笍

Awesome! I鈥檒l do some final testing this weekend and publish to NPM. :)

This is now published in 4.0.26. Let me know if there are any problems!

Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ricmoo picture ricmoo  路  24Comments

lastmjs picture lastmjs  路  31Comments

dev1644 picture dev1644  路  42Comments

fmsouza picture fmsouza  路  44Comments

fmsouza picture fmsouza  路  51Comments