Skip to content

Commit

Permalink
Merge #14373: Consistency fixes for RPC descriptions
Browse files Browse the repository at this point in the history
Summary:
b8edb9810a [rpc] Descriptions: Textual consistency fixes (Jon Layton)

Pull request description:

Tree-SHA512: fa22ddac94e95672579cc84309f1c3ea3a2dbf762e45a8ae9c121c4c5188bf8c19ff9458d49dd7ef760c3ae4226487612a2954e9a1a0e8b720116afeb718b46b

Backport of Core [[bitcoin/bitcoin#14373 | PR14373]]

Test Plan:
  ninja
  ninja check
  ./bitcoind
  ./bitcoin-cli help <changed rpcs>
Verify changes in help text.

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5517
  • Loading branch information
MarcoFalke authored and Nico Guiton committed Mar 20, 2020
1 parent 4d562db commit 9d64eab
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
20 changes: 10 additions & 10 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static UniValue getbestblockhash(const Config &config,
"\nReturns the hash of the best (tip) block in the "
"longest blockchain.\n"
"\nResult:\n"
"\"hex\" (string) the block hash hex encoded\n"
"\"hex\" (string) the block hash hex-encoded\n"
"\nExamples:\n" +
HelpExampleCli("getbestblockhash", "") +
HelpExampleRpc("getbestblockhash", ""));
Expand All @@ -193,7 +193,7 @@ UniValue getfinalizedblockhash(const Config &config,
"getfinalizedblockhash\n"
"\nReturns the hash of the currently finalized block\n"
"\nResult:\n"
"\"hex\" (string) the block hash hex encoded\n");
"\"hex\" (string) the block hash hex-encoded\n");
}

LOCK(cs_main);
Expand Down Expand Up @@ -572,20 +572,20 @@ static UniValue getmempoolancestors(const Config &config,
if (request.fHelp || request.params.size() < 1 ||
request.params.size() > 2) {
throw std::runtime_error(
"getmempoolancestors txid (verbose)\n"
"getmempoolancestors txid ( verbose )\n"
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id "
"(must be in mempool)\n"
"2. verbose (boolean, optional, default=false) "
"True for a json object, false for array of transaction ids\n"
"\nResult (for verbose=false):\n"
"\nResult (for verbose = false):\n"
"[ (json array of strings)\n"
" \"transactionid\" (string) The transaction id of an "
"in-mempool ancestor transaction\n"
" ,...\n"
"]\n"
"\nResult (for verbose=true):\n"
"\nResult (for verbose = true):\n"
"{ (json object)\n"
" \"transactionid\" : { (json object)\n" +
EntryDescriptionString() +
Expand Down Expand Up @@ -642,20 +642,20 @@ static UniValue getmempooldescendants(const Config &config,
if (request.fHelp || request.params.size() < 1 ||
request.params.size() > 2) {
throw std::runtime_error(
"getmempooldescendants txid (verbose)\n"
"getmempooldescendants txid ( verbose )\n"
"\nIf txid is in the mempool, returns all in-mempool descendants.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id "
"(must be in mempool)\n"
"2. verbose (boolean, optional, default=false) "
"True for a json object, false for array of transaction ids\n"
"\nResult (for verbose=false):\n"
"\nResult (for verbose = false):\n"
"[ (json array of strings)\n"
" \"transactionid\" (string) The transaction id of an "
"in-mempool descendant transaction\n"
" ,...\n"
"]\n"
"\nResult (for verbose=true):\n"
"\nResult (for verbose = true):\n"
"{ (json object)\n"
" \"transactionid\" : { (json object)\n" +
EntryDescriptionString() +
Expand Down Expand Up @@ -779,7 +779,7 @@ static UniValue getblockheader(const Config &config,
"\nArguments:\n"
"1. \"blockhash\" (string, required) The block hash\n"
"2. verbose (boolean, optional, default=true) true for a "
"json object, false for the hex encoded data\n"
"json object, false for the hex-encoded data\n"
"\nResult (for verbose = true):\n"
"{\n"
" \"hash\" : \"hash\", (string) the block hash (same as "
Expand Down Expand Up @@ -1192,7 +1192,7 @@ UniValue gettxout(const Config &config, const JSONRPCRequest &request) {
"\nGet unspent transactions\n" +
HelpExampleCli("listunspent", "") + "\nView the details\n" +
HelpExampleCli("gettxout", "\"txid\" 1") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("gettxout", "\"txid\", 1"));
}

Expand Down
8 changes: 4 additions & 4 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static UniValue validateaddress(const Config &config,
"valid or not. If not, this is the only property returned.\n"
" \"address\" : \"address\", (string) The bitcoin address "
"validated\n"
" \"scriptPubKey\" : \"hex\", (string) The hex encoded "
" \"scriptPubKey\" : \"hex\", (string) The hex-encoded "
"scriptPubKey generated by the address\n"
" \"isscript\" : true|false, (boolean) If the key is a "
"script\n"
Expand Down Expand Up @@ -124,7 +124,7 @@ static UniValue createmultisig(const Config &config,
"42cf11ae157a7ace5fd\\\","
"\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e1"
"7e107ef3f6aa5a61626\\\"]\"") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("createmultisig",
"2, "
"\"["
Expand Down Expand Up @@ -193,7 +193,7 @@ static UniValue verifymessage(const Config &config,
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4"
"XX\" \"signature\" \"my "
"message\"") +
"\nAs json rpc\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4"
"XX\", \"signature\", \"my "
"message\""));
Expand Down Expand Up @@ -258,7 +258,7 @@ static UniValue signmessagewithprivkey(const Config &config,
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4"
"XX\" \"signature\" \"my "
"message\"") +
"\nAs json rpc\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("signmessagewithprivkey",
"\"privkey\", \"my message\""));
}
Expand Down
14 changes: 7 additions & 7 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ static UniValue createrawtransaction(const Config &config,
" \"address\": x.xxx, (obj, optional) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in " + CURRENCY_UNIT + "\n"
" },\n"
" {\n"
" \"data\": \"hex\" (obj, optional) A key-value pair. The key must be \"data\", the value is hex encoded data\n"
" \"data\": \"hex\" (obj, optional) A key-value pair. The key must be \"data\", the value is hex-encoded data\n"
" }\n"
" ,... More key-value pairs of the above form. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
" accepted as second parameter.\n"
Expand Down Expand Up @@ -682,11 +682,11 @@ static UniValue decodescript(const Config &config,
"decodescript \"hexstring\"\n"
"\nDecode a hex-encoded script.\n"
"\nArguments:\n"
"1. \"hexstring\" (string) the hex encoded script\n"
"1. \"hexstring\" (string) the hex-encoded script\n"
"\nResult:\n"
"{\n"
" \"asm\":\"asm\", (string) Script public key\n"
" \"hex\":\"hex\", (string) hex encoded public key\n"
" \"hex\":\"hex\", (string) hex-encoded public key\n"
" \"type\":\"type\", (string) The output type\n"
" \"reqSigs\": n, (numeric) The required signatures\n"
" \"addresses\": [ (json array of string)\n"
Expand Down Expand Up @@ -1093,7 +1093,7 @@ static UniValue signrawtransactionwithkey(const Config &config,
" ,...\n"
" ]\n"
"4. \"sighashtype\" (string, optional, "
"default=ALL|FORKID) The signature hash type. Must be one of\n"
"default=ALL|FORKID) The signature hash type. Must be one of:\n"
" \"ALL|FORKID\"\n"
" \"NONE|FORKID\"\n"
" \"SINGLE|FORKID\"\n"
Expand Down Expand Up @@ -1182,7 +1182,7 @@ static UniValue sendrawtransaction(const Config &config,
HelpExampleCli("signrawtransactionwithwallet", "\"myhex\"") +
"\nSend the transaction (signed hex)\n" +
HelpExampleCli("sendrawtransaction", "\"signedhex\"") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("sendrawtransaction", "\"signedhex\""));
}

Expand Down Expand Up @@ -1296,7 +1296,7 @@ static UniValue testmempoolaccept(const Config &config,
+ HelpExampleCli("signrawtransactionwithwallet", "\"myhex\"") +
"\nTest acceptance of the transaction (signed hex)\n"
+ HelpExampleCli("testmempoolaccept", "\"signedhex\"") +
"\nAs a json rpc call\n"
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("testmempoolaccept", "[\"signedhex\"]")
// clang-format on
);
Expand Down Expand Up @@ -1860,7 +1860,7 @@ static UniValue createpsbt(const Config &config,
" },\n"
" {\n"
" \"data\": \"hex\" (obj, optional) A key-value pair. "
"The key must be \"data\", the value is hex encoded data\n"
"The key must be \"data\", the value is hex-encoded data\n"
" }\n"
" ,... More key-value pairs of the above "
"form. For compatibility reasons, a dictionary, which holds the "
Expand Down
30 changes: 15 additions & 15 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static UniValue signmessage(const Config &config,
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4"
"XX\" \"signature\" \"my "
"message\"") +
"\nAs json rpc\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc(
"signmessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"my message\""));
Expand Down Expand Up @@ -668,7 +668,7 @@ static UniValue getreceivedbyaddress(const Config &config,
"\nThe amount with at least 6 confirmations\n" +
HelpExampleCli("getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6"));
}
Expand Down Expand Up @@ -758,7 +758,7 @@ static UniValue getreceivedbylabel(const Config &config,
HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") +
"\nThe amount with at least 6 confirmations\n" +
HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6"));
}

Expand Down Expand Up @@ -841,7 +841,7 @@ static UniValue getbalance(const Config &config,
"\nThe total amount in the wallet with 1 or more confirmations\n" +
HelpExampleCli("getbalance", "") +
"\nThe total amount in the wallet at least 6 blocks confirmed\n" +
HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" +
HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a JSON-RPC call\n" +
HelpExampleRpc("getbalance", "\"*\", 6"));
}

Expand Down Expand Up @@ -969,7 +969,7 @@ static UniValue sendmany(const Config &config, const JSONRPCRequest &request) {
"1 \"\" "
"\"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\","
"\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("sendmany",
"\"\", "
"\"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,"
Expand Down Expand Up @@ -1130,7 +1130,7 @@ static UniValue addmultisigaddress(const Config &config,
"2 "
"\"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\","
"\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
"\nAs json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("addmultisigaddress",
"2, "
"\"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\","
Expand Down Expand Up @@ -1638,7 +1638,7 @@ UniValue listtransactions(const Config &config, const JSONRPCRequest &request) {
HelpExampleCli("listtransactions", "") +
"\nList transactions 100 to 120\n" +
HelpExampleCli("listtransactions", "\"*\" 20 100") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("listtransactions", "\"*\", 20, 100"));
}

Expand Down Expand Up @@ -2249,7 +2249,7 @@ static UniValue walletpassphrase(const Config &config,
"\nUnlock the wallet for 60 seconds\n" +
HelpExampleCli("walletpassphrase", "\"my pass phrase\" 60") +
"\nLock the wallet again (before 60 seconds)\n" +
HelpExampleCli("walletlock", "") + "\nAs json rpc call\n" +
HelpExampleCli("walletlock", "") + "\nAs a JSON-RPC call\n" +
HelpExampleRpc("walletpassphrase", "\"my pass phrase\", 60"));
}

Expand Down Expand Up @@ -2402,7 +2402,7 @@ static UniValue walletlock(const Config &config,
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") +
"\nClear the passphrase since we are done before 2 minutes is "
"up\n" +
HelpExampleCli("walletlock", "") + "\nAs json rpc call\n" +
HelpExampleCli("walletlock", "") + "\nAs a JSON-RPC call\n" +
HelpExampleRpc("walletlock", ""));
}

Expand Down Expand Up @@ -2460,7 +2460,7 @@ static UniValue encryptwallet(const Config &config,
"\nNow we can do something like sign\n" +
HelpExampleCli("signmessage", "\"address\" \"test message\"") +
"\nNow lock the wallet again by removing the passphrase\n" +
HelpExampleCli("walletlock", "") + "\nAs a json rpc call\n" +
HelpExampleCli("walletlock", "") + "\nAs a JSON-RPC call\n" +
HelpExampleRpc("encryptwallet", "\"my pass phrase\""));
}

