rpc: Properly make RPCResult::Type::ANY non-test-only #35842

pull maflcko wants to merge 5 commits into bitcoin:master from maflcko:2607-rpc-any-result changing 4 files +42 −36
  1. maflcko commented at 5:53 AM on July 30, 2026: member

    Commit 6a1a66c180cba5f2d4189e89327de23505c7f4dd attempted to properly render RPC results of the type ANY.

    However, the commit is incomplete.

    Fix it, by properly rendering all ANY types.

    Moreover, a few trivial refactors after #34683 are included here.

  2. DrahtBot renamed this:
    rpc: Properly make RPCResult::Type::ANY non-test-only
    rpc: Properly make RPCResult::Type::ANY non-test-only
    on Jul 30, 2026
  3. DrahtBot added the label RPC/REST/ZMQ on Jul 30, 2026
  4. DrahtBot commented at 5:53 AM on July 30, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited, willcl-ark

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. maflcko force-pushed on Jul 30, 2026
  6. DrahtBot added the label CI failed on Jul 30, 2026
  7. maflcko commented at 6:33 AM on July 30, 2026: member

    Rendered diff:

    diff --git a/echo b/echo
    index 58d7d21..4f5d878 100644
    --- a/echo
    +++ b/echo
    @@ -17,3 +17,6 @@ Arguments:
     8. arg7     (string, optional)
     9. arg8     (string, optional)
     10. arg9    (string, optional)
    +
    +Result:
    +xxx    (any) Returns whatever was passed in
    diff --git a/echojson b/echojson
    index 15a45f8..7976600 100644
    --- a/echojson
    +++ b/echojson
    @@ -17,3 +17,6 @@ Arguments:
     8. arg7     (string, optional)
     9. arg8     (string, optional)
     10. arg9    (string, optional)
    +
    +Result:
    +xxx    (any) Returns whatever was passed in
    
  8. maflcko removed the label CI failed on Jul 30, 2026
  9. refactor: Use std::visit in ApplyArgFallback
    This is more explicit and comes with compile-time checks to ensure all default types are covered.
    fa1242dcc0
  10. rpc: Properly make RPCResult::Type::ANY non-test-only
    This will render all ANY results.
    
    However, the one in the help RPC should still be hidden. This is done by
    applying HelpElisionSkip and also skipping over empty result sections in
    ToDescriptionString.
    
    Also, run clang-format. Can be reviewed via --ignore-all-space
    fa22647914
  11. refactor: Remove stale NOLINTNEXTLINE above GetAddressInfoBaseFields
    There is no recursion.
    fa1871a528
  12. refactor: Use self.Arg<bool> in getopenrpcinfo
    This is clearer, because it does not encode the default value in the
    source code syntax. Also, using named args is clearer than positional
    args.
    
    Also, run clang-format on the new code.
    fa3aadbc32
  13. refactor: Use CLIENT_NAME in buildOpenRPCDoc
    This refactor follow other uses of CLIENT_NAME, such as in RPCMethod stop().
    fac4b06e99
  14. maflcko force-pushed on Aug 5, 2026
  15. sedited approved
  16. sedited commented at 10:52 AM on August 6, 2026: contributor

    ACK fac4b06e997e197d6dca4c41bdec99c0ba84cfca

  17. maflcko commented at 11:16 AM on August 6, 2026: member

    cc @willcl-ark As the author of commit https://github.com/bitcoin/bitcoin/commit/6a1a66c180cba5f2d4189e89327de23505c7f4dd, you may be qualified to review :)

  18. sedited requested review from willcl-ark on Aug 6, 2026
  19. willcl-ark approved
  20. willcl-ark commented at 2:55 PM on August 6, 2026: member

    ACK fac4b06e997e197d6dca4c41bdec99c0ba84cfca

    All looks good to me, thanks for the followups :)

    I was wondering whether it would be worth adding a specific (regression) test for this, but I don't think it probably is. Could be just checking for (any) in bitcoin-cli help echo and no (any)'s in bitcoin-cli help.

  21. fanquake merged this on Aug 6, 2026
  22. fanquake closed this on Aug 6, 2026

  23. maflcko deleted the branch on Aug 6, 2026

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-08-24 13:51 UTC

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