/// Sends a transaction to the JSON-RPC API and waits for a successful response
///
/// Useful for sending `eth_getReceipt` transactions, since validating a transaction
/// that you want a receipt for may take some time. Returns an error after `wait` seconds.
Sends a transaction to the JSON-RPC API and waits for a successful response
Useful for sending `eth_getReceipt` transactions, since validating a transaction
that you want a receipt for may take some time. Returns an error after `wait` seconds.
Sends a transaction to the JSON - RPC API and waits for a successful response Useful for sending ` eth_getReceipt ` transactions since validating a transaction that you want a receipt for may take some time . Returns an error after ` wait ` seconds .
pub fn wait_for_rpc_transaction<V, D>(
        &self,
        method: &str,
        params: &V,
        wait: u64,
    ) -> Result<D, Error>
    where
        V: Into<Value> + Serialize,
        D: DeserializeOwned,
    {
        for _ in 0..wait {
            match self.send_rpc_transaction(method, params) {
                Ok(result) => return Ok(result),
                Err(_) => sleep(Duration::new(1, 0)),
            }
        }
        Err(format_err!("Got a null response from the RPC server!"))
    }
pub fn wait_for_rpc_transaction < V , D > ( & self , method : & str , params : & V , wait : u64 , ) -> Result < D , Error > where V : Into < Value > + Serialize , D : DeserializeOwned , { for _ in 0 .. wait { match self . send_rpc_transaction ( method , params ) { Ok ( result ) => return Ok ( result ) , Err ( _ ) => sleep ( Duration :: new ( 1 , 0 ) ) , } } Err ( format_err ! ( " " ) ) }
Sends a transaction to the JSON-RPC API and waits for a successful response
Useful for sending `eth_getReceipt` transactions, since validating a transaction
that you want a receipt for may take some time.
Sends a transaction to the JSON - RPC API and waits for a successful response Useful for sending ` eth_getReceipt ` transactions since validating a transaction that you want a receipt for may take some time .
&self
method
&str
params
&V
wait
u64