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
getmininginfo returns a poorly-formatted JSON response in v2. #225
Comments
jowenshaw
pushed a commit
to jowenshaw/metaverse
that referenced
this issue
Jan 11, 2018
For compatibility reasons with v1, we won't change this soon. There exists many of the same situations of the response result. It may be re-designed later. |
Why is the fact that a v2 request returns this because a v2 response would not be read by languages such as golang if it was written v1 in mind. |
The api should differentiate between v1 and v2 and return a different result. |
NotoriousPyro
changed the title
getmininginfo returns a poor JSON-formatted response in v2.
getmininginfo returns a poorly-formatted JSON response in v2.
Jan 23, 2018
This was referenced Jan 23, 2018
Fixed in APIv3 getmininginfo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In v1 API, the response was fine but could have been renamed from "mining-info" to "result":
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getmininginfo","params":[],"id":1}' http://127.0.0.1:8820/rpc
Now, in v2 this is a sub-object of "result" and causes headaches, is obtuse (as we already know we are asking for mining info) when trying to Unmarshal JSON:
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getmininginfo","params":[],"id":1}' http://127.0.0.1:8820/rpc/v2
Instead, the following should preferentially be returned:
The text was updated successfully, but these errors were encountered: