From 4e8813739981c59c9dc7ba76e2522facdabbda0f Mon Sep 17 00:00:00 2001 From: cmsigrist <capucine.berger@epfl.ch> Date: Tue, 21 Jun 2022 11:39:41 +0200 Subject: [PATCH] Use the decoded ID of questions in to unmarshal ballot --- contracts/evoting/types/ballots.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/evoting/types/ballots.go b/contracts/evoting/types/ballots.go index 0d6f87f2a..8b65787d5 100644 --- a/contracts/evoting/types/ballots.go +++ b/contracts/evoting/types/ballots.go @@ -68,11 +68,10 @@ func (b *Ballot) Unmarshal(marshalledBallot string, election Election) error { return xerrors.Errorf("a line in the ballot has length != 3: %s", line) } - _, err := base64.StdEncoding.DecodeString(question[1]) + questionID, err := base64.StdEncoding.DecodeString(question[1]) if err != nil { return xerrors.Errorf("could not decode question ID: %v", err) } - questionID := question[1] q := election.Configuration.GetQuestion(ID(questionID))