mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
21d4e0ba75rpc, wallet, test: fix invalid JSON in HelpExampleRpc curl examples (GuTS805) Pull request description: Several `HelpExampleRpc` call sites reused CLI-style argument strings verbatim instead of valid JSON — missing commas, bare unquoted words, or single backslashes that are not valid JSON escapes. As a result the documented `curl` command for 14 RPCs (`getblockfrompeer`, `addnode`, `addconnection`, `sendmsgtopeer`, `restorewallet`, `getmempoolcluster`, `importmempool`, `getindexinfo`, `listlabels`, `unloadwallet`, `createwalletdescriptor`, `addhdkey`, `loadwallet`, `listunspent`) fails to parse as JSON if copy-pasted as-is. Also fixes a stray trailing quote in the `restorewallet` named-argument examples. This was previously raised in #31275, which sipa confirmed at runtime by adding a `UniValue::read` check, but that PR was closed unmerged. Since then two more examples broke the same way (`getmempoolcluster`, `addhdkey`), which is why this adds a permanent regression check to `rpc_help.py::dump_help()` instead of just fixing the current list. Fixes #35864. ACKs for top commit: maflcko: review ACK21d4e0ba75🚝 sedited: ACK21d4e0ba75Tree-SHA512: 2a8abc07d681b9dc81b8079a68421278da890049cea33a1561a48d53cbf919a30df588f559e9df94fa4a1ab7027f742f3b12c163afc25246a620340cb3522336