Support command line arguments in sample_generator and fix spoil rate#162
Merged
keithrfung merged 2 commits intomainfrom Sep 4, 2020
Merged
Support command line arguments in sample_generator and fix spoil rate#162keithrfung merged 2 commits intomainfrom
keithrfung merged 2 commits intomainfrom
Conversation
Run `pipenv run ./src/electionguardtest/sample_generator.py --help` for more information. This also fixes a bug with spoiling the generated ballots. Because it was using a modulo operator when spoiling, only ~1% of the ballots would ever be spoiled, regardless of the desired amount.
AddressXception
previously approved these changes
Sep 4, 2020
keithrfung
approved these changes
Sep 4, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #161
Closes #160
Description
Adds arguments to the sample generator:
Optional arguments have also been added to the Makefile:
SAMPLE_BALLOT_COUNTandSAMPLE_BALLOT_SPOIL_RATE. There's no argument for--all-guardiansbecause we want to encourage decryption with a quorum.This also fixes a bug with spoiling the generated ballots.
Testing
sample_generator.pywith no arguments preserves the original behavior (5 ballots, 50% spoil rate, quorum # of guardians)-n,-s, and-areflect the correct behaviorChecklist
🚨Please review the guidelines for contributing to this repository.
💚Thank you!