Decouple Stkaing and Election - Part1: Support traits (#7908)

* Base features and traits.

* Fix the build

* Remove unused boxing

* Self review cleanup

* Fix build
This commit is contained in:
Kian Paimani
2021-01-18 10:24:12 +00:00
committed by GitHub
parent c58a2d9a74
commit ced107b355
23 changed files with 925 additions and 341 deletions
@@ -30,7 +30,7 @@ use sp_npos_elections::{ElectionResult, VoteWeight};
use std::collections::BTreeMap;
use sp_runtime::{Perbill, PerThing, traits::Zero};
use sp_npos_elections::{
balance_solution, assignment_ratio_to_staked, build_support_map, to_without_backing, VoteWeight,
balance_solution, assignment_ratio_to_staked, to_support_map, to_without_backing, VoteWeight,
ExtendedBalance, Assignment, StakedAssignment, IdentifierT, assignment_ratio_to_staked,
seq_phragmen,
};
@@ -149,7 +149,7 @@ fn do_phragmen(
if eq_iters > 0 {
let staked = assignment_ratio_to_staked(assignments, &stake_of);
let winners = to_without_backing(winners);
let mut support = build_support_map(
let mut support = to_support_map(
winners.as_ref(),
staked.as_ref(),
).unwrap();