Similar to #18398, this PR gives the RPCExamples in the RPC category “Util” (that currently contains createmultisig
, deriveaddresses
, estimatesmartfee
, getdescriptorinfo
, signmessagewithprivkey
, validateaddress
, verifymessage
) some love by fixing one broken and adding three missing examples:
- fixed
HelpExampleRpc
forcreatemultisig
(disturbing escape characters and quotation marks) - added missing
HelpExampleRpc
forderiveaddresses
(also put descriptor in a new string constant)estimatesmartfee
getdescriptorinfo
(also put descriptor in a new string constant)
Output for createmultisig
example on the master branch:
0$ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createmultisig", "params": [2, "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
1Enter host password for user '__cookie__':
2{"result":null,"error":{"code":-1,"message":"JSON value is not an array as expected"},"id":"curltest"}
Output for createmultisig
example on the PR branch:
0$ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createmultisig", "params": [2, ["03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd","03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
1Enter host password for user '__cookie__':
2{"result":{"address":"3QsFXpFJf2ZY6GLWVoNFFd2xSDwdS713qX","redeemScript":"522103789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd2103dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a6162652ae","descriptor":"sh(multi(2,03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd,03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626))#4djp057k"},"error":null,"id":"curltest"}