Companion for paritytech/substrate#12183 (#5971)

* Companion for paritytech/substrate#12183

* Fixes

* Fixes

* Fixes

* cargo fmt

* Fixes

* Fixes

* Fixes

* cargo fmt

* Update runtime/parachains/src/paras_inherent/mod.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Keith Yeung
2022-09-08 13:05:03 +08:00
committed by GitHub
parent c594a0ca51
commit ef3b001b4e
30 changed files with 327 additions and 279 deletions
+5 -7
View File
@@ -30,7 +30,7 @@ fn remove_keys_weight_is_sensible() {
use runtime_common::crowdloan::WeightInfo;
let max_weight = <Runtime as crowdloan::Config>::WeightInfo::refund(RemoveKeysLimit::get());
// Max remove keys limit should be no more than half the total block weight.
assert!(max_weight * 2 < BlockWeights::get().max_block);
assert!((max_weight * 2).all_lt(BlockWeights::get().max_block));
}
#[test]
@@ -40,11 +40,9 @@ fn sample_size_is_sensible() {
let samples: BlockNumber = EndingPeriod::get() / SampleLength::get();
let max_weight: Weight = RocksDbWeight::get().reads_writes(samples.into(), samples.into());
// Max sample cleanup should be no more than half the total block weight.
assert!(max_weight * 2 < BlockWeights::get().max_block);
assert!(
<Runtime as auctions::Config>::WeightInfo::on_initialize() * 2 <
BlockWeights::get().max_block
);
assert!((max_weight * 2).all_lt(BlockWeights::get().max_block));
assert!((<Runtime as auctions::Config>::WeightInfo::on_initialize() * 2)
.all_lt(BlockWeights::get().max_block));
}
#[test]
@@ -132,7 +130,7 @@ fn nominator_limit() {
};
let mut active = 1;
while weight_with(active) <= OffchainSolutionWeightLimit::get() || active == all_voters {
while weight_with(active).all_lte(OffchainSolutionWeightLimit::get()) || active == all_voters {
active += 1;
}