-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function w3.eth.waitForTransactionReceipt(tx_hash) #574
Comments
Hey @carver I've been using this function. Is this different from different from what you were thinking? |
@jstoxrocky Yeah, it makes sense to reuse that implementation. But So all that's really left for this issue is:
|
@carver, I would like to work on this if you can provide some direction. thanks |
@scottydelta sure! Let's use that first API. So add Docs go in the docs folder, and a test to make sure that the method doesn't return until the transaction is mined. Posting the pull request as a work in progress early on is a good way to make sure that you're in the right track or provide context when asking for help. Please do reach out if you get stuck. |
@carver this is somewhat orthogonal but... What do you think about introducing a |
Or maybe web3.async.* that replicates the whole web3 namespace? Seems reasonable, but probably after getting v4 stable. |
cc @NIC619 as I think this would be beneficial for the VMC at some point. Just want to put this in your awareness. |
@NIC619 moving async discussion to a new #657 so @scottydelta and I can focus on |
This is pretty helpful! Thanks for the work |
@carver, if we follow this approach then we will be making unnecessary loop.
so wont it be easier if |
Only that we try to avoid keeping the logic at the "edges" where the public API is, so putting the logic in private utility modules and referencing it in the public API is more consistent with our style. I don't see this as being a significant performance hit, relative to the other things happening in the flow. |
ok cool, I will add it in the way you suggested, thanks. |
What was wrong?
It's a bit cumbersome to wait for a transaction to be mined. For example, after deploying a transaction, example code typically involves a small while loop, like in #573
This is a very common need, and should have an easy one-liner.
How can it be fixed?
Something like:
Very open to alternative API suggestions.
This could potentially let us do cool things eventually, like use pubsub under the hood. Note that pubsub integration would be significantly easier in the first API than the second. But the first API implies adding other new functions that start with
waitFor
at some point in the future.The text was updated successfully, but these errors were encountered: