Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type CensusParticipant struct {
// Vote is the struct to represent a vote in the system. It will be provided by
// the user to cast a vote in a process.
type Vote struct {
ProcessID *types.ProcessID `json:"processId"`
ProcessID types.ProcessID `json:"processId"`
CensusProof types.CensusProof `json:"censusProof"`
Ballot *elgamal.Ballot `json:"ballot"`
BallotProof *circomgnark.CircomProof `json:"ballotProof"`
Expand Down
10 changes: 5 additions & 5 deletions api/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (a *API) newVote(w http.ResponseWriter, r *http.Request) {
return
}
// get the process from the storage
process, err := a.storage.Process(*vote.ProcessID)
process, err := a.storage.Process(vote.ProcessID)
if err != nil {
ErrResourceNotFound.Withf("could not get process: %v", err).Write(w)
return
Expand All @@ -139,7 +139,7 @@ func (a *API) newVote(w http.ResponseWriter, r *http.Request) {
// the vote will be accepted, but it is a precondition to accept the vote,
// for example, if the process is not in this sequencer, the vote will be
// rejected
if ok, err := a.storage.ProcessIsAcceptingVotes(*vote.ProcessID); !ok {
if ok, err := a.storage.ProcessIsAcceptingVotes(vote.ProcessID); !ok {
if err != nil {
ErrProcessNotAcceptingVotes.WithErr(err).Write(w)
return
Expand All @@ -156,7 +156,7 @@ func (a *API) newVote(w http.ResponseWriter, r *http.Request) {
return
}
if !isOverwrite {
if maxVotersReached, err := a.storage.ProcessMaxVotersReached(*vote.ProcessID); err != nil {
if maxVotersReached, err := a.storage.ProcessMaxVotersReached(vote.ProcessID); err != nil {
ErrGenericInternalServerError.Withf("could not check max voters: %v", err).Write(w)
return
} else if maxVotersReached {
Expand Down Expand Up @@ -195,7 +195,7 @@ func (a *API) newVote(w http.ResponseWriter, r *http.Request) {
}
// calculate the ballot inputs hash
ballotInputsHash, err := ballotproof.BallotInputsHash(
*vote.ProcessID,
vote.ProcessID,
process.BallotMode,
new(bjj.BJJ).SetPoint(process.EncryptionKey.X.MathBigInt(), process.EncryptionKey.Y.MathBigInt()),
vote.Address,
Expand Down Expand Up @@ -240,7 +240,7 @@ func (a *API) newVote(w http.ResponseWriter, r *http.Request) {
}
// Create the ballot object
ballot := &storage.Ballot{
ProcessID: *vote.ProcessID,
ProcessID: vote.ProcessID,
VoterWeight: voterWeight.MathBigInt(),
// convert the ballot from TE (circom) to RTE (gnark)
EncryptedBallot: vote.Ballot.FromTEtoRTE(),
Expand Down
2 changes: 1 addition & 1 deletion cmd/e2e-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ func createVote(

// Return the vote ready to be sent to the sequencer
return api.Vote{
ProcessID: &wasmResult.ProcessID,
ProcessID: wasmResult.ProcessID,
Address: wasmInputs.Address,
Ballot: wasmResult.Ballot,
BallotProof: circomProof,
Expand Down
253 changes: 0 additions & 253 deletions tests/census_test.go

This file was deleted.

Loading