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
timeoutparameter sets the default number of seconds that each method will block before raising aTimeoutexception. - The
poll_intervaldetermines how long it should wait between polling. Ifpoll_interval == Nonethen 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
timeoutseconds 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
timeoutseconds returning the transaction receipt for the giventxn_hash.
-
Wait.for_block(block_number=1, timeout=120, poll_interval=None)¶ Blocks for up to
timeoutseconds 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
timeoutseconds waiting until the account specified byaccountis unlocked. Ifaccountis not provided,web3.eth.coinbasewill be used.
-
Wait.for_peers(peer_count=1, timeout=120, poll_interval=None)¶ Blocks for up to
timeoutseconds waiting for the client to have at leastpeer_countpeer connections.
-
Wait.for_syncing(timeout=120, poll_interval=None)¶ Blocks for up to
timeoutseconds waiting the chain to begin syncing.