fn withdraw_fee(
		who: &T::AccountId,
		_call: &T::Call,
		_info: &DispatchInfoOf<T::Call>,
		fee: Self::Balance,
		tip: Self::Balance,
	) -> Result<Self::LiquidityInfo, TransactionValidityError> {
		if fee.is_zero() {
			return Ok(None);
		}

		let withdraw_reason = if tip.is_zero() {
			WithdrawReasons::TRANSACTION_PAYMENT
		} else {
			WithdrawReasons::TRANSACTION_PAYMENT | WithdrawReasons::TIP
		};

		if SW::swap_currency(&who, fee.into()).is_err() {
			return Err(InvalidTransaction::Payment.into());
		}

		match C::withdraw(who, fee, withdraw_reason, ExistenceRequirement::KeepAlive) {
			Ok(imbalance) => Ok(Some(imbalance)),
			Err(_) => Err(InvalidTransaction::Payment.into()),
		}
	}
/// Withdraw the predicted fee from the transaction origin.
///
/// Note: The `fee` already includes the `tip`.
Withdraw the predicted fee from the transaction origin.
Note: The `fee` already includes the `tip`.
Withdraw the predicted fee from the transaction origin . Note : The ` fee ` already includes the ` tip ` .
fn withdraw_fee(
		who: &T::AccountId,
		_call: &T::Call,
		_info: &DispatchInfoOf<T::Call>,
		fee: Self::Balance,
		tip: Self::Balance,
	) -> Result<Self::LiquidityInfo, TransactionValidityError> {
		if fee.is_zero() {
			return Ok(None);
		}
		let withdraw_reason = if tip.is_zero() {
			WithdrawReasons::TRANSACTION_PAYMENT
		} else {
			WithdrawReasons::TRANSACTION_PAYMENT | WithdrawReasons::TIP
		};
		if SW::swap_currency(&who, fee.into()).is_err() {
			return Err(InvalidTransaction::Payment.into());
		}
		match C::withdraw(who, fee, withdraw_reason, ExistenceRequirement::KeepAlive) {
			Ok(imbalance) => Ok(Some(imbalance)),
			Err(_) => Err(InvalidTransaction::Payment.into()),
		}
	}
fn withdraw_fee ( who : & T :: AccountId , _call : & T :: Call , _info : & DispatchInfoOf < T :: Call > , fee : Self :: Balance , tip : Self :: Balance , ) -> Result < Self :: LiquidityInfo , TransactionValidityError > { if fee . is_zero ( ) { return Ok ( None ) ; } let withdraw_reason = if tip . is_zero ( ) { WithdrawReasons :: TRANSACTION_PAYMENT } else { WithdrawReasons :: TRANSACTION_PAYMENT | WithdrawReasons :: TIP } ; if SW :: swap_currency ( & who , fee . into ( ) ) . is_err ( ) { return Err ( InvalidTransaction :: Payment . into ( ) ) ; } match C :: withdraw ( who , fee , withdraw_reason , ExistenceRequirement :: KeepAlive ) { Ok ( imbalance ) => Ok ( Some ( imbalance ) ) , Err ( _ ) => Err ( InvalidTransaction :: Payment . into ( ) ) , } }
Withdraw the predicted fee from the transaction origin.
Withdraw the predicted fee from the transaction origin .
who
&T::AccountId
_call
&T::Call
_info
&DispatchInfoOf<T::Call>
fee
Self::Balance
tip
Self::Balance