async fn funds_rotation_step(&mut self) -> Result<(), failure::Error> {
        let mut signed_transfers = Vec::with_capacity(self.n_accounts);

        for from_id in 0..self.n_accounts {
            let from_acc = &self.accounts[from_id];
            let to_id = self.acc_for_transfer(from_id);
            let to_acc = &self.accounts[to_id];

            let fee = self.transfer_fee(&to_acc).await;
            let transfer = self.sign_transfer(from_acc, to_acc, self.transfer_size.clone(), fee);

            signed_transfers.push(transfer);
        }

        log::info!("Signed transfers, sending");

        // Send txs by batches that can fit in one block.
        let to_verify = signed_transfers.len();
        let mut verified = 0;
        let txs_chunks = DynamicChunks::new(signed_transfers, &self.block_sizes);
        for tx_batch in txs_chunks {
            let mut tx_futures = vec![];
            // Send each tx.
            for (tx, eth_sign) in tx_batch {
                let tx_future = self.rpc_client.send_tx(tx.clone(), eth_sign.clone());

                tx_futures.push(tx_future);
            }
            let mut sent_txs = SentTransactions::new();
            sent_txs.tx_hashes = try_join_all(tx_futures).await?;

            let sent_txs_amount = sent_txs.len();
            verified += sent_txs_amount;

            // Wait until all the transactions are verified.
            wait_for_verify(sent_txs, self.verify_timeout, &self.rpc_client).await?;

            log::info!(
                "Sent and verified {}/{} txs ({} on this iteration)",
                verified,
                to_verify,
                sent_txs_amount
            );
        }

        log::info!("Transfers are sent and verified");

        Ok(())
    }
/// Transfers the money between intermediate accounts. For each account with
/// ID `N`, money are transferred to the account with ID `N + 1`.
Transfers the money between intermediate accounts. For each account with
ID `N`, money are transferred to the account with ID `N + 1`.
Transfers the money between intermediate accounts . For each account with ID ` N ` money are transferred to the account with ID ` N + 1 ` .
async fn funds_rotation_step(&mut self) -> Result<(), failure::Error> {
        let mut signed_transfers = Vec::with_capacity(self.n_accounts);
        for from_id in 0..self.n_accounts {
            let from_acc = &self.accounts[from_id];
            let to_id = self.acc_for_transfer(from_id);
            let to_acc = &self.accounts[to_id];
            let fee = self.transfer_fee(&to_acc).await;
            let transfer = self.sign_transfer(from_acc, to_acc, self.transfer_size.clone(), fee);
            signed_transfers.push(transfer);
        }
        log::info!("Signed transfers, sending");
        // Send txs by batches that can fit in one block.
        let to_verify = signed_transfers.len();
        let mut verified = 0;
        let txs_chunks = DynamicChunks::new(signed_transfers, &self.block_sizes);
        for tx_batch in txs_chunks {
            let mut tx_futures = vec![];
            // Send each tx.
            for (tx, eth_sign) in tx_batch {
                let tx_future = self.rpc_client.send_tx(tx.clone(), eth_sign.clone());
                tx_futures.push(tx_future);
            }
            let mut sent_txs = SentTransactions::new();
            sent_txs.tx_hashes = try_join_all(tx_futures).await?;
            let sent_txs_amount = sent_txs.len();
            verified += sent_txs_amount;
            // Wait until all the transactions are verified.
            wait_for_verify(sent_txs, self.verify_timeout, &self.rpc_client).await?;
            log::info!(
                "Sent and verified {}/{} txs ({} on this iteration)",
                verified,
                to_verify,
                sent_txs_amount
            );
        }
        log::info!("Transfers are sent and verified");
        Ok(())
    }
async fn funds_rotation_step ( & mut self ) -> Result < ( ) , failure :: Error > { let mut signed_transfers = Vec :: with_capacity ( self . n_accounts ) ; for from_id in 0 .. self . n_accounts { let from_acc = & self . accounts [ from_id ] ; let to_id = self . acc_for_transfer ( from_id ) ; let to_acc = & self . accounts [ to_id ] ; let fee = self . transfer_fee ( & to_acc ) . await ; let transfer = self . sign_transfer ( from_acc , to_acc , self . transfer_size . clone ( ) , fee ) ; signed_transfers . push ( transfer ) ; } log :: info ! ( " " ) ; // Send txs by batches that can fit in one block. let to_verify = signed_transfers . len ( ) ; let mut verified = 0 ; let txs_chunks = DynamicChunks :: new ( signed_transfers , & self . block_sizes ) ; for tx_batch in txs_chunks { let mut tx_futures = vec ! [ ] ; // Send each tx. for ( tx , eth_sign ) in tx_batch { let tx_future = self . rpc_client . send_tx ( tx . clone ( ) , eth_sign . clone ( ) ) ; tx_futures . push ( tx_future ) ; } let mut sent_txs = SentTransactions :: new ( ) ; sent_txs . tx_hashes = try_join_all ( tx_futures ) . await ? ; let sent_txs_amount = sent_txs . len ( ) ; verified += sent_txs_amount ; // Wait until all the transactions are verified. wait_for_verify ( sent_txs , self . verify_timeout , & self . rpc_client ) . await ? ; log :: info ! ( " " verified to_verify sent_txs_amount ) ; } log :: info ! ( " " ) ; Ok ( ( ) ) }
Transfers the money between intermediate accounts.
Transfers the money between intermediate accounts .
&mut self