mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Don't use fixed nominator count for report_equivocation weight calculation (#14471)
* babe: fix report_equivocation weight calculation * grandpa: fix report_equivocation weight calculation * beefy: fix report_equivocation weight calculation * runtime: add missing MaxNominators constant
This commit is contained in:
@@ -815,7 +815,7 @@ fn report_equivocation_has_valid_weight() {
|
||||
// the weight depends on the size of the validator set,
|
||||
// but there's a lower bound of 100 validators.
|
||||
assert!((1..=100)
|
||||
.map(<Test as Config>::WeightInfo::report_equivocation)
|
||||
.map(|validators| <Test as Config>::WeightInfo::report_equivocation(validators, 1000))
|
||||
.collect::<Vec<_>>()
|
||||
.windows(2)
|
||||
.all(|w| w[0] == w[1]));
|
||||
@@ -823,7 +823,7 @@ fn report_equivocation_has_valid_weight() {
|
||||
// after 100 validators the weight should keep increasing
|
||||
// with every extra validator.
|
||||
assert!((100..=1000)
|
||||
.map(<Test as Config>::WeightInfo::report_equivocation)
|
||||
.map(|validators| <Test as Config>::WeightInfo::report_equivocation(validators, 1000))
|
||||
.collect::<Vec<_>>()
|
||||
.windows(2)
|
||||
.all(|w| w[0].ref_time() < w[1].ref_time()));
|
||||
|
||||
Reference in New Issue
Block a user