mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 02:51:08 +00:00
Better Parameterisation for Fee system (#3823)
* Better fee parameters * Fix build * Better runtime tests * Price to Weight ratio as type parameter (#3856) * Price to Weight ration as type parameter * Kian feedback * Some renames. * Fix executor tests * Getting Closer. * Phantom Data * Actually fix executor tests. * Fix tests. * Remove todo * Fix build
This commit is contained in:
@@ -70,8 +70,7 @@ pub trait Trait: system::Trait {
|
||||
type WeightToFee: Convert<Weight, BalanceOf<Self>>;
|
||||
|
||||
/// Update the multiplier of the next block, based on the previous block's weight.
|
||||
// TODO: maybe this does not need previous weight and can just read it
|
||||
type FeeMultiplierUpdate: Convert<(Weight, Multiplier), Multiplier>;
|
||||
type FeeMultiplierUpdate: Convert<Multiplier, Multiplier>;
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
@@ -89,9 +88,8 @@ decl_module! {
|
||||
const TransactionByteFee: BalanceOf<T> = T::TransactionByteFee::get();
|
||||
|
||||
fn on_finalize() {
|
||||
let current_weight = <system::Module<T>>::all_extrinsics_weight();
|
||||
NextFeeMultiplier::mutate(|fm| {
|
||||
*fm = T::FeeMultiplierUpdate::convert((current_weight, *fm))
|
||||
*fm = T::FeeMultiplierUpdate::convert(*fm)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user