Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Clean up the asset-tx-payment Pallet #657

Merged
merged 3 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pallets/asset-tx-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"]
# Substrate dependencies
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand All @@ -32,6 +30,9 @@ serde = { version = "1.0.101", optional = true }
[dev-dependencies]
smallvec = "1.4.1"
serde_json = "1.0.41"

pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" }

Expand Down
21 changes: 21 additions & 0 deletions pallets/asset-tx-payment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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