pub fn gen_pairwise_txn_requests(
        &self,
        accounts: &mut [AccountData],
    ) -> Vec<SubmitTransactionRequest> {
        let receiver_addrs: Vec<AccountAddress> =
            accounts.iter().map(|account| account.address).collect();
        let mut txn_reqs = vec![];
        for sender in accounts.iter_mut() {
            for receiver_addr in receiver_addrs.iter() {
                match self.gen_transfer_txn_request(sender, receiver_addr, 1) {
                    Ok(txn_req) => txn_reqs.push(txn_req),
                    Err(e) => {
                        error!(
                            "failed to generate {:?} to {:?} transfer TXN: {:?}",
                            sender.address, receiver_addr, e
                        );
                    }
                }
            }
        }
        txn_reqs
    }
/// Pre-generate TXN requests of pairwise transfers between accounts, including self to self
/// transfer. For example, given account (A1, A2, A3, ..., AN), this method returns a vector
/// of TXNs like (A1->A1, A1->A2, ..., A1->AN, A2->A1, A2->A2, ... A2->AN, ..., AN->A(N-1)).
Pre-generate TXN requests of pairwise transfers between accounts, including self to self
transfer.
Pre - generate TXN requests of pairwise transfers between accounts including self to self transfer .
pub fn gen_pairwise_txn_requests(
        &self,
        accounts: &mut [AccountData],
    ) -> Vec<SubmitTransactionRequest> {
        let receiver_addrs: Vec<AccountAddress> =
            accounts.iter().map(|account| account.address).collect();
        let mut txn_reqs = vec![];
        for sender in accounts.iter_mut() {
            for receiver_addr in receiver_addrs.iter() {
                match self.gen_transfer_txn_request(sender, receiver_addr, 1) {
                    Ok(txn_req) => txn_reqs.push(txn_req),
                    Err(e) => {
                        error!(
                            "failed to generate {:?} to {:?} transfer TXN: {:?}",
                            sender.address, receiver_addr, e
                        );
                    }
                }
            }
        }
        txn_reqs
    }
pub fn gen_pairwise_txn_requests ( & self , accounts : & mut [ AccountData ] , ) -> Vec < SubmitTransactionRequest > { let receiver_addrs : Vec < AccountAddress > = accounts . iter ( ) . map ( | account | account . address ) . collect ( ) ; let mut txn_reqs = vec ! [ ] ; for sender in accounts . iter_mut ( ) { for receiver_addr in receiver_addrs . iter ( ) { match self . gen_transfer_txn_request ( sender , receiver_addr , 1 ) { Ok ( txn_req ) => txn_reqs . push ( txn_req ) , Err ( e ) => { error ! ( " " sender address receiver_addr e ) ; } } } } txn_reqs }
Pre-generate TXN requests of pairwise transfers between accounts, including self to self
transfer.
Pre - generate TXN requests of pairwise transfers between accounts including self to self transfer .
&self
accounts
&mut [AccountData]