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

rpcserver: Cleanup getvoteinfo RPC. #1964

Merged
merged 1 commit into from
Oct 26, 2019

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Oct 26, 2019

This makes the getvoteinfo RPC handling more consistent with the rest of the handlers and corrects the return error type for unrecognized vote versions.

Fixes #1953.

This makes the getvoteinfo RPC handling more consistent with the rest of
the handlers and corrects the return error type for unrecognized vote
versions.
@davecgh davecgh added this to the 1.6.0 milestone Oct 26, 2019
@davecgh davecgh merged commit e7acd36 into decred:master Oct 26, 2019
@davecgh davecgh deleted the rpcserver_cleanup_getvoteinfo branch October 26, 2019 02:04
@chappjc
Copy link
Member

chappjc commented Oct 26, 2019

Sorry I missed giving a review, but how about a rpc server version bump?

@davecgh
Copy link
Member Author

davecgh commented Oct 26, 2019

Do you really think it's necessary? The only thing that changed is it now returns the proper error code (invalid parameter) instead of an internal error. The actual behavior of the RPC is identical in that it either returns the same information when provided with a known version, or it returns an error when it's not.

I didn't really think that warranted a version bump, but if it causes issues, we can certainly do that.

@chappjc
Copy link
Member

chappjc commented Oct 26, 2019

Just because we're using a regexp here https://github.com/chappjc/dcrdata/blob/8ce7befd0af3d4f47a5d6c5c2675a9ba996f9595/gov/agendas/deployments.go#L124
and changing to a type assertion and code check is desirable. But we'd want to recognize if dcrd supports it.

@davecgh
Copy link
Member Author

davecgh commented Oct 27, 2019

Bumped in #1970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpcserver: The getvoteinfo RPC should return an invalid parameter error for unknown vote versions
3 participants