Skip to content

Commit 3a6135a

Browse files
nazar-pcgodcodehunter
authored andcommitted
More efficient identity and multiplier weight to fee (paritytech#11226)
1 parent 5a52827 commit 3a6135a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

frame/support/src/weights.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ where
710710
degree: 1,
711711
})
712712
}
713+
714+
fn calc(weight: &Weight) -> Self::Balance {
715+
Self::Balance::saturated_from(*weight)
716+
}
713717
}
714718

715719
/// Implementor of [`WeightToFeePolynomial`] that uses a constant multiplier.
@@ -738,6 +742,10 @@ where
738742
degree: 1,
739743
})
740744
}
745+
746+
fn calc(weight: &Weight) -> Self::Balance {
747+
Self::Balance::saturated_from(*weight).saturating_mul(M::get())
748+
}
741749
}
742750

743751
/// A struct holding value for each `DispatchClass`.

0 commit comments

Comments
 (0)