This repository was archived by the owner on Jun 7, 2024. It is now read-only.
File tree 3 files changed +7
-26
lines changed
src/electionguard_cli/cli_models
3 files changed +7
-26
lines changed Original file line number Diff line number Diff line change
1
+ from dataclasses import dataclass
1
2
from typing import Dict
2
3
from electionguard .tally import CiphertextTally , PlaintextTally
3
4
from electionguard .type import BallotId
4
5
from electionguard .election_polynomial import LagrangeCoefficientsRecord
5
6
6
7
8
+ @dataclass
7
9
class CliDecryptResults :
8
10
"""Responsible for holding the results of decrypting an election."""
9
11
10
- def __init__ (
11
- self ,
12
- plaintext_tally : PlaintextTally ,
13
- plaintext_spoiled_ballots : Dict [BallotId , PlaintextTally ],
14
- ciphertext_tally : CiphertextTally ,
15
- lagrange_coefficients : LagrangeCoefficientsRecord ,
16
- ):
17
- self .plaintext_tally = plaintext_tally
18
- self .plaintext_spoiled_ballots = plaintext_spoiled_ballots
19
- self .ciphertext_tally = ciphertext_tally
20
- self .lagrange_coefficients = lagrange_coefficients
21
-
22
12
plaintext_tally : PlaintextTally
23
13
plaintext_spoiled_ballots : Dict [BallotId , PlaintextTally ]
24
14
ciphertext_tally : CiphertextTally
Original file line number Diff line number Diff line change
1
+ from dataclasses import dataclass
2
+
1
3
from electionguard .election import CiphertextElectionContext
2
4
from electionguard .manifest import InternalManifest
3
5
4
6
7
+ @dataclass
5
8
class BuildElectionResults :
6
9
"""The results of building an election, more specifically an internal manifest and context."""
7
10
8
- def __init__ (
9
- self , internal_manifest : InternalManifest , context : CiphertextElectionContext
10
- ):
11
- self .internal_manifest = internal_manifest
12
- self .context = context
13
-
14
11
internal_manifest : InternalManifest
15
12
context : CiphertextElectionContext
Original file line number Diff line number Diff line change
1
+ from dataclasses import dataclass
1
2
from typing import List
2
3
from electionguard .ballot import CiphertextBallot
3
4
from electionguard .encrypt import EncryptionDevice
4
5
5
6
7
+ @dataclass
6
8
class EncryptResults :
7
9
"""Responsible for holding the results of encrypting votes in an election."""
8
10
9
- def __init__ (
10
- self ,
11
- device : EncryptionDevice ,
12
- ciphertext_ballots : List [CiphertextBallot ],
13
- ):
14
- self .device = device
15
- self .ciphertext_ballots = ciphertext_ballots
16
-
17
11
device : EncryptionDevice
18
12
ciphertext_ballots : List [CiphertextBallot ]
You can’t perform that action at this time.
0 commit comments