Skip to content

Commit f51415c

Browse files
committed
Addresses review's comments
1 parent 1cf8649 commit f51415c

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

contracts/evoting/evoting.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/evoting/mod.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ const (
8181
// CmdCancelElection is the command to cancel an election
8282
CmdCancelElection Command = "CANCEL_ELECTION"
8383

84-
// CmdDelteElection is the command to delete an election
85-
CmdDelteElection Command = "DELETE_ELECTION"
84+
// CmdDeleteElection is the command to delete an election
85+
CmdDeleteElection Command = "DELETE_ELECTION"
8686
)
8787

8888
// NewCreds creates new credentials for a evoting contract execution. We might
@@ -205,7 +205,7 @@ func (c Contract) Execute(snap store.Snapshot, step execution.Step) error {
205205
if err != nil {
206206
return xerrors.Errorf("failed to cancel election: %v", err)
207207
}
208-
case CmdDelteElection:
208+
case CmdDeleteElection:
209209
err := c.cmd.deleteElection(snap, step)
210210
if err != nil {
211211
return xerrors.Errorf("failed to delete election: %v", err)

docs/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Return:
278278
| Input | |
279279
| Headers | {Authorization: <token>} |
280280

281-
The <token> value must be the hex-encoded signature on the hex-encoded
281+
The <token> value must be the hex-encoded signature of the hex-encoded
282282
electionID:
283283

284284
```

proxy/election.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func (h *election) DeleteElection(w http.ResponseWriter, r *http.Request) {
502502
return
503503
}
504504

505-
_, err = h.submitAndWaitForTxn(r.Context(), evoting.CmdDelteElection, evoting.ElectionArg, data)
505+
_, err = h.submitAndWaitForTxn(r.Context(), evoting.CmdDeleteElection, evoting.ElectionArg, data)
506506
if err != nil {
507507
http.Error(w, "failed to submit txn: "+err.Error(), http.StatusInternalServerError)
508508
return

web/frontend/src/language/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"add": "Add",
3939
"exportElecJSON": "Export as JSON",
4040
"delete": "Delete",
41+
"combine": "Combine shares",
4142
"createElec": "Create election",
4243
"clearElec": "Clear election",
4344
"upload": "Choose a json file from your computer:",
@@ -143,4 +144,4 @@
143144
"fr": "🇫🇷 French",
144145
"de": "🇩🇪 German"
145146
}
146-
}
147+
}

web/frontend/src/mocks/handlers.ts

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ export const handlers = [
158158
return res(ctx.status(200), ctx.text('Action successfully done'));
159159
}),
160160

161+
rest.delete(endpoints.editElection(':ElectionID'), async (req, res, ctx) => {
162+
const { ElectionID } = req.params;
163+
mockElections.delete(ElectionID as string);
164+
await new Promise((r) => setTimeout(r, 1000));
165+
166+
return res(ctx.status(200), ctx.text('Election deleted'));
167+
}),
168+
161169
rest.put(endpoints.editShuffle(':ElectionID'), async (req, res, ctx) => {
162170
const { ElectionID } = req.params;
163171
mockElections.set(ElectionID as string, {

0 commit comments

Comments
 (0)