Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Including runners-up in check for defunct phragmen voter. #4349

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

jnaviask
Copy link
Contributor

@jnaviask jnaviask commented Dec 10, 2019

The is_defunct_voter function is intended to check whether all of a given voter's selections are invalid. A selection is valid if it is a candidate in the next round, i.e. if it is a current member or runner-up (and thus automatically added as candidates), or on the candidates list.

However, the function as implemented did not check for runners-up. This PR adds this check to fix the bug, which would have permitted incorrect reports of defunct voters if they only voted for current runners-up. This PR also expands the can_detect_defunct_voter test case to catch the bug.

@parity-cla-bot
Copy link

It looks like @jnaviask signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@gavofyork gavofyork merged commit 545c1e9 into paritytech:master Dec 11, 2019
@gavofyork
Copy link
Member

CC @kianenigma

@kianenigma
Copy link
Contributor

Thanks @jnaviask! +1

@jnaviask jnaviask deleted the jnaviask.defunct-fix branch December 12, 2019 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants