message: Subtract form main purse spending limit only if main purse is used.
diff: @@ -98,19 +98,22 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider {
  amount: U512,
  id: Option<u64>,
  ) -> Result<(), Error> {
  + // Indicates if main purse is used for token transfer.
  + let mut is_main_purse = false;
  match (self.get_phase(), self.get_immediate_caller()) {
  (Phase::Session, Some(&CallStackElement::StoredSession { .. })) => {
  // stored session code is not allowed to call this method in the session phase
  return Err(Error::InvalidContext);
  }
  (Phase::Session | Phase::Payment, Some(&CallStackElement::Session { .. })) => {
  - if self.get_main_purse().addr() == source.addr()
  - && amount > self.get_approved_cspr_limit()
  - {
  + if self.get_main_purse().addr() == source.addr() {
  + is_main_purse = true;
  + if amount > self.get_approved_cspr_limit() {
  // transferring more than user approved for is invalid.
  return Err(Error::UnapprovedSpendingAmount);
  }
  }
  + }
  _ => {}
  }
  @@ -132,7 +135,9 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider {
  }
  self.write_balance(source, source_balance - amount)?;
  self.add_balance(target, amount)?;
  + if is_main_purse {
  self.sub_approved_cspr_limit(amount);
  + }
  self.record_transfer(maybe_to, source, target, amount, id)?;
  Ok(())
  }
  