rpc: fix broken RPCExamples for waitforblock(height) #18398

pull theStack wants to merge 1 commits into bitcoin:master from theStack:20200321-rpc-fix-broken-rpcexamples-for-waitforblock-height changing 1 files +3 −3
  1. theStack commented at 3:02 PM on March 21, 2020: contributor

    This PR fixes several broken RPCExamples from the "blockchain" category:

    • HelpExampleCli for waitforblock (disturbing comma between arguments)
    • HelpExampleCli for waitforblockheight (disturbing comma between arguments)
    • HelpExampleRpc for waitforblockheight (disturbing quotation marks around integer argument)

    Note that the CLI example for waitforblockheight would also work with the first argument in quotation marks (in contrast to the RPC example), but I removed them as well as they are not needed.

    Outputs for the non-working examples in the master branch:

    $ ./bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862", 1000
    error code: -8
    error message:
    blockhash must be of length 64 (not 65, for '0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862,')
    
    $ ./bitcoin-cli waitforblockheight "100", 1000
    error: Error parsing JSON:100,
    
    $ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "waitforblockheight", "params": ["100", 1000]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    Enter host password for user '__cookie__':
    {"result":null,"error":{"code":-1,"message":"JSON value is not an integer as expected"},"id":"curltest"}
    

    Outputs for the fixed examples in the PR branch:

    $ ./bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862" 1000
    {
      "hash": "0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080",
      "height": 622416
    }
    
    $ ./bitcoin-cli waitforblockheight 100 1000
    {
      "hash": "0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080",
      "height": 622416
    }
    
    $ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "waitforblockheight", "params": [100, 1000]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    Enter host password for user '__cookie__':
    {"result":{"hash":"0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080","height":622416},"error":null,"id":"curltest"}
    
  2. rpc: fix broken RPCExamples for waitforblock(height)
    Fixes the following RPCExamples:
    -> ExampleCli waitforblock (removed comma between arguments)
    -> ExampleCli waitforblockheight (removed comma between arguments)
    -> ExampleRpc waitforblockheight (removed quotation marks around integer argument)
    ef35604c9c
  3. laanwj added the label RPC/REST/ZMQ on Mar 21, 2020
  4. fanquake approved
  5. fanquake commented at 8:22 AM on March 25, 2020: member

    ACK ef35604c9c88e7800e9be106b791b1c0fa8b310a

    master:

    src/bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862", 1000
    error code: -8
    error message:
    blockhash must be of length 64 (not 65, for '0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862,')
    
    src/bitcoin-cli waitforblockheight "100", 1000
    error: Error parsing JSON:100,
    

    PR:

    src/bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862" 1000
    {
      "hash": "000000000000000000047fb670bd469bfcaa15fc8085c6befbda345b5348a167",
      "height": 622876
    }
    
    src/bitcoin-cli waitforblockheight 100 1000
    {
      "hash": "000000000000000000047fb670bd469bfcaa15fc8085c6befbda345b5348a167",
      "height": 622876
    }
    
  6. fanquake merged this on Mar 27, 2020
  7. fanquake closed this on Mar 27, 2020

  8. theStack cross-referenced this on Mar 27, 2020 from issue rpc: fix/add missing RPCExamples for "Util" RPCs by theStack
  9. MarkLTZ cross-referenced this on Apr 4, 2020 from issue Bitcoin PR tracking by MarkLTZ
  10. theStack deleted the branch on Dec 1, 2020
  11. Fabcien referenced this in commit 466d6dbef8 on Jan 13, 2021
  12. MarcoFalke referenced this in commit dd097c42df on Sep 2, 2021
  13. sidhujag referenced this in commit 5ce8996590 on Sep 4, 2021
  14. PastaPastaPasta referenced this in commit cd1010708b on Dec 22, 2021
  15. PastaPastaPasta referenced this in commit 273ae664c1 on Dec 22, 2021
  16. PastaPastaPasta referenced this in commit 3d2fee0794 on Dec 22, 2021
  17. PastaPastaPasta referenced this in commit e99f1ee057 on Dec 28, 2021
  18. bitcoin locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC