Commit 28fc6626 authored by Stephane Glondu's avatar Stephane Glondu

verify-diff: consider there are no ballots when ballots.jsons is missing

parent 16ed5697
Pipeline #56002 passed with stages
in 13 minutes and 59 seconds
......@@ -59,7 +59,6 @@ type verifydiff_error =
| MissingCredentials
| InvalidCredential
| CredentialsMismatch
| MissingBallots
| InvalidBallot
| DuplicateBallot
| BallotSignedByInvalidKey
......@@ -79,7 +78,6 @@ let explain_error = function
| MissingCredentials -> "missing credentials"
| InvalidCredential -> "invalid credential"
| CredentialsMismatch -> "credentials mismatch"
| MissingBallots -> "missing ballots"
| InvalidBallot -> "invalid ballot"
| DuplicateBallot -> "duplicate ballot"
| BallotSignedByInvalidKey -> "ballot signed by invalid key"
......@@ -170,7 +168,7 @@ let verifydiff dir1 dir2 =
let module GMap = Map.Make (G) in
let ballots dir =
match load_from_file (ballot_of_string G.read) (dir / "ballots.jsons") with
| None -> raise (VerifydiffError MissingBallots)
| None -> GMap.empty
| Some ballots ->
if not (List.for_all E.check_ballot ballots) then
raise (VerifydiffError InvalidBallot);
......
......@@ -30,7 +30,6 @@ type verifydiff_error =
| MissingCredentials
| InvalidCredential
| CredentialsMismatch
| MissingBallots
| InvalidBallot
| DuplicateBallot
| BallotSignedByInvalidKey
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment