Trait pallet_asset_tx_payment::OnChargeAssetTransaction[][src]

pub trait OnChargeAssetTransaction<T: Config> {
    type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + TypeInfo;
    type AssetId: FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo;
    type LiquidityInfo;
    fn withdraw_fee(
        who: &T::AccountId,
        call: &T::Call,
        dispatch_info: &DispatchInfoOf<T::Call>,
        asset_id: Self::AssetId,
        fee: Self::Balance,
        tip: Self::Balance
    ) -> Result<Self::LiquidityInfo, TransactionValidityError>;
fn correct_and_deposit_fee(
        who: &T::AccountId,
        dispatch_info: &DispatchInfoOf<T::Call>,
        post_info: &PostDispatchInfoOf<T::Call>,
        corrected_fee: Self::Balance,
        tip: Self::Balance,
        already_withdrawn: Self::LiquidityInfo
    ) -> Result<(), TransactionValidityError>; }
Expand description

Handle withdrawing, refunding and depositing of transaction fees.

Associated Types

The underlying integer type in which fees are calculated.

The type used to identify the assets used for transaction payment.

The type used to store the intermediate values between pre- and post-dispatch.

Required methods

Before the transaction is executed the payment of the transaction fees needs to be secured.

Note: The fee already includes the tip.

After the transaction was executed the actual fee can be calculated. This function should refund any overpaid fees and optionally deposit the corrected amount.

Note: The fee already includes the tip.

Implementors

Default implementation for a runtime instantiating this pallet, a balance to asset converter and a credit handler.