Changed map to filter map so that Phragmen ignores empty voters #7378
Conversation
@ksr30, Your signature has been received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has major flaws.
@kianenigma so what do we want to do? |
Waiting for @ksr30 to address the comment. Can take over it later myself as well. |
Hey @kianenigma , sorry for late reply ... I will work on this tomorrow |
Hey @kianenigma , I pushed required changes ... please have a look |
Hey @kianenigma , is everything fine with PR. I see few checks are failing ... but maybe its because of nightly version. Otherwise all tests are passing on my system. |
Hey @kianenigma ,sorry to disturb you again ... is everything good with PR or you want me to change anything? |
@ksr30 as a start, please merge master. |
Hey @bkchr .. sorry i didnt get |
Merge master into your branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a test case that actually tests the logic change of the PR.
@kianenigma @bkchr sorry for delay ... please have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I see, removing empty voters doesn't harm phragmms nor seq_phragmen
@@ -629,7 +629,7 @@ pub(crate) fn setup_inputs<AccountId: IdentifierT>( | |||
}) | |||
.collect::<Vec<CandidatePtr<AccountId>>>(); | |||
|
|||
let voters = initial_voters.into_iter().map(|(who, voter_stake, votes)| { | |||
let voters = initial_voters.into_iter().filter_map(|(who, voter_stake, votes)| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc of function could be changed to include this change.
Thanks @thiolliere |
@kianenigma @bkchr if PR is okay ... then can we merge it now 😅 |
@ksr30 can you merge master again ? so that CI is happy |
@ksr30 ping |
Sorry @kianenigma missed the notification ... I will merge master by tomorrow |
… issue-7172-phragmen
@kianenigma @thiolliere ... I think we can merge it now |
bot merge |
Trying merge. |
…tytech#7378) * Changed map to filter map so that Phragmen ignores empty voters * Resolve flaws and added test case * Updated test
Fixed #7172