pub fn wait_for_transaction(
        &mut self,
        account: AccountAddress,
        sequence_number: u64,
    ) -> Result<()> {
        let mut max_iterations = 5000;
        println!(
            "waiting for {} with sequence number {}",
            account, sequence_number
        );
        loop {
            stdout().flush().unwrap();

            match self
                .client
                .get_txn_by_acc_seq(account, sequence_number - 1, true)
            {
                Ok(Some(txn_view)) => {
                    if txn_view.vm_status == StatusCode::EXECUTED {
                        println!("transaction executed!");
                        if txn_view.events.is_empty() {
                            println!("no events emitted");
                        }
                        break Ok(());
                    } else {
                        break Err(format_err!(
                            "transaction failed to execute; status: {:?}!",
                            txn_view.vm_status
                        ));
                    }
                }
                Err(e) => {
                    println!("Response with error: {:?}", e);
                }
                _ => {
                    print!(".");
                }
            }
            max_iterations -= 1;
            if max_iterations == 0 {
                panic!("wait_for_transaction timeout");
            }
            thread::sleep(time::Duration::from_millis(10));
        }
    }
/// Waits for the next transaction for a specific address and prints it
Waits for the next transaction for a specific address and prints it
Waits for the next transaction for a specific address and prints it
pub fn wait_for_transaction(
        &mut self,
        account: AccountAddress,
        sequence_number: u64,
    ) -> Result<()> {
        let mut max_iterations = 5000;
        println!(
            "waiting for {} with sequence number {}",
            account, sequence_number
        );
        loop {
            stdout().flush().unwrap();
            match self
                .client
                .get_txn_by_acc_seq(account, sequence_number - 1, true)
            {
                Ok(Some(txn_view)) => {
                    if txn_view.vm_status == StatusCode::EXECUTED {
                        println!("transaction executed!");
                        if txn_view.events.is_empty() {
                            println!("no events emitted");
                        }
                        break Ok(());
                    } else {
                        break Err(format_err!(
                            "transaction failed to execute; status: {:?}!",
                            txn_view.vm_status
                        ));
                    }
                }
                Err(e) => {
                    println!("Response with error: {:?}", e);
                }
                _ => {
                    print!(".");
                }
            }
            max_iterations -= 1;
            if max_iterations == 0 {
                panic!("wait_for_transaction timeout");
            }
            thread::sleep(time::Duration::from_millis(10));
        }
    }
pub fn wait_for_transaction ( & mut self , account : AccountAddress , sequence_number : u64 , ) -> Result < ( ) > { let mut max_iterations = 5000 ; println ! ( " " account sequence_number ) ; loop { stdout ( ) . flush ( ) . unwrap ( ) ; match self . client . get_txn_by_acc_seq ( account , sequence_number - 1 , true ) { Ok ( Some ( txn_view ) ) => { if txn_view . vm_status == StatusCode :: EXECUTED { println ! ( " " ) ; if txn_view . events . is_empty ( ) { println ! ( " " ) ; } break Ok ( ( ) ) ; } else { break Err ( format_err ! ( " " txn_view vm_status ) ) ; } } Err ( e ) => { println ! ( " " e ) ; } _ => { print ! ( " " ) ; } } max_iterations -= 1 ; if max_iterations == 0 { panic ! ( " " ) ; } thread :: sleep ( time :: Duration :: from_millis ( 10 ) ) ; } }
Waits for the next transaction for a specific address and prints it
Waits for the next transaction for a specific address and prints it
&mut self
account
AccountAddress
sequence_number
u64
&mut self
account
AccountAddress
sequence_number
u64