Wait API¶
-
class
populus.wait.
Wait
(web3, timeout=empty, poll_interval=empty)¶
Each chain object exposes the following API through a property Chain.wait.
- The
timeout
parameter sets the default number of seconds that each method will block before raising aTimeout
exception. - The
poll_interval
determines how long it should wait between polling. Ifpoll_interval == None
then a random value between 0 and 1 second will be used for the polling interval.
-
Wait.
for_contract_address
(txn_hash, timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds returning the contract address from the transaction receipt for the giventxn_hash
.
-
Wait.
for_receipt
(txn_hash, timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds returning the transaction receipt for the giventxn_hash
.
-
Wait.
for_block
(block_number=1, timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds waiting until the highest block on the current chain is at leastblock_number
.
-
Wait.
for_unlock
(account=web3.eth.coinbase, timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds waiting until the account specified byaccount
is unlocked. Ifaccount
is not provided,web3.eth.coinbase
will be used.
-
Wait.
for_peers
(peer_count=1, timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds waiting for the client to have at leastpeer_count
peer connections.
-
Wait.
for_syncing
(timeout=120, poll_interval=None)¶ Blocks for up to
timeout
seconds waiting the chain to begin syncing.