class Eth::Client
def wait_for_tx(hash)
-
(Timeout::Error)
- if it's not mined within 5 minutes.
Returns:
-
(String)
- the transaction hash once the transaction is mined.
Parameters:
-
hash
(String
) -- the transaction hash.
def wait_for_tx(hash) start_time = Time.now timeout = 300 retry_rate = 0.1 loop do raise Timeout::Error if ((Time.now - start_time) > timeout) return hash if is_mined_tx? hash sleep retry_rate end end