pub fn transfer_coins_int(
        &mut self,
        sender_account_ref_id: usize,
        receiver_address: &AccountAddress,
        num_coins: u64,
        gas_unit_price: Option<u64>,
        max_gas_amount: Option<u64>,
        is_blocking: bool,
    ) -> Result<IndexAndSequence> {
        let sender_address;
        let sender_sequence;
        {
            let sender = self.accounts.get(sender_account_ref_id).ok_or_else(|| {
                format_err!("Unable to find sender account: {}", sender_account_ref_id)
            })?;

            let program = vm_genesis::encode_transfer_program(&receiver_address, num_coins);
            let req = self.create_submit_transaction_req(
                program,
                sender,
                max_gas_amount, /* max_gas_amount */
                gas_unit_price, /* gas_unit_price */
            )?;
            let sender_mut = self
                .accounts
                .get_mut(sender_account_ref_id)
                .ok_or_else(|| {
                    format_err!("Unable to find sender account: {}", sender_account_ref_id)
                })?;
            self.client.submit_transaction(Some(sender_mut), &req)?;
            sender_address = sender_mut.address;
            sender_sequence = sender_mut.sequence_number;
        }

        if is_blocking {
            self.wait_for_transaction(sender_address, sender_sequence);
        }

        Ok(IndexAndSequence {
            account_index: AccountEntry::Index(sender_account_ref_id),
            sequence_number: sender_sequence - 1,
        })
    }
/// Transfer num_coins from sender account to receiver. If is_blocking = true,
/// it will keep querying validator till the sequence number is bumped up in validator.
Transfer num_coins from sender account to receiver. If is_blocking = true,
it will keep querying validator till the sequence number is bumped up in validator.
Transfer num_coins from sender account to receiver . If is_blocking = true it will keep querying validator till the sequence number is bumped up in validator .
pub fn transfer_coins_int(
        &mut self,
        sender_account_ref_id: usize,
        receiver_address: &AccountAddress,
        num_coins: u64,
        gas_unit_price: Option<u64>,
        max_gas_amount: Option<u64>,
        is_blocking: bool,
    ) -> Result<IndexAndSequence> {
        let sender_address;
        let sender_sequence;
        {
            let sender = self.accounts.get(sender_account_ref_id).ok_or_else(|| {
                format_err!("Unable to find sender account: {}", sender_account_ref_id)
            })?;
            let program = vm_genesis::encode_transfer_program(&receiver_address, num_coins);
            let req = self.create_submit_transaction_req(
                program,
                sender,
                max_gas_amount, /* max_gas_amount */
                gas_unit_price, /* gas_unit_price */
            )?;
            let sender_mut = self
                .accounts
                .get_mut(sender_account_ref_id)
                .ok_or_else(|| {
                    format_err!("Unable to find sender account: {}", sender_account_ref_id)
                })?;
            self.client.submit_transaction(Some(sender_mut), &req)?;
            sender_address = sender_mut.address;
            sender_sequence = sender_mut.sequence_number;
        }
        if is_blocking {
            self.wait_for_transaction(sender_address, sender_sequence);
        }
        Ok(IndexAndSequence {
            account_index: AccountEntry::Index(sender_account_ref_id),
            sequence_number: sender_sequence - 1,
        })
    }
pub fn transfer_coins_int ( & mut self , sender_account_ref_id : usize , receiver_address : & AccountAddress , num_coins : u64 , gas_unit_price : Option < u64 > , max_gas_amount : Option < u64 > , is_blocking : bool , ) -> Result < IndexAndSequence > { let sender_address ; let sender_sequence ; { let sender = self . accounts . get ( sender_account_ref_id ) . ok_or_else ( | | { format_err ! ( " " sender_account_ref_id ) } ) ? ; let program = vm_genesis :: encode_transfer_program ( & receiver_address , num_coins ) ; let req = self . create_submit_transaction_req ( program , sender , max_gas_amount , /* max_gas_amount */ gas_unit_price , /* gas_unit_price */ ) ? ; let sender_mut = self . accounts . get_mut ( sender_account_ref_id ) . ok_or_else ( | | { format_err ! ( " " sender_account_ref_id ) } ) ? ; self . client . submit_transaction ( Some ( sender_mut ) , & req ) ? ; sender_address = sender_mut . address ; sender_sequence = sender_mut . sequence_number ; } if is_blocking { self . wait_for_transaction ( sender_address , sender_sequence ) ; } Ok ( IndexAndSequence { account_index : AccountEntry :: Index ( sender_account_ref_id ) , sequence_number : sender_sequence - 1 , } ) }
Transfer num_coins from sender account to receiver.
Transfer num_coins from sender account to receiver .
&mut self
sender_account_ref_id
usize
receiver_address
&AccountAddress
num_coins
u64
gas_unit_price
Option<u64>
max_gas_amount
Option<u64>
is_blocking
bool