Closed
Description
- Version: 4
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:
receipt = w3.eth.waitForTransactionReceipt(tx_hash)
contract = MyContract(receipt['contractAddress'])
# or
with w3.waitFor(lambda: w3.eth.getTransactionReceipt(tx_hash)) as receipt:
contract = MyContract(receipt['contractAddress'])
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.
Metadata
Metadata
Assignees
Labels
No labels