Skip to content

Commit 9adb4e1

Browse files
committed
rpc: Argument name consistency
The meaning is clear from the context, and we're inconsistent here. Also save typing when using named arguments. - `bitcoinaddress` -> `address` - `bitcoinprivkey` -> `privkey` - `bitcoinpubkey` -> `pubkey`
1 parent 8d713f7 commit 9adb4e1

File tree

5 files changed

+42
-42
lines changed

5 files changed

+42
-42
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ UniValue gettxout(const JSONRPCRequest& request)
875875
" \"reqSigs\" : n, (numeric) Number of required signatures\n"
876876
" \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n"
877877
" \"addresses\" : [ (array of string) array of bitcoin addresses\n"
878-
" \"bitcoinaddress\" (string) bitcoin address\n"
878+
" \"address\" (string) bitcoin address\n"
879879
" ,...\n"
880880
" ]\n"
881881
" },\n"

src/rpc/misc.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ UniValue validateaddress(const JSONRPCRequest& request)
152152
{
153153
if (request.fHelp || request.params.size() != 1)
154154
throw runtime_error(
155-
"validateaddress \"bitcoinaddress\"\n"
155+
"validateaddress \"address\"\n"
156156
"\nReturn information about the given bitcoin address.\n"
157157
"\nArguments:\n"
158-
"1. \"bitcoinaddress\" (string, required) The bitcoin address to validate\n"
158+
"1. \"address\" (string, required) The bitcoin address to validate\n"
159159
"\nResult:\n"
160160
"{\n"
161161
" \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
162-
" \"address\" : \"bitcoinaddress\", (string) The bitcoin address validated\n"
162+
" \"address\" : \"address\", (string) The bitcoin address validated\n"
163163
" \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n"
164164
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
165165
" \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n"
@@ -325,10 +325,10 @@ UniValue verifymessage(const JSONRPCRequest& request)
325325
{
326326
if (request.fHelp || request.params.size() != 3)
327327
throw runtime_error(
328-
"verifymessage \"bitcoinaddress\" \"signature\" \"message\"\n"
328+
"verifymessage \"address\" \"signature\" \"message\"\n"
329329
"\nVerify a signed message\n"
330330
"\nArguments:\n"
331-
"1. \"bitcoinaddress\" (string, required) The bitcoin address to use for the signature.\n"
331+
"1. \"address\" (string, required) The bitcoin address to use for the signature.\n"
332332
"2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n"
333333
"3. \"message\" (string, required) The message that was signed.\n"
334334
"\nResult:\n"
@@ -508,9 +508,9 @@ static const CRPCCommand commands[] =
508508
// --------------------- ------------------------ ----------------------- ----------
509509
{ "control", "getinfo", &getinfo, true, {} }, /* uses wallet if enabled */
510510
{ "control", "getmemoryinfo", &getmemoryinfo, true, {} },
511-
{ "util", "validateaddress", &validateaddress, true, {"bitcoinaddress"} }, /* uses wallet if enabled */
511+
{ "util", "validateaddress", &validateaddress, true, {"address"} }, /* uses wallet if enabled */
512512
{ "util", "createmultisig", &createmultisig, true, {"nrequired","keys"} },
513-
{ "util", "verifymessage", &verifymessage, true, {"bitcoinaddress","signature","message"} },
513+
{ "util", "verifymessage", &verifymessage, true, {"address","signature","message"} },
514514
{ "util", "signmessagewithprivkey", &signmessagewithprivkey, true, {"privkey","message"} },
515515

516516
/* Not shown in help */

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
174174
" \"reqSigs\" : n, (numeric) The required sigs\n"
175175
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
176176
" \"addresses\" : [ (json array of string)\n"
177-
" \"bitcoinaddress\" (string) bitcoin address\n"
177+
" \"address\" (string) bitcoin address\n"
178178
" ,...\n"
179179
" ]\n"
180180
" }\n"

src/wallet/rpcdump.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,11 @@ UniValue dumpprivkey(const JSONRPCRequest& request)
520520

521521
if (request.fHelp || request.params.size() != 1)
522522
throw runtime_error(
523-
"dumpprivkey \"bitcoinaddress\"\n"
524-
"\nReveals the private key corresponding to 'bitcoinaddress'.\n"
523+
"dumpprivkey \"address\"\n"
524+
"\nReveals the private key corresponding to 'address'.\n"
525525
"Then the importprivkey can be used with this output\n"
526526
"\nArguments:\n"
527-
"1. \"bitcoinaddress\" (string, required) The bitcoin address for the private key\n"
527+
"1. \"address\" (string, required) The bitcoin address for the private key\n"
528528
"\nResult:\n"
529529
"\"key\" (string) The private key\n"
530530
"\nExamples:\n"

0 commit comments

Comments
 (0)