This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Moving pallet-asset-tx-payment from cumulus to substrate
#10127
Merged
paritytech-processbot
merged 34 commits into
paritytech:master
from
georgesdib:asset-tx-payment-from-cumulus
Nov 19, 2021
Merged
Changes from 11 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7eae0c6
Moving `pallet-asset-tx-payment` from cumulus
f8e7b6b
move pallet-asset-tx-payment into transaction payment directory
apopiak d22d83a
Merge branch 'master' of github.com:paritytech/substrate into asset-t…
apopiak 78bbed9
cargo +nightly fmt
apopiak 2791253
Adding `pallet-asset-tx-payment` to node runtime
2de2612
Merge branch 'master' into asset-tx-payment-from-cumulus
a90cbb6
Updating cargo.lock after merge
f19b1a2
Merge branch 'asset-tx-payment-from-cumulus' of https://github.com/ge…
02bf137
forgot this
74cbc9c
Adding tx-payment signature
8498007
Missed one more
1dd51da
`transaction-payment` replaced in`SignedExtension`
f325b32
Fixing benches
775bfde
add test to verify that we don't charge on post-dispatch if we didn't…
apopiak b83eb9e
add (failing) test for asset tx payment of unsigned extrinsics
apopiak ab19880
fix test by removing debug_assert
apopiak 30a022a
cargo +nightly fmt
apopiak a5ea79b
Merge branch 'master' into asset-tx-payment-from-cumulus
d4883ff
typo in `Cargo.lock`
7d43023
Merge branch 'master' into asset-tx-payment-from-cumulus
cdb34a2
Object defined twice in lock file
georgesdib 9498aa3
cargo update
2561622
Merge branch 'paritytech:master' into asset-tx-payment-from-cumulus
georgesdib e0b877c
remove todo
apopiak 119d560
Apply formatting suggestions from code review
apopiak 8f2770c
Refactoring `post_dispatch` of `asset-tx-payment`
2d4c777
Merge branch 'master' into asset-tx-payment-from-cumulus
2f36c4e
Merge branch 'master'
b622541
Removing redundant `TODO`
03fa69b
Reverting an accidental bump of `impl-serde`
6107177
Merge branch 'master' of upsteam
6b56ab1
Revert unneeded changes to `cargo.lock`
21d9cc3
Update frame/transaction-payment/asset-tx-payment/src/payment.rs
georgesdib 9d01c8c
Fixing cargo fmt
georgesdib File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| [package] | ||
| name = "pallet-asset-tx-payment" | ||
| version = "4.0.0-dev" | ||
| authors = ["Parity Technologies <[email protected]>"] | ||
| edition = "2018" | ||
| license = "Apache-2.0" | ||
| homepage = "https://substrate.io" | ||
| repository = "https://github.com/paritytech/substrate/" | ||
| description = "pallet to manage transaction payments in assets" | ||
| readme = "README.md" | ||
|
|
||
| [package.metadata.docs.rs] | ||
| targets = ["x86_64-unknown-linux-gnu"] | ||
|
|
||
| [dependencies] | ||
| # Substrate dependencies | ||
| sp-core = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/core" } | ||
| sp-io = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/io" } | ||
| sp-runtime = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/runtime" } | ||
| sp-std = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/std" } | ||
|
|
||
| frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" } | ||
| frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" } | ||
| pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = ".." } | ||
|
|
||
| # Other dependencies | ||
| codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } | ||
| scale-info = { version = "1.0", default-features = false, features = ["derive"] } | ||
| serde = { version = "1.0.126", optional = true } | ||
|
|
||
| [dev-dependencies] | ||
| smallvec = "1.7.0" | ||
| serde_json = "1.0.68" | ||
|
|
||
| sp-storage = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/storage" } | ||
|
|
||
| pallet-assets = { version = "4.0.0-dev", path = "../../assets" } | ||
| pallet-authorship = { version = "4.0.0-dev", path = "../../authorship" } | ||
| pallet-balances = { version = "4.0.0-dev", path = "../../balances" } | ||
|
|
||
|
|
||
| [features] | ||
| default = ["std"] | ||
| std = [ | ||
| "serde", | ||
| "codec/std", | ||
| "sp-std/std", | ||
| "sp-runtime/std", | ||
| "frame-support/std", | ||
| "frame-system/std", | ||
| "sp-io/std", | ||
| "sp-core/std", | ||
| "pallet-transaction-payment/std", | ||
| ] | ||
| try-runtime = ["frame-support/try-runtime"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.