mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 13:01:01 +00:00
Fix offchain election to respect the weight (#7215)
* Mockup * Fix offchain election to respect the weight * Fix builds a bit * Update frame/staking/src/offchain_election.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/staking/src/offchain_election.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Make it build, binary search * Fix a number of grumbles * one more fix. * remove unwrap. * better alg. * Better alg again. * Final fixes * Fix * Rollback to normal * Final touches. * Better tests. * Update frame/staking/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Proper maxExtWeight * Final fix * Final fix for the find_voter Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -522,7 +522,7 @@ benchmarks! {
|
||||
compact,
|
||||
score,
|
||||
size
|
||||
) = offchain_election::prepare_submission::<T>(assignments, winners, false).unwrap();
|
||||
) = offchain_election::prepare_submission::<T>(assignments, winners, false, T::MaximumBlockWeight::get()).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
winners.len(), compact.unique_targets().len(),
|
||||
@@ -590,7 +590,7 @@ benchmarks! {
|
||||
compact,
|
||||
score,
|
||||
size
|
||||
) = offchain_election::prepare_submission::<T>(assignments, winners, false).unwrap();
|
||||
) = offchain_election::prepare_submission::<T>(assignments, winners, false, T::MaximumBlockWeight::get()).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
winners.len(), compact.unique_targets().len(),
|
||||
|
||||
Reference in New Issue
Block a user