Skip to content

rpcserver: Decouple RPC agenda info status strings.#3071

Merged
davecgh merged 1 commit intodecred:masterfrom
davecgh:rpcserver_decouple_rpcserver_getvoteinfo_agendastatus
Mar 5, 2023
Merged

rpcserver: Decouple RPC agenda info status strings.#3071
davecgh merged 1 commit intodecred:masterfrom
davecgh:rpcserver_decouple_rpcserver_getvoteinfo_agendastatus

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented Mar 2, 2023

Similar to the case that previously existed for getblockchainfo, currently, the getvoteinfo RPC implementation directly returns the internal threshold state strings defined in blockchain. This is not ideal since it means that any changes to the internal implementation could inadvertently change the RPC results without being noticed.

Further, the blockchain package is now internal which means external callers don't have access to those constants.

Consequently, this makes the same change to getvoteinfo as was previously made to getblockchaininfo to decouple the agenda status strings by converting the internal blockchain threshold state to use the agenda status string constants defined in the rpc/jsonrpc/types module.

@davecgh davecgh added this to the 1.8.0 milestone Mar 2, 2023
Similar to the case that previously existed for getblockchainfo,
currently, the getvoteinfo RPC implementation directly returns the
internal threshold state strings defined in blockchain.  This is not
ideal since it means that any changes to the internal implementation
could inadvertently change the RPC results without being noticed.

Further, the blockchain package is now internal which means external
callers don't have access to those constants.

Consequently, this makes the same change to getvoteinfo as was
previously made to getblockchaininfo to decouple the agenda status
strings by converting the internal blockchain threshold state to use the
agenda status string constants defined in the rpc/jsonrpc/types module.
@davecgh davecgh force-pushed the rpcserver_decouple_rpcserver_getvoteinfo_agendastatus branch from e75364d to 83b7f16 Compare March 5, 2023 03:33
@davecgh davecgh merged commit 83b7f16 into decred:master Mar 5, 2023
@davecgh davecgh deleted the rpcserver_decouple_rpcserver_getvoteinfo_agendastatus branch March 5, 2023 03:41
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.

2 participants