Sensible way of selecting Prime member (#5346)

* Calculate prime votes only during the election

* Migration

* Fix build, enable migration

* Fix tests

* Bump runtime version

* Update frame/elections-phragmen/src/lib.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
This commit is contained in:
Gavin Wood
2020-03-23 11:52:44 +01:00
committed by GitHub
parent 1da48b3b3f
commit 95d1d668c3
7 changed files with 135 additions and 79 deletions
+2 -3
View File
@@ -335,12 +335,11 @@ pub(crate) fn run_and_compare(
min_to_elect: usize,
) {
// run fixed point code.
let PhragmenResult { winners, assignments } = elect::<_, _, _, TestCurrencyToVote, Perbill>(
let PhragmenResult { winners, assignments } = elect::<_, _, TestCurrencyToVote, Perbill>(
to_elect,
min_to_elect,
candidates.clone(),
voters.clone(),
&stake_of,
voters.iter().map(|(ref v, ref vs)| (v.clone(), stake_of(v), vs.clone())).collect::<Vec<_>>(),
).unwrap();
// run float poc code.