async fn await_txs_execution(
    tx_hashes: Vec<TxHash>,
    tps_counter: Arc<TPSCounter>,
    rpc_client: RpcClient,
) {
    async fn await_tx(tx_hash: TxHash, rpc_client: RpcClient, tps_counter: Arc<TPSCounter>) {
        let timeout = Duration::from_secs(TX_EXECUTION_TIMEOUT_SEC);
        let start = Instant::now();

        // Small polling interval, so we won't wait too long between confirmation
        // check attempts.
        let polling_interval = Duration::from_millis(100);
        let mut timer = time::interval(polling_interval);
        loop {
            let state = rpc_client
                .tx_info(tx_hash.clone())
                .await
                .expect("[wait_for_verify] call tx_info");

            if state.executed {
                tps_counter.increment();
                break;
            }
            if start.elapsed() > timeout {
                panic!("[wait_for_verify] Timeout")
            }
            timer.tick().await;
        }
    }

    for hash in tx_hashes {
        await_tx(hash, rpc_client.clone(), tps_counter.clone()).await;
    }
}
/// Waits for the transactions to be executed and measures the execution TPS.
Waits for the transactions to be executed and measures the execution TPS.
Waits for the transactions to be executed and measures the execution TPS .
async fn await_txs_execution(
    tx_hashes: Vec<TxHash>,
    tps_counter: Arc<TPSCounter>,
    rpc_client: RpcClient,
) {
    async fn await_tx(tx_hash: TxHash, rpc_client: RpcClient, tps_counter: Arc<TPSCounter>) {
        let timeout = Duration::from_secs(TX_EXECUTION_TIMEOUT_SEC);
        let start = Instant::now();
        // Small polling interval, so we won't wait too long between confirmation
        // check attempts.
        let polling_interval = Duration::from_millis(100);
        let mut timer = time::interval(polling_interval);
        loop {
            let state = rpc_client
                .tx_info(tx_hash.clone())
                .await
                .expect("[wait_for_verify] call tx_info");
            if state.executed {
                tps_counter.increment();
                break;
            }
            if start.elapsed() > timeout {
                panic!("[wait_for_verify] Timeout")
            }
            timer.tick().await;
        }
    }
    for hash in tx_hashes {
        await_tx(hash, rpc_client.clone(), tps_counter.clone()).await;
    }
}
async fn await_txs_execution ( tx_hashes : Vec < TxHash > , tps_counter : Arc < TPSCounter > , rpc_client : RpcClient , ) { async fn await_tx ( tx_hash : TxHash , rpc_client : RpcClient , tps_counter : Arc < TPSCounter > ) { let timeout = Duration :: from_secs ( TX_EXECUTION_TIMEOUT_SEC ) ; let start = Instant :: now ( ) ; // Small polling interval, so we won't wait too long between confirmation // check attempts. let polling_interval = Duration :: from_millis ( 100 ) ; let mut timer = time :: interval ( polling_interval ) ; loop { let state = rpc_client . tx_info ( tx_hash . clone ( ) ) . await . expect ( " " ) ; if state . executed { tps_counter . increment ( ) ; break ; } if start . elapsed ( ) > timeout { panic ! ( " " ) } timer . tick ( ) . await ; } } for hash in tx_hashes { await_tx ( hash , rpc_client . clone ( ) , tps_counter . clone ( ) ) . await ; } }
Waits for the transactions to be executed and measures the execution TPS.
Waits for the transactions to be executed and measures the execution TPS .
tx_hashes
Vec<TxHash>
tps_counter
Arc<TPSCounter>
rpc_client
RpcClient