pub async fn wait_for_deposit_executed(
    serial_id: u64,
    rpc_client: &RpcClient,
) -> Result<u64, failure::Error> {
    let mut executed = false;
    // We poll the operation status twice a second until timeout is reached.
    let start = Instant::now();
    let timeout = Duration::from_secs(DEPOSIT_TIMEOUT_SEC);
    let polling_interval = Duration::from_millis(100);
    let mut timer = time::interval(polling_interval);

    // Polling cycle.
    while !executed && start.elapsed() < timeout {
        timer.tick().await;
        let state = rpc_client.ethop_info(serial_id).await?;
        executed = state.executed;
    }

    // Check for the successful execution.
    if !executed {
        failure::bail!("Deposit operation timeout");
    }

    Ok(serial_id)
}
/// Waits until the deposit priority operation is executed.
Waits until the deposit priority operation is executed.
Waits until the deposit priority operation is executed .
pub async fn wait_for_deposit_executed(
    serial_id: u64,
    rpc_client: &RpcClient,
) -> Result<u64, failure::Error> {
    let mut executed = false;
    // We poll the operation status twice a second until timeout is reached.
    let start = Instant::now();
    let timeout = Duration::from_secs(DEPOSIT_TIMEOUT_SEC);
    let polling_interval = Duration::from_millis(100);
    let mut timer = time::interval(polling_interval);
    // Polling cycle.
    while !executed && start.elapsed() < timeout {
        timer.tick().await;
        let state = rpc_client.ethop_info(serial_id).await?;
        executed = state.executed;
    }
    // Check for the successful execution.
    if !executed {
        failure::bail!("Deposit operation timeout");
    }
    Ok(serial_id)
}
pub async fn wait_for_deposit_executed ( serial_id : u64 , rpc_client : & RpcClient , ) -> Result < u64 , failure :: Error > { let mut executed = false ; // We poll the operation status twice a second until timeout is reached. let start = Instant :: now ( ) ; let timeout = Duration :: from_secs ( DEPOSIT_TIMEOUT_SEC ) ; let polling_interval = Duration :: from_millis ( 100 ) ; let mut timer = time :: interval ( polling_interval ) ; // Polling cycle. while ! executed && start . elapsed ( ) < timeout { timer . tick ( ) . await ; let state = rpc_client . ethop_info ( serial_id ) . await ? ; executed = state . executed ; } // Check for the successful execution. if ! executed { failure :: bail ! ( " " ) ; } Ok ( serial_id ) }
Waits until the deposit priority operation is executed.
Waits until the deposit priority operation is executed .
serial_id
u64
rpc_client
&RpcClient