fn ensure_transaction_is_accepted(
        &self,
        client: &mut Client,
        transaction: &Tx,
    ) -> Result<BlockIndex, TestClientError> {
        let tracer = tracer!();
        tracer.in_span("ensure_transaction_is_accepted", |_cx| {
            // Wait until ledger server can see all of these key images
            let mut deadline = Some(Instant::now() + self.policy.tx_submit_deadline);
            loop {
                match client
                    .is_transaction_present(transaction)
                    .map_err(TestClientError::ConfirmTx)?
                {
                    TransactionStatus::Appeared(block_index) => return Ok(block_index),
                    TransactionStatus::Expired => return Err(TestClientError::TxExpired),
                    TransactionStatus::Unknown => {}
                }
                deadline = if let Some(deadline) = deadline {
                    if Instant::now() > deadline {
                        counters::TX_CONFIRMED_DEADLINE_EXCEEDED_COUNT.inc();
                        if self.policy.fail_fast_on_deadline {
                            return Err(TestClientError::SubmittedTxTimeout);
                        }
                        None
                    } else {
                        Some(deadline)
                    }
                } else {
                    None
                };
                log::info!(
                    self.logger,
                    "Checking transaction again after {:?}...",
                    self.policy.polling_wait
                );
                std::thread::sleep(self.policy.polling_wait);
            }
        })
    }
/// Waits for a transaction to be accepted by the network
///
/// Uses the client to poll a fog service until the submitted transaction
/// either appears or has expired. Panics if the transaction is not
/// accepted.
///
/// Arguments:
/// * client: The client to use for this check
/// * transaction: The (submitted) transaction to check if it landed
///
/// Returns:
/// * A block index in which the transaction landed, or a test client error.
Waits for a transaction to be accepted by the network
Uses the client to poll a fog service until the submitted transaction
either appears or has expired. Panics if the transaction is not
accepted.

The client to use for this check
transaction: The (submitted) transaction to check if it landed

A block index in which the transaction landed, or a test client error.
Waits for a transaction to be accepted by the network Uses the client to poll a fog service until the submitted transaction either appears or has expired . Panics if the transaction is not accepted . The client to use for this check transaction : The ( submitted ) transaction to check if it landed A block index in which the transaction landed or a test client error .
fn ensure_transaction_is_accepted(
        &self,
        client: &mut Client,
        transaction: &Tx,
    ) -> Result<BlockIndex, TestClientError> {
        let tracer = tracer!();
        tracer.in_span("ensure_transaction_is_accepted", |_cx| {
            // Wait until ledger server can see all of these key images
            let mut deadline = Some(Instant::now() + self.policy.tx_submit_deadline);
            loop {
                match client
                    .is_transaction_present(transaction)
                    .map_err(TestClientError::ConfirmTx)?
                {
                    TransactionStatus::Appeared(block_index) => return Ok(block_index),
                    TransactionStatus::Expired => return Err(TestClientError::TxExpired),
                    TransactionStatus::Unknown => {}
                }
                deadline = if let Some(deadline) = deadline {
                    if Instant::now() > deadline {
                        counters::TX_CONFIRMED_DEADLINE_EXCEEDED_COUNT.inc();
                        if self.policy.fail_fast_on_deadline {
                            return Err(TestClientError::SubmittedTxTimeout);
                        }
                        None
                    } else {
                        Some(deadline)
                    }
                } else {
                    None
                };
                log::info!(
                    self.logger,
                    "Checking transaction again after {:?}...",
                    self.policy.polling_wait
                );
                std::thread::sleep(self.policy.polling_wait);
            }
        })
    }
fn ensure_transaction_is_accepted ( & self , client : & mut Client , transaction : & Tx , ) -> Result < BlockIndex , TestClientError > { let tracer = tracer ! ( ) ; tracer . in_span ( " " , | _cx | { // Wait until ledger server can see all of these key images let mut deadline = Some ( Instant :: now ( ) + self . policy . tx_submit_deadline ) ; loop { match client . is_transaction_present ( transaction ) . map_err ( TestClientError :: ConfirmTx ) ? { TransactionStatus :: Appeared ( block_index ) => return Ok ( block_index ) , TransactionStatus :: Expired => return Err ( TestClientError :: TxExpired ) , TransactionStatus :: Unknown => { } } deadline = if let Some ( deadline ) = deadline { if Instant :: now ( ) > deadline { counters :: TX_CONFIRMED_DEADLINE_EXCEEDED_COUNT . inc ( ) ; if self . policy . fail_fast_on_deadline { return Err ( TestClientError :: SubmittedTxTimeout ) ; } None } else { Some ( deadline ) } } else { None } ; log :: info ! ( self logger " " self policy polling_wait ) ; std :: thread :: sleep ( self . policy . polling_wait ) ; } } ) }
Waits for a transaction to be accepted by the network
Uses the client to poll a fog service until the submitted transaction
either appears or has expired.
Waits for a transaction to be accepted by the network Uses the client to poll a fog service until the submitted transaction either appears or has expired .
&self
client
&mut Client
transaction
&Tx
&self
client
&mut Client
transaction
&Tx