Introduce sensible weight constants (#12868)

* Introduce sensible weight constants

* cargo fmt

* Remove unused import

* Add missing import

* ".git/.scripts/bench-bot.sh" pallet dev pallet_lottery

Co-authored-by: command-bot <>
This commit is contained in:
Keith Yeung
2022-12-09 01:18:51 +09:00
committed by GitHub
parent 200f49d66d
commit 51db8c77a7
26 changed files with 140 additions and 113 deletions
+8 -5
View File
@@ -4365,9 +4365,10 @@ mod election_data_provider {
#[test]
fn targets_2sec_block() {
let mut validators = 1000;
while <Test as Config>::WeightInfo::get_npos_targets(validators)
.all_lt(2u64 * frame_support::weights::constants::WEIGHT_PER_SECOND)
{
while <Test as Config>::WeightInfo::get_npos_targets(validators).all_lt(Weight::from_parts(
2u64 * frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
u64::MAX,
)) {
validators += 1;
}
@@ -4384,8 +4385,10 @@ mod election_data_provider {
let mut nominators = 1000;
while <Test as Config>::WeightInfo::get_npos_voters(validators, nominators, slashing_spans)
.all_lt(2u64 * frame_support::weights::constants::WEIGHT_PER_SECOND)
{
.all_lt(Weight::from_parts(
2u64 * frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
u64::MAX,
)) {
nominators += 1;
}