mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 15:01:06 +00:00
srml-module: Phragmen election (#3364)
* phragmen election module. * Add new files. * Some doc update * Update weights. * bump and a few nits. * Performance improvement. * Master.into() * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Fix build * Some fixes. * Fix build. * Proper outgoing and runner-up managment. * Bit more sensical weight values. * Update srml/elections-phragmen/src/lib.rs * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * fix lock file * Fix build. * Remove runner-ups * Some refactors. * Add support for reporting voters. * Fix member check. * Remove equlize.rs * Update srml/elections-phragmen/src/lib.rs * Update srml/elections-phragmen/src/lib.rs * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Bring back runner ups. * use decode_len * Better weight values. * Update bogus doc * Bump. * Update srml/elections-phragmen/src/lib.rs Co-Authored-By: Gavin Wood <gavin@parity.io> * Review comments. * One more test * Fix tests * Fix build * .. and fix benchmarks. * Update srml/elections-phragmen/src/lib.rs * Version bump
This commit is contained in:
@@ -1241,7 +1241,7 @@ impl<T: Trait> Module<T> {
|
||||
);
|
||||
|
||||
if let Some(phragmen_result) = maybe_phragmen_result {
|
||||
let elected_stashes = phragmen_result.winners;
|
||||
let elected_stashes = phragmen_result.winners.iter().map(|(s, _)| s.clone()).collect::<Vec<T::AccountId>>();
|
||||
let mut assignments = phragmen_result.assignments;
|
||||
|
||||
// helper closure.
|
||||
@@ -1284,7 +1284,8 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
if cfg!(feature = "equalize") {
|
||||
#[cfg(feature = "equalize")]
|
||||
{
|
||||
let tolerance = 0_u128;
|
||||
let iterations = 2_usize;
|
||||
equalize::<_, _, _, T::CurrencyToVote>(
|
||||
|
||||
Reference in New Issue
Block a user