Keep BlockWeight in Storage (#6046)

* keep block weight in storage

* Update lib.rs

* rename to `BlockWeight`, update tests

* remove println

* make test better

* keep extrinsics length clean
This commit is contained in:
Shawn Tabrizi
2020-05-21 16:13:13 +02:00
committed by GitHub
parent ac049a97be
commit 6ae0de5700
3 changed files with 62 additions and 41 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ pub struct TargetedFeeAdjustment<T>(sp_std::marker::PhantomData<T>);
impl<T: Get<Perquintill>> Convert<Fixed128, Fixed128> for TargetedFeeAdjustment<T> {
fn convert(multiplier: Fixed128) -> Fixed128 {
let max_weight = MaximumBlockWeight::get();
let block_weight = System::all_extrinsics_weight().total().min(max_weight);
let block_weight = System::block_weight().total().min(max_weight);
let target_weight = (T::get() * max_weight) as u128;
let block_weight = block_weight as u128;