{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/web3.py/issues/574","repository_url":"https://api.github.com/repos/ethereum/web3.py","labels_url":"https://api.github.com/repos/ethereum/web3.py/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/web3.py/issues/574/comments","events_url":"https://api.github.com/repos/ethereum/web3.py/issues/574/events","html_url":"https://github.com/ethereum/web3.py/issues/574","id":290617998,"number":574,"title":"Add function w3.eth.waitForTransactionReceipt(tx_hash)","user":{"login":"carver","id":205327,"avatar_url":"https://avatars0.githubusercontent.com/u/205327?v=4","gravatar_id":"","url":"https://api.github.com/users/carver","html_url":"https://github.com/carver","followers_url":"https://api.github.com/users/carver/followers","following_url":"https://api.github.com/users/carver/following{/other_user}","gists_url":"https://api.github.com/users/carver/gists{/gist_id}","starred_url":"https://api.github.com/users/carver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carver/subscriptions","organizations_url":"https://api.github.com/users/carver/orgs","repos_url":"https://api.github.com/users/carver/repos","events_url":"https://api.github.com/users/carver/events{/privacy}","received_events_url":"https://api.github.com/users/carver/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-01-22T21:16:51Z","updated_at":"2018-02-20T07:17:41Z","closed_at":null,"author_association":"COLLABORATOR","body":"* Version: 4\r\n\r\n### What was wrong?\r\n\r\nIt'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 \r\n\r\nThis is a very common need, and should have an easy one-liner.\r\n\r\n### How can it be fixed?\r\n\r\nSomething like:\r\n\r\n```py\r\nreceipt = w3.eth.waitForTransactionReceipt(tx_hash)\r\ncontract = MyContract(receipt['contractAddress'])\r\n\r\n# or\r\n\r\nwith w3.waitFor(lambda: w3.eth.getTransactionReceipt(tx_hash)) as receipt:\r\n    contract = MyContract(receipt['contractAddress'])\r\n\r\n```\r\n\r\nVery open to alternative API suggestions.\r\n\r\nThis 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."},"comment":{"url":"https://api.github.com/repos/ethereum/web3.py/issues/comments/366887143","html_url":"https://github.com/ethereum/web3.py/issues/574#issuecomment-366887143","issue_url":"https://api.github.com/repos/ethereum/web3.py/issues/574","id":366887143,"user":{"login":"mhchia","id":8223657,"avatar_url":"https://avatars3.githubusercontent.com/u/8223657?v=4","gravatar_id":"","url":"https://api.github.com/users/mhchia","html_url":"https://github.com/mhchia","followers_url":"https://api.github.com/users/mhchia/followers","following_url":"https://api.github.com/users/mhchia/following{/other_user}","gists_url":"https://api.github.com/users/mhchia/gists{/gist_id}","starred_url":"https://api.github.com/users/mhchia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhchia/subscriptions","organizations_url":"https://api.github.com/users/mhchia/orgs","repos_url":"https://api.github.com/users/mhchia/repos","events_url":"https://api.github.com/users/mhchia/events{/privacy}","received_events_url":"https://api.github.com/users/mhchia/received_events","type":"User","site_admin":false},"created_at":"2018-02-20T07:17:41Z","updated_at":"2018-02-20T07:17:41Z","author_association":"CONTRIBUTOR","body":"This is pretty helpful! Thanks for the work"}}
{"actor":{"display_login":"mhchia"}}