Open snowkidind opened 3 years ago
You should not rely on this method to wait for transaction confirmation. This helper is really there to aid in some of the testing the library does when the transactions are triggered in a controlled manner in a private chain. This would be very fragile in a public environment due to the reasons you stated.
The current approach for waiting for transaction confirmation in some of the client integrations is to poll transaction.all
and wait for a known sent transaction to show up there. There is work being done on the Watcher side to have pending state returned so we don't have to rely on these kinds of workarounds. Hopefuly we can remove this function in the future for something more robust.
Regarding: https://github.com/omgnetwork/omg-js/blob/master/packages/omg-js-util/src/waitForChildchainBalance.js
After playing with this in my integration I've concluded that there are a lot of problems with this, but I will bring forth a couple:
Suggested fixes: