Skip to content

Conversation

@asoltys
Copy link
Contributor

@asoltys asoltys commented Dec 30, 2019

This pull fixes the example curl command for getblockstats which doesn't work as is because it's missing a comma between the params and has single quotes around the second parameter.

It also adds an additional example of getting block stats by hash by using a known workaround (#15412) to get bitcoin-cli to treat the hash parameter as JSON instead of a string since there is ongoing deliberation about how or whether to fix the root issue (#15448).

@asoltys asoltys force-pushed the getblockstats-examples branch 3 times, most recently from 39b2bbc to 687818c Compare December 31, 2019 00:50
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a slight problem with superfluous quotation marks (probably happened with the usage of raw strings), see my code review comments plus change suggestions.
Apart from that, LGTM: tested that the new example of getting block stats by hash works fine (both for CLI and RPC) and that the fix approach for the curl example of getting block stats by height is right. 👍

@asoltys asoltys force-pushed the getblockstats-examples branch from 687818c to 9ea572e Compare April 17, 2020 06:02
@asoltys
Copy link
Contributor Author

asoltys commented Apr 17, 2020

I think this is ready for merging now. Requesting review @jonasschnelli @MarcoFalke

@asoltys asoltys force-pushed the getblockstats-examples branch from 9ea572e to 770c5cb Compare April 17, 2020 17:29
This fixes the example curl command for `getblockstats` which is missing
a comma between the params and has single quotes around the second
parameter.

Besides fixing the existing example, this commit adds an additional
example of getting block stats by hash by using a known workaround with
bitcoin-cli to get it to treat the hash parameter as a JSON string by
wrapping it in both single and double quotes.

Co-Authored-By: Andrew Toth <[email protected]>
Co-Authored-By: Sebastian Falbesoner <[email protected]>
@asoltys asoltys force-pushed the getblockstats-examples branch from 770c5cb to 7099984 Compare April 18, 2020 03:40
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7099984

@maflcko maflcko merged commit 5e5dd99 into bitcoin:master Apr 20, 2020
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 19, 2021
Summary:
> This fixes the example curl command for `getblockstats` which is missing
> a comma between the params and has single quotes around the second
> parameter.
>
> Besides fixing the existing example, this commit adds an additional
> example of getting block stats by hash by using a known workaround with
> bitcoin-cli to get it to treat the hash parameter as a JSON string by
> wrapping it in both single and double quotes.
>
> Co-Authored-By: Andrew Toth <[email protected]>
> Co-Authored-By: Sebastian Falbesoner <[email protected]>

This is a backport of Core [[bitcoin/bitcoin#17831 | PR17831]]

Test Plan:
`src/bitcoin-cli help getblockstats`

Then run the new example commands to make sure they work.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8952
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 28, 2021
7099984 rpc: doc: Fix and extend getblockstats examples (Adam Soltys)

Pull request description:

  This pull fixes the example curl command for `getblockstats` which doesn't work as is because it's missing a comma between the params and has single quotes around the second parameter.

  It also adds an additional example of getting block stats by hash by using a known workaround (bitcoin#15412) to get bitcoin-cli to treat the hash parameter as JSON instead of a string since there is ongoing deliberation about how or whether to fix the root issue (bitcoin#15448).

ACKs for top commit:
  theStack:
    ACK bitcoin@7099984

Tree-SHA512: 84a5b7f449f06fff785bc0afbc1a7dfd55454bc76c52a8945e91556f87f3edfdc5a1780faab8fcfd6c415b734295b7c67d2e04ba7b6cfa91a77758af5dda53ae
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants