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 13 RPCs (getblockfrompeer, addnode,
addconnection, sendmsgtopeer, restorewallet, getmempoolcluster,
importmempool, getindexinfo, listlabels, unloadwallet,
createwalletdescriptor, addhdkey, loadwallet) 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.
First commit adds the regression check (would fail on current master), second commit fixes the 13 examples so the check passes.