pub async fn poll_for_first_block(rpc_client: &rpc::HttpClient) {
    rpc_client
        .wait_until_healthy(Duration::from_secs(5))
        .await
        .unwrap();

    let mut attempts_remaining = 25;

    while let Err(e) = rpc_client.latest_block().await {
        if !matches!(e.detail(), rpc::error::ErrorDetail::Serde(_)) {
            panic!("unexpected error waiting for first block: {:?}", e);
        }

        if attempts_remaining == 0 {
            panic!("timeout waiting for first block");
        }

        attempts_remaining -= 1;
        time::sleep(Duration::from_millis(200)).await;
    }
}
/// Wait for the node to produce the first block.
///
/// This should be used at the beginning of the test lifecycle to ensure
/// the node is fully booted.
Wait for the node to produce the first block.
This should be used at the beginning of the test lifecycle to ensure
the node is fully booted.
Wait for the node to produce the first block . This should be used at the beginning of the test lifecycle to ensure the node is fully booted .
pub async fn poll_for_first_block(rpc_client: &rpc::HttpClient) {
    rpc_client
        .wait_until_healthy(Duration::from_secs(5))
        .await
        .unwrap();
    let mut attempts_remaining = 25;
    while let Err(e) = rpc_client.latest_block().await {
        if !matches!(e.detail(), rpc::error::ErrorDetail::Serde(_)) {
            panic!("unexpected error waiting for first block: {:?}", e);
        }
        if attempts_remaining == 0 {
            panic!("timeout waiting for first block");
        }
        attempts_remaining -= 1;
        time::sleep(Duration::from_millis(200)).await;
    }
}
pub async fn poll_for_first_block ( rpc_client : & rpc :: HttpClient ) { rpc_client . wait_until_healthy ( Duration :: from_secs ( 5 ) ) . await . unwrap ( ) ; let mut attempts_remaining = 25 ; while let Err ( e ) = rpc_client . latest_block ( ) . await { if ! matches ! ( e detail ( ) rpc error ErrorDetail Serde ( ) ) { panic ! ( " " e ) ; } if attempts_remaining == 0 { panic ! ( " " ) ; } attempts_remaining -= 1 ; time :: sleep ( Duration :: from_millis ( 200 ) ) . await ; } }
Wait for the node to produce the first block.
Wait for the node to produce the first block .
rpc_client
&rpc::HttpClient
rpc_client
&rpc::HttpClient