File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1- from electionguard .election import ElectionDescription
1+ from electionguard .election import ElectionDescription , ElectionConstants
22from fastapi import APIRouter , HTTPException
33from os .path import realpath , join
44from typing import Any
5+ from app .utils .serialize import write_json_object
56
67
78router = APIRouter ()
1112READ = "r"
1213
1314
15+ @router .get ("/constants" )
16+ def get_election_constants () -> Any :
17+ """
18+ Return the constants defined for an election
19+ """
20+ constants = ElectionConstants ()
21+ return write_json_object (constants )
22+
23+
1424@router .get ("/description" )
1525def get_default_election_description () -> Any :
1626 """
Original file line number Diff line number Diff line change 117117 }
118118 },
119119 "response": []
120+ },
121+ {
122+ "name": "Get Election Constants",
123+ "request": {
124+ "method": "GET",
125+ "header": [],
126+ "url": {
127+ "raw": "{{url}}/api/{{version}}/election/constants",
128+ "host": [
129+ "{{url}}"
130+ ],
131+ "path": [
132+ "api",
133+ "{{version}}",
134+ "election",
135+ "constants"
136+ ]
137+ }
138+ },
139+ "response": []
120140 }
121141 ],
122142 "protocolProfileBehavior": {}
You can’t perform that action at this time.
0 commit comments