doc: Fix incorrect send RPC docs #31416

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2412-doc-rpc changing 1 files +4 −2
  1. maflcko commented at 10:32 am on December 4, 2024: member

    It would be good to have accurate RPC docs, so that humans and machines can read them and rely on them.

    This fixes one issue.

  2. DrahtBot commented at 10:32 am on December 4, 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/31416.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK rkrux

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #28710 (Remove the legacy wallet and BDB dependency by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot renamed this:
    doc: Fix incorrect send RPC docs
    doc: Fix incorrect send RPC docs
    on Dec 4, 2024
  4. DrahtBot added the label Docs on Dec 4, 2024
  5. doc: Fix incorrect send RPC docs fad83e759a
  6. maflcko force-pushed on Dec 4, 2024
  7. maflcko commented at 3:29 pm on December 4, 2024: member

    rendered diff:

     0diff --git a/send b/send
     1index 8c3edb7..45b8716 100644
     2--- a/send
     3+++ b/send
     4@@ -51,12 +51,14 @@ fee_rate                     (numeric or string, optional, default=not set, fall
     5 include_watching             (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only.
     6                              Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,
     7                              e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field.
     8-inputs                       (json array, optional, default=[]) Specify inputs instead of adding them automatically. A JSON array of JSON objects
     9+inputs                       (json array, optional, default=[]) Specify inputs instead of adding them automatically.
    10      [
    11-       "txid",               (string, required) The transaction id
    12-       vout,                 (numeric, required) The output number
    13-       sequence,             (numeric, required) The sequence number
    14-       weight,               (numeric, optional, default=Calculated from wallet and solving data) The maximum weight for this input, including the weight of the outpoint and sequence number. Note that signature sizes are not guaranteed to be consistent, so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures.Remember to convert serialized sizes to weight units when necessary.
    15+       {                     (json object)
    16+         "txid": "hex",      (string, required) The transaction id
    17+         "vout": n,          (numeric, required) The output number
    18+         "sequence": n,      (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number
    19+         "weight": n,        (numeric, optional, default=Calculated from wallet and solving data) The maximum weight for this input, including the weight of the outpoint and sequence number. Note that signature sizes are not guaranteed to be consistent, so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures.Remember to convert serialized sizes to weight units when necessary.
    20+       },
    21        ...
    22      ]
    23 locktime                     (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
    
  8. in src/wallet/rpc/spend.cpp:1235 in fad83e759a
    1232+                          {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", {
    1233                             {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
    1234                             {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
    1235-                            {"sequence", RPCArg::Type::NUM, RPCArg::Optional::NO, "The sequence number"},
    1236+                            {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'replaceable' and 'locktime' arguments"}, "The sequence number"},
    1237                             {"weight", RPCArg::Type::NUM, RPCArg::DefaultHint{"Calculated from wallet and solving data"}, "The maximum weight for this input, "
    


    rkrux commented at 4:20 am on December 10, 2024:

    To be consistent with other default hints.

    0                            {"weight", RPCArg::Type::NUM, RPCArg::DefaultHint{"calculated from wallet and solving data"}, "The maximum weight for this input, "
    

    maflcko commented at 11:29 am on December 10, 2024:
    Thx, but I’ll leave this as-is for now, since I didn’t touch this line.
  9. in src/wallet/rpc/spend.cpp:1239 in fad83e759a
    1236+                            {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'replaceable' and 'locktime' arguments"}, "The sequence number"},
    1237                             {"weight", RPCArg::Type::NUM, RPCArg::DefaultHint{"Calculated from wallet and solving data"}, "The maximum weight for this input, "
    1238                                         "including the weight of the outpoint and sequence number. "
    1239                                         "Note that signature sizes are not guaranteed to be consistent, "
    1240                                         "so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures."
    1241                                         "Remember to convert serialized sizes to weight units when necessary."},
    


    rkrux commented at 4:21 am on December 10, 2024:
    0                                        "so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures. "
    1                                        "Remember to convert serialized sizes to weight units when necessary."},
    

    maflcko commented at 11:29 am on December 10, 2024:
    Thx, but I’ll leave this as-is for now, since I didn’t touch this line. The whitespace (including newlines) can probably be improved for many RPCs, so a separate pull may be best.
  10. rkrux approved
  11. rkrux commented at 4:25 am on December 10, 2024: none

    tACK fad83e759a4a6221fb3b067657f847894e5a2f20

    Thanks, the CLI output looks much better now. Left couple suggestions that are not in this diff though but are close by.

    New

    0inputs                       (json array, optional, default=[]) Specify inputs instead of adding them automatically.
    1     [
    2       {                     (json object)
    3         "txid": "hex",      (string, required) The transaction id
    4         "vout": n,          (numeric, required) The output number
    5         "sequence": n,      (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number
    6         "weight": n,        (numeric, optional, default=Calculated from wallet and solving data) The maximum weight for this input, including the weight of the outpoint and sequence number. Note that signature sizes are not guaranteed to be consistent, so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures.Remember to convert serialized sizes to weight units when necessary.
    7       },
    8       ...
    9     ]
    

    Old

    0inputs                       (json array, optional, default=[]) Specify inputs instead of adding them automatically. A JSON array of JSON objects
    1     [
    2       "txid",               (string, required) The transaction id
    3       vout,                 (numeric, required) The output number
    4       sequence,             (numeric, required) The sequence number
    5       weight,               (numeric, optional, default=Calculated from wallet and solving data) The maximum weight for this input, including the weight of the outpoint and sequence number. Note that signature sizes are not guaranteed to be consistent, so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures.Remember to convert serialized sizes to weight units when necessary.
    6       ...
    7     ]
    

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-12-22 21:12 UTC

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