doc: corrected lockunspent rpc quoting #31275

pull Talej wants to merge 2 commits into bitcoin:master from Talej:listunspentrpctypo changing 4 files +8 −8
  1. Talej commented at 2:44 am on November 12, 2024: none

    bitcoin-cli help lockunspent RPC example shows:

    0As a JSON-RPC call
    1> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    Including quotes around the transactions argument. Using the RPC in this way fails:

    0curl --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"6f244af8e2162138369fc736a673f85ead59ad88fb5a1edd6e03f81b33c537b0\",\"vout\":1}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:18443/wallet/locktest
    1
    2{"result":null,"error":{"code":-3,"message":"Expected type array, got string"},"id":"curltest"}
    

    This change corrects the documentation to remove the additional quotes so the example works as intended:

    0curl --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, [{"txid":"6f244af8e2162138369fc736a673f85ead59ad88fb5a1edd6e03f81b33c537b0","vout":0}]]}' -H 'content-type: text/plain;' http://127.0.0.1:18443/wallet/locktest
    1
    2{"result":true,"error":null,"id":"curltest"}
    
  2. DrahtBot commented at 2:44 am on November 12, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31275.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    No conflicts as of last run.

  3. DrahtBot added the label Docs on Nov 12, 2024
  4. Talej marked this as ready for review on Nov 12, 2024
  5. Talej renamed this:
    doc: corrected listunspent rpc quoting
    doc: corrected lockunspent rpc quoting
    on Nov 12, 2024
  6. corrected lockunspent rpc quoting 70ae8ca8b7
  7. Talej force-pushed on Nov 12, 2024
  8. Madxgame approved
  9. fanquake commented at 9:54 am on November 12, 2024: member
    The same kind of quoting is used in multiple places in this file, so if it is incorrect / needs updating, all instances should be changed at the same time.
  10. further RPC example corrections 1f3f5c049b
  11. Talej commented at 3:58 am on November 13, 2024: none

    Corrected additional RPC examples for gettxspendingprevout, createrawtransaction, signrawtransactionwithkey, addmultisigaddress & listunspent

    All relevant changes should be complete here


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: 2024-11-21 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me