Expand Down Expand Up @@ -2574,7 +2574,7 @@ static UniValue lockunspent(const Config &config,
"\\\"a08e6907dbbd3d809776dbfc5d82e371"
"b764ed838b5655e72f463568df1aadf0\\\""
",\\\"vout\\\":1}]\"") +
"\nAs a json rpc call\n" +
"\nAs a JSON-RPC call\n" +
HelpExampleRpc("lockunspent", "false, "
"\"[{\\\"txid\\\":"
"\\\"a08e6907dbbd3d809776dbfc5d82e371"
Expand Down Expand Up @@ -2709,7 +2709,7 @@ static UniValue listlockunspent(const Config &config,
"\\\"a08e6907dbbd3d809776dbfc5d82e371"
"b764ed838b5655e72f463568df1aadf0\\\""
",\\\"vout\\\":1}]\"") +
"\nAs a json rpc call\n" + HelpExampleRpc("listlockunspent", ""));
"\nAs a JSON-RPC call\n" + HelpExampleRpc("listlockunspent", ""));
}

auto locked_chain = pwallet->chain().lock();
Expand Down Expand Up @@ -4005,7 +4005,7 @@ UniValue getaddressinfo(const Config &config, const JSONRPCRequest &request) {
"{\n"
" \"address\" : \"address\", (string) The bitcoin address "
"validated\n"
" \"scriptPubKey\" : \"hex\", (string) The hex encoded "
" \"scriptPubKey\" : \"hex\", (string) The hex-encoded "
"scriptPubKey generated by the address\n"
" \"ismine\" : true|false, (boolean) If the address is "
"yours or not\n"
Expand Down Expand Up @@ -4212,7 +4212,7 @@ UniValue listlabels(const Config &config, const JSONRPCRequest &request) {
"\nList labels that have receiving addresses\n" +
HelpExampleCli("listlabels", "receive") +
"\nList labels that have sending addresses\n" +
HelpExampleCli("listlabels", "send") + "\nAs json rpc call\n" +
HelpExampleCli("listlabels", "send") + "\nAs a JSON-RPC call\n" +
HelpExampleRpc("listlabels", "receive"));
}

Expand Down Expand Up @@ -4576,7 +4576,7 @@ static UniValue walletcreatefundedpsbt(const Config &config,
" },\n"
" {\n"
" \"data\": \"hex\" (obj, optional) A key-value pair. "
"The key must be \"data\", the value is hex encoded data\n"
"The key must be \"data\", the value is hex-encoded data\n"
" }\n"
" ,... More key-value pairs of the above "
"form. For compatibility reasons, a dictionary, which holds the "
Expand Down

0 comments on commit 9d64eab

Please sign in to comment.