doc: Deduplicate list of possible chain strings in RPC help texts #30648

pull martinsaposnic wants to merge 1 commits into bitcoin:master from martinsaposnic:202408-doc-deduplicate-chain-network-strings-rpc-help changing 4 files +8 −3
  1. martinsaposnic commented at 5:06 pm on August 13, 2024: contributor

    As mentioned in issue #30645:

    Many command line parameter and RPC help texts currently contain the list of chain/network names hardcoded (“main, test, testnet4, signet, regtest”), which is error-prone as it can easily happen to miss an instance if the list ever changes again.

    This PR deduplicates the list of possible chain/network strings in RPC/parameter help texts, and it creates a macro LIST_CHAIN_NAMES in src/chainparamsbase.h. In the future, there is only 1 place where that list of possible values lives, so maintainability is improved and errors are avoided.

    All three places where this change impacts:

    0./bitcoin-cli --help
    1./bitcoin-cli help getblockchaininfo
    2./bitcoin-cli help getmininginfo
    

    They all return the correct string "main, test, testnet4, signet, regtest"

    See #30642 (review)

  2. Deduplicate list of chain strings in RPC help texts 9b29755520
  3. DrahtBot commented at 5:06 pm on August 13, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

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

  4. DrahtBot added the label Docs on Aug 13, 2024
  5. maflcko commented at 7:28 am on August 14, 2024: member
    lgtm ACK 9b297555207b4ea54bc0051f09c7084797aa9def
  6. MarnixCroes approved
  7. MarnixCroes commented at 8:16 am on August 14, 2024: contributor
    ACK 9b297555207b4ea54bc0051f09c7084797aa9def
  8. theStack approved
  9. theStack commented at 10:12 am on August 14, 2024: contributor
    ACK 9b297555207b4ea54bc0051f09c7084797aa9def
  10. danielabrozzoni approved
  11. danielabrozzoni commented at 10:37 am on August 14, 2024: contributor
    ACK 9b297555207b4ea54bc0051f09c7084797aa9def
  12. achow101 commented at 3:47 pm on August 14, 2024: member
    ACK 9b297555207b4ea54bc0051f09c7084797aa9def
  13. achow101 merged this on Aug 14, 2024
  14. achow101 closed this on Aug 14, 2024


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-09-29 01:12 UTC

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