[trivial] Correct help text for `importaddress` RPC #13074

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:importaddress_help_text changing 1 files +6 −6
  1. jnewbery commented at 6:18 PM on April 25, 2018: member

    Help text for importaddress referred to the first parameter as script, when in fact it's address. Calling with a script argument fails:

    → bcli -named importaddress script=2N3qhMpHK8WNo7wv87W9eHMgvGyJU1593Ei
    error code: -8
    error message:
    Unknown named parameter script
    → bcli -named importaddress address=2N3qhMpHK8WNo7wv87W9eHMgvGyJU1593Ei
    # success!
    
  2. [wallet] [rpc] Fix importaddress help text 2c71edc2fc
  3. MarcoFalke commented at 6:29 PM on April 25, 2018: member

    This seems to revert 5c17059872c9b63a1e05c7aa8aea32a03c3ec73a of #6415, no?

  4. jnewbery commented at 7:34 PM on April 25, 2018: member

    This seems to revert 5c17059 of #6415

    Hmmm - yes. I hadn't noticed that. That commit updated part of the help text to refer to the first argument as script:

                "1. \"script\"           (string, required) The hex-encoded script (or address)\n"
    

    but not the usage summary:

                 "importaddress \"address\" ( \"label\" rescan p2sh )\n"
    

    When named arguments were introduced (https://github.com/bitcoin/bitcoin/commit/37a166f1465c91be3e700c0175f34dd0c3698df8), the usage summary was used to name the first argument:

    +    { "wallet",             "importaddress",            &importaddress,            true,   {"address","label","rescan","p2sh"} },
    

    Since the argument name is now part of the API, I think we should update the help text to match the argument name rather than the other way round.

  5. fanquake added the label Docs on Apr 25, 2018
  6. jonasschnelli commented at 7:25 AM on April 26, 2018: contributor

    Isn't it misleading to import a script over a key called address? I know it would be correct but still not clear. What about renaming the parameter to address_or_script or to importdata (or similar) to avoid confusion?

  7. jnewbery commented at 9:59 PM on May 2, 2018: member

    What about renaming the parameter to address_or_script or to importdata (or similar) to avoid confusion?

    I'd prefer to update the text to match the API, than change the API (which could be a compatibility break for clients).

    An alternative to this PR would be to add script as an alias for address (and change the usage summary so that script is the canonical name for the arg). Thoughts?

  8. MarcoFalke merged this on Jul 19, 2018
  9. MarcoFalke closed this on Jul 19, 2018

  10. MarcoFalke referenced this in commit f281f8f755 on Jul 19, 2018
  11. MarcoFalke commented at 9:36 PM on July 19, 2018: member

    utACK 2c71edc2fc52cfc3a0b401f8d5d051c8938c150e. This makes the doc reflect the actual name of the named parameter, which can no longer be changed at this point.

  12. promag commented at 1:12 AM on July 20, 2018: member

    utACK 2c71edc.

  13. jnewbery deleted the branch on Jul 20, 2018
  14. jasonbcox referenced this in commit a15a962c13 on Dec 20, 2019
  15. PastaPastaPasta referenced this in commit 559ad00c5b on Jul 19, 2020
  16. PastaPastaPasta referenced this in commit 50b21f7f6c on Jul 24, 2020
  17. PastaPastaPasta referenced this in commit e0b0149c4a on Jul 27, 2020
  18. UdjinM6 referenced this in commit d94f2a388a on Jul 27, 2020
  19. UdjinM6 referenced this in commit 3101a80a56 on Jul 27, 2020
  20. gades referenced this in commit 27cd47378f on Jul 1, 2021
  21. MarcoFalke locked this on Sep 8, 2021

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-04-22 18:15 UTC

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