Skip to content
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

ticketvote: Cast vote error format. #1557

Closed
lukebp opened this issue Oct 25, 2021 · 0 comments · Fixed by #1561
Closed

ticketvote: Cast vote error format. #1557

lukebp opened this issue Oct 25, 2021 · 0 comments · Fixed by #1561
Assignees
Labels
bug A bug that made it into a production enviroment.

Comments

@lukebp
Copy link
Member

lukebp commented Oct 25, 2021

The cast vote reply is defined as:

type CastVoteReply struct {
	Ticket  string `json:"ticket"`  // Ticket ID
	Receipt string `json:"receipt"` // Server signature of client signature

	// The follwing fields will only be present if an error occurred
	// while attempting to cast the vote.
	ErrorCode    VoteErrorT `json:"errorcode,omitempty"`
	ErrorContext string     `json:"errorcontext,omitempty"`
}

This means that the ErrorCode is 0 when the vote is cast succesfully and a 0 error code corresponds to VoteErrorInvalid. This is incorrect. The ErrorCode should be nil on success. The reply should contain a pointer to the error.

The error handling code in politeiavoter needs to be updated once this is fixed. The decrediton error handling should also be checked to see if it needs to be updated as well. This doesn't impact non-go clients because the fields are not included in the JSON.

This bug was introduced by #1180.

@lukebp lukebp added bug A bug that made it into a production enviroment. 91cfcc8 labels Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that made it into a production enviroment.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants