-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: vote endpoint #12
base: main
Are you sure you want to change the base?
Conversation
lucasmenendez
commented
Jan 7, 2025
- Common structs refactored
- Initial endpoint to include a vote in a sequencer
- Tests endpoints to replace smart contract functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor comments, please address them.
Also please run gofumpt -w .
ProcessesEndpoint = "/processes" | ||
// ProcessEndpoint is the endpoint to get the process info | ||
ProcessURLParam = "processId" | ||
ProcessEndpoint = "/processes/{" + ProcessURLParam + "}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd hardcode the full URL, I think it is OK and more readable.
Consider making all these constants private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it because in this way we can reference the param to get the data in its place ensuring that if it changes, the new value is propagated in every place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make them private, then they will not be accessible by other packages like api/client
...
ProcessID types.HexBytes `json:"processId"` | ||
Commitment types.HexBytes `json:"commitment"` | ||
Nullifier types.HexBytes `json:"nullifier"` | ||
Cipherfields elgamal.Ciphertexts `json:"cipherfields"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a pointer to the struct
Nullifier types.HexBytes `json:"nullifier"` | ||
Cipherfields elgamal.Ciphertexts `json:"cipherfields"` | ||
CensusProof types.CensusProof `json:"censusProof"` | ||
BallotProof parser.CircomProof `json:"ballotProof"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
CensusProof types.CensusProof `json:"censusProof"` | ||
BallotProof parser.CircomProof `json:"ballotProof"` | ||
BallotInputsHash types.HexBytes `json:"ballotInputsHash"` | ||
PublicKey types.HexBytes `json:"publicKey"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd not include PublicKey here, the Sequencer must take it from the State instead.
It is so far to be done that it is not yet ready for review. |
…roof verification key to verify the proof provided by the user, new comments