fn transfer_from_to(
            &mut self,
            from: AccountId,
            to: AccountId,
            value: Balance,
        ) -> Result<()> {
            let from_balance = self.balance_of(from);
            if from_balance < value {
                return Err(Error::InsufficientBalance)
            }
            self.balances.insert(from, from_balance - value);
            let to_balance = self.balance_of(to);
            self.balances.insert(to, to_balance + value);
            self.env().emit_event(Transfer {
                from: Some(from),
                to: Some(to),
                value,
            });
            Ok(())
        }
/// Transfers `value` amount of tokens from the caller's account to account `to`.
///
/// On success a `Transfer` event is emitted.
///
/// # Errors
///
/// Returns `InsufficientBalance` error if there are not enough tokens on
/// the caller's account balance.
Transfers `value` amount of tokens from the caller's account to account `to`.
On success a `Transfer` event is emitted.
Transfers ` value ` amount of tokens from the caller ' s account to account ` to ` . On success a ` Transfer ` event is emitted .
fn transfer_from_to(
            &mut self,
            from: AccountId,
            to: AccountId,
            value: Balance,
        ) -> Result<()> {
            let from_balance = self.balance_of(from);
            if from_balance < value {
                return Err(Error::InsufficientBalance)
            }
            self.balances.insert(from, from_balance - value);
            let to_balance = self.balance_of(to);
            self.balances.insert(to, to_balance + value);
            self.env().emit_event(Transfer {
                from: Some(from),
                to: Some(to),
                value,
            });
            Ok(())
        }
fn transfer_from_to ( & mut self , from : AccountId , to : AccountId , value : Balance , ) -> Result < ( ) > { let from_balance = self . balance_of ( from ) ; if from_balance < value { return Err ( Error :: InsufficientBalance ) } self . balances . insert ( from , from_balance - value ) ; let to_balance = self . balance_of ( to ) ; self . balances . insert ( to , to_balance + value ) ; self . env ( ) . emit_event ( Transfer { from : Some ( from ) , to : Some ( to ) , value , } ) ; Ok ( ( ) ) }
Transfers `value` amount of tokens from the caller's account to account `to`.
Transfers ` value ` amount of tokens from the caller ' s account to account ` to ` .
&mut self
from
AccountId
to
AccountId
value
Balance
&mut self
from
AccountId
to
AccountId
value
Balance
errors
Returns `InsufficientBalance` error if there are not enough tokens on
the caller's account balance.
Returns ` InsufficientBalance ` error if there are not enough tokens on the caller ' s account balance .