Skip to content

Commit 7bcf4b9

Browse files
feat(tx-payment): move transaction payment pallets off our substrate fork
1 parent 69f1293 commit 7bcf4b9

File tree

32 files changed

+4159
-65
lines changed

32 files changed

+4159
-65
lines changed

code/Cargo.lock

Lines changed: 74 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/integration-tests/local-integration-tests/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ session = { package = "pallet-session", git = "https://github.com/paritytech/sub
5555
smallvec = "1.6.1"
5656
sudo = { package = "pallet-sudo", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
5757
timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
58-
transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
5958
treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
6059
utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
6160

@@ -72,11 +71,11 @@ liquidations = { package = "pallet-liquidations", path = "../../parachain/frame/
7271
oracle = { package = "pallet-oracle", path = "../../parachain/frame/oracle", default-features = false }
7372
primitives = { path = "../../parachain/runtime/primitives", default-features = false }
7473
vault = { package = "pallet-vault", path = "../../parachain/frame/vault", default-features = false }
75-
74+
transaction-payment = { package = "pallet-transaction-payment", path = "../../parachain/frame/transaction-payment", default-features = false }
7675

7776
# Used for the node template's RPCs
7877
system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
79-
transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.30" }
78+
transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", path = "../../parachain/frame/transaction-payment", default-features = false }
8079

8180
# Used for runtime benchmarking
8281
benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.30" }
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[package]
2+
name = "pallet-transaction-payment"
3+
version = "4.0.0-dev"
4+
authors = ["Parity Technologies <[email protected]>", "Composable Developers"]
5+
edition = "2021"
6+
license = "Apache-2.0"
7+
homepage = "https://substrate.io"
8+
repository = "https://github.com/paritytech/substrate/"
9+
description = "FRAME pallet to manage transaction payments"
10+
readme = "README.md"
11+
12+
[package.metadata.docs.rs]
13+
targets = ["x86_64-unknown-linux-gnu"]
14+
15+
[dependencies]
16+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
17+
"derive",
18+
] }
19+
scale-info = { default-features = false, version = "2.1.1", features = [
20+
"derive",
21+
] }
22+
serde = { version = "1.0.136", optional = true }
23+
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
24+
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
25+
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
26+
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
27+
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
28+
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
29+
30+
[dev-dependencies]
31+
serde_json = "1.0.85"
32+
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
33+
34+
[features]
35+
default = ["std"]
36+
std = [
37+
"codec/std",
38+
"frame-support/std",
39+
"frame-system/std",
40+
"scale-info/std",
41+
"serde",
42+
"sp-core/std",
43+
"sp-io/std",
44+
"sp-runtime/std",
45+
"sp-std/std",
46+
]
47+
try-runtime = ["frame-support/try-runtime"]
48+
49+
runtime-benchmarks = [
50+
"frame-support/runtime-benchmarks",
51+
"frame-system/runtime-benchmarks",
52+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Transaction Payment Pallet
2+
3+
This pallet provides the basic logic needed to pay the absolute minimum amount needed for a
4+
transaction to be included. This includes:
5+
- _weight fee_: A fee proportional to amount of weight a transaction consumes.
6+
- _length fee_: A fee proportional to the encoded length of the transaction.
7+
- _tip_: An optional tip. Tip increases the priority of the transaction, giving it a higher
8+
chance to be included by the transaction queue.
9+
10+
Additionally, this pallet allows one to configure:
11+
- The mapping between one unit of weight to one unit of fee via [`Config::WeightToFee`].
12+
- A means of updating the fee for the next block, via defining a multiplier, based on the
13+
final state of the chain at the end of the previous block. This can be configured via
14+
[`Config::FeeMultiplierUpdate`]
15+
16+
License: Apache-2.0

0 commit comments

Comments
 (0)