Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix nits
  • Loading branch information
Szegoo committed Oct 6, 2022
commit 3517f139cca2cf2c85a6ecab0d9d3550cdd002a5
4 changes: 2 additions & 2 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl pallet_balances::Config for Runtime {
}

parameter_types! {
pub FeeMultiplierMin: Multiplier = Multiplier::one();
pub FeeMultiplier: Multiplier = Multiplier::one();
}

impl pallet_transaction_payment::Config for Runtime {
Expand All @@ -262,7 +262,7 @@ impl pallet_transaction_payment::Config for Runtime {
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<Balance>;
type LengthToFee = IdentityFee<Balance>;
type FeeMultiplierUpdate = ConstFeeMultiplier<FeeMultiplierMin>;
type FeeMultiplierUpdate = ConstFeeMultiplier<FeeMultiplier>;
}

impl pallet_sudo::Config for Runtime {
Expand Down
6 changes: 3 additions & 3 deletions frame/transaction-payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ pub struct TargetedFeeAdjustment<T, S, V, M, X>(sp_std::marker::PhantomData<(T,

/// Something that can convert the current multiplier to the next one.
pub trait MultiplierUpdate: Convert<Multiplier, Multiplier> {
/// Minimum multiplier. Any outcome of the `convert` function should be more than this.
/// Minimum multiplier. Any outcome of the `convert` function should be at least this.
fn min() -> Multiplier;
/// Maximum multiplier. Any outcome of the `convert` function should be less than this.
/// Maximum multiplier. Any outcome of the `convert` function should be less or equal this.
fn max() -> Multiplier;
/// Target block saturation level
fn target() -> Perquintill;
Expand Down Expand Up @@ -232,7 +232,7 @@ where
} else {
// Defensive-only: first_term > second_term. Safe subtraction.
let negative = first_term.saturating_sub(second_term).saturating_mul(previous);
previous.saturating_sub(negative).max(min_multiplier)
previous.saturating_sub(negative).max(min_multiplier).min(max_multiplier)
}
}
}
Expand Down