fn process_coin_split<'a, I: Iterator<Item = &'a str>>(&mut self, mut args: I) {
        let amount_per_split = args.next().and_then(|v| v.parse::<u64>().ok());
        let split_count = args.next().and_then(|v| v.parse::<usize>().ok());
        if amount_per_split.is_none() | split_count.is_none() {
            println!("Command entered incorrectly, please use the following format: ");
            println!("coin-split [amount of tari to allocated to each UTXO] [number of UTXOs to create]");
            return;
        }
        let amount_per_split: MicroTari = amount_per_split.unwrap().into();
        let split_count = split_count.unwrap();

        // Use output manager service to get utxo and create the coin split transaction
        let mut output_manager = match self.wallet_output_service.clone() {
            Some(v) => v,
            _ => {
                println!("Error: Problem with OutputManagerHandle");
                return;
            },
        };
        let mut txn_service = match self.wallet_transaction_service.clone() {
            Some(v) => v,
            _ => {
                println!("Error: Problem with TransactionServiceHandle");
                return;
            },
        };
        self.executor.spawn(async move {
            coin_split(&mut output_manager, &mut txn_service, amount_per_split, split_count).await;
        });
    }
/// Function to process the coin split command
Function to process the coin split command
Function to process the coin split command
fn process_coin_split<'a, I: Iterator<Item = &'a str>>(&mut self, mut args: I) {
        let amount_per_split = args.next().and_then(|v| v.parse::<u64>().ok());
        let split_count = args.next().and_then(|v| v.parse::<usize>().ok());
        if amount_per_split.is_none() | split_count.is_none() {
            println!("Command entered incorrectly, please use the following format: ");
            println!("coin-split [amount of tari to allocated to each UTXO] [number of UTXOs to create]");
            return;
        }
        let amount_per_split: MicroTari = amount_per_split.unwrap().into();
        let split_count = split_count.unwrap();
        // Use output manager service to get utxo and create the coin split transaction
        let mut output_manager = match self.wallet_output_service.clone() {
            Some(v) => v,
            _ => {
                println!("Error: Problem with OutputManagerHandle");
                return;
            },
        };
        let mut txn_service = match self.wallet_transaction_service.clone() {
            Some(v) => v,
            _ => {
                println!("Error: Problem with TransactionServiceHandle");
                return;
            },
        };
        self.executor.spawn(async move {
            coin_split(&mut output_manager, &mut txn_service, amount_per_split, split_count).await;
        });
    }
fn process_coin_split < ' a , I : Iterator < Item = & ' a str > > ( & mut self , mut args : I ) { let amount_per_split = args . next ( ) . and_then ( | v | v . parse :: < u64 > ( ) . ok ( ) ) ; let split_count = args . next ( ) . and_then ( | v | v . parse :: < usize > ( ) . ok ( ) ) ; if amount_per_split . is_none ( ) | split_count . is_none ( ) { println ! ( " " ) ; println ! ( " " ) ; return ; } let amount_per_split : MicroTari = amount_per_split . unwrap ( ) . into ( ) ; let split_count = split_count . unwrap ( ) ; // Use output manager service to get utxo and create the coin split transaction let mut output_manager = match self . wallet_output_service . clone ( ) { Some ( v ) => v , _ => { println ! ( " " ) ; return ; } , } ; let mut txn_service = match self . wallet_transaction_service . clone ( ) { Some ( v ) => v , _ => { println ! ( " " ) ; return ; } , } ; self . executor . spawn ( async move { coin_split ( & mut output_manager , & mut txn_service , amount_per_split , split_count ) . await ; } ) ; }
Function to process the coin split command
Function to process the coin split command
&mut self
args
I
&mut self
args
I