git.delta.rocks / unique-network / refs/commits / 571be545f6bb

difftreelog

fix use ConstFeeMultiplier

Daniel Shiposha2022-11-25parent: #7ac8b96.patch.diff
in: master

1 file changed

modifiedruntime/common/config/substrate.rsdiffbeforeafterboth
26use sp_runtime::{26use sp_runtime::{
27 generic,27 generic,
28 traits::{BlakeTwo256, AccountIdLookup},28 traits::{BlakeTwo256, AccountIdLookup},
29 Perquintill, Perbill, Permill, Percent,29 Perbill, Permill, Percent,
30};30};
31use sp_arithmetic::traits::{Zero, One};31use sp_arithmetic::traits::One;
32use frame_system::{32use frame_system::{
33 limits::{BlockLength, BlockWeights},33 limits::{BlockLength, BlockWeights},
34 EnsureRoot,34 EnsureRoot,
35};35};
36use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};36use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};
37use crate::{37use crate::{
38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,
39 System, Balances, Treasury, SS58Prefix, Version,39 System, Balances, Treasury, SS58Prefix, Version,
155 /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.155 /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.
156 pub const OperationalFeeMultiplier: u8 = 5;156 pub const OperationalFeeMultiplier: u8 = 5;
157157
158 pub const TargetBlockFullness: Perquintill = Perquintill::zero();158 pub FeeMultiplier: Multiplier = Multiplier::one();
159
160 pub AdjustmentVariable: Multiplier = Multiplier::zero();
161
162 pub MinimumMultiplier: Multiplier = Multiplier::one();
163}159}
164
165pub type ConstFeeMultiplier<R> =
166 TargetedFeeAdjustment<R, TargetBlockFullness, AdjustmentVariable, MinimumMultiplier>;
167160
168impl pallet_transaction_payment::Config for Runtime {161impl pallet_transaction_payment::Config for Runtime {
169 type RuntimeEvent = RuntimeEvent;162 type RuntimeEvent = RuntimeEvent;
170 type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;163 type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;
171 type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;164 type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
172 type OperationalFeeMultiplier = OperationalFeeMultiplier;165 type OperationalFeeMultiplier = OperationalFeeMultiplier;
173 type WeightToFee = pallet_configuration::WeightToFee<Self, Balance>;166 type WeightToFee = pallet_configuration::WeightToFee<Self, Balance>;
174 type FeeMultiplierUpdate = ConstFeeMultiplier<Self>;167 type FeeMultiplierUpdate = ConstFeeMultiplier<FeeMultiplier>;
175}168}
176169
177parameter_types! {170parameter_types! {