mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 02:48:03 +00:00
Generic Normalize impl for arithmetic and npos-elections (#6374)
* add normalize * better api for normalize * Some grumbles * Update primitives/arithmetic/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * More great review grumbles * Way better doc for everything. * Some improvement * Update primitives/arithmetic/src/lib.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This commit is contained in:
@@ -201,11 +201,8 @@ pub fn get_weak_solution<T: Trait>(
|
||||
};
|
||||
|
||||
// convert back to ratio assignment. This takes less space.
|
||||
let low_accuracy_assignment: Vec<Assignment<T::AccountId, OffchainAccuracy>> =
|
||||
staked_assignments
|
||||
.into_iter()
|
||||
.map(|sa| sa.into_assignment(true))
|
||||
.collect();
|
||||
let low_accuracy_assignment = assignment_staked_to_ratio_normalized(staked_assignments)
|
||||
.expect("Failed to normalize");
|
||||
|
||||
// re-calculate score based on what the chain will decode.
|
||||
let score = {
|
||||
|
||||
Reference in New Issue
Block a user