* Moving `pallet-asset-tx-payment` from cumulus * move pallet-asset-tx-payment into transaction payment directory * cargo +nightly fmt * Adding `pallet-asset-tx-payment` to node runtime I had to change the Balance type to u128. Also harmonised that pallet's version * Updating cargo.lock after merge * forgot this * Adding tx-payment signature * Missed one more * `transaction-payment` replaced in`SignedExtension` by `asset-tx-payment` and not added * Fixing benches * add test to verify that we don't charge on post-dispatch if we didn't on pre-dispatch * add (failing) test for asset tx payment of unsigned extrinsics * fix test by removing debug_assert * cargo +nightly fmt * typo in `Cargo.lock` * Object defined twice in lock file * cargo update * remove todo * Apply formatting suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Refactoring `post_dispatch` of `asset-tx-payment` to reuse `post_dispatch` of `transaction-payment` if the fee asset is native Removing unneeded imports. * Removing redundant `TODO` * Reverting an accidental bump of `impl-serde` from `0.3.1` to `0.3.2` * Revert unneeded changes to `cargo.lock` * Update frame/transaction-payment/asset-tx-payment/src/payment.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Fixing cargo fmt Reverting changes which broke cargo fmt Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
942 B
pallet-asset-tx-payment
Asset Transaction Payment Pallet
This pallet allows runtimes that include it to pay for transactions in assets other than the native token of the chain.
Overview
It does this by extending transactions to include an optional AssetId that specifies the asset
to be used for payment (defaulting to the native token on None). It expects an
[OnChargeAssetTransaction] implementation analogously to [pallet-transaction-payment]. The
included [FungiblesAdapter] (implementing [OnChargeAssetTransaction]) determines the fee
amount by converting the fee calculated by [pallet-transaction-payment] into the desired
asset.
Integration
This pallet wraps FRAME's transaction payment pallet and functions as a replacement. This means
you should include both pallets in your construct_runtime macro, but only include this
pallet's [SignedExtension] ([ChargeAssetTxPayment]).
License: Apache-2.0