Companion for #9834 (Transaction Priority) (#3901)

* Add new associated type.

* Update fee multiplier.

* Bump Substrate
This commit is contained in:
Tomasz Drwięga
2021-10-04 20:13:35 +02:00
committed by GitHub
parent 6226737f5c
commit 9dfef89bab
6 changed files with 181 additions and 161 deletions
+161 -161
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -276,11 +276,15 @@ impl pallet_balances::Config for Runtime {
parameter_types! { parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS; pub const TransactionByteFee: Balance = 10 * MILLICENTS;
/// This value increases the priority of `Operational` transactions by adding
/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
pub const OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Self>>; type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Self>>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee; type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
} }
+4
View File
@@ -302,11 +302,15 @@ impl pallet_balances::Config for Runtime {
parameter_types! { parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS; pub const TransactionByteFee: Balance = 10 * MILLICENTS;
/// This value increases the priority of `Operational` transactions by adding
/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
pub const OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Runtime>>; type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee; type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
} }
+4
View File
@@ -452,11 +452,15 @@ impl pallet_timestamp::Config for Runtime {
parameter_types! { parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS; pub const TransactionByteFee: Balance = 10 * MILLICENTS;
/// This value increases the priority of `Operational` transactions by adding
/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
pub const OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>; type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee; type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
} }
+4
View File
@@ -223,11 +223,15 @@ impl pallet_balances::Config for Runtime {
parameter_types! { parameter_types! {
pub storage TransactionByteFee: Balance = 10 * MILLICENTS; pub storage TransactionByteFee: Balance = 10 * MILLICENTS;
/// This value increases the priority of `Operational` transactions by adding
/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
pub const OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ()>; type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee; type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
} }
+4
View File
@@ -262,11 +262,15 @@ impl pallet_balances::Config for Runtime {
parameter_types! { parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS; pub const TransactionByteFee: Balance = 10 * MILLICENTS;
/// This value increases the priority of `Operational` transactions by adding
/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
pub const OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>; type OnChargeTransaction = CurrencyAdapter<Balances, ToAuthor<Runtime>>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = WeightToFee; type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
} }