Skip to content

Commit 4e7e2e1

Browse files
jnewberylaanwj
authored andcommitted
Update RPC argument names
1 parent 481f289 commit 4e7e2e1

File tree

8 files changed

+90
-90
lines changed

8 files changed

+90
-90
lines changed

qa/rpc-tests/rpcnamedargs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def run_test(self):
3939

4040
assert_raises_jsonrpc(-8, node.help, random='getinfo')
4141

42-
h = node.getblockhash(index=0)
43-
node.getblock(hash=h)
42+
h = node.getblockhash(height=0)
43+
node.getblock(blockhash=h)
4444

4545
assert_equal(node.echo(), [])
4646
assert_equal(node.echo(arg0=0,arg9=9), [0] + [None]*8 + [9])

src/rpc/blockchain.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ UniValue waitforblock(const JSONRPCRequest& request)
232232
{
233233
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
234234
throw runtime_error(
235-
"waitforblock <hash> (timeout)\n"
235+
"waitforblock <blockhash> (timeout)\n"
236236
"\nWaits for a specific new block and returns useful info about it.\n"
237237
"\nReturns the current block on timeout or exit.\n"
238238
"\nArguments:\n"
239-
"1. hash (string) Block hash to wait for.\n"
240-
"2. timeout (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\n"
239+
"1. \"blockhash\" (required, string) Block hash to wait for.\n"
240+
"2. timeout (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\n"
241241
"\nResult:\n"
242242
"{ (json object)\n"
243243
" \"hash\" : { (string) The blockhash\n"
@@ -274,12 +274,12 @@ UniValue waitforblockheight(const JSONRPCRequest& request)
274274
{
275275
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
276276
throw runtime_error(
277-
"waitforblockheight <blockheight> (timeout)\n"
277+
"waitforblockheight <height> (timeout)\n"
278278
"\nWaits for (at least) block height and returns the height and hash\n"
279279
"of the current tip.\n"
280280
"\nReturns the current block on timeout or exit.\n"
281281
"\nArguments:\n"
282-
"1. block height to wait for (int)\n"
282+
"1. height (required, int) Block height to wait for (int)\n"
283283
"2. timeout (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\n"
284284
"\nResult:\n"
285285
"{ (json object)\n"
@@ -418,7 +418,7 @@ UniValue getrawmempool(const JSONRPCRequest& request)
418418
"getrawmempool ( verbose )\n"
419419
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
420420
"\nArguments:\n"
421-
"1. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n"
421+
"1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n"
422422
"\nResult: (for verbose = false):\n"
423423
"[ (json array of string)\n"
424424
" \"transactionid\" (string) The transaction id\n"
@@ -449,8 +449,8 @@ UniValue getmempoolancestors(const JSONRPCRequest& request)
449449
"getmempoolancestors txid (verbose)\n"
450450
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n"
451451
"\nArguments:\n"
452-
"1. \"txid\" (string, required) The transaction id (must be in mempool)\n"
453-
"2. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n"
452+
"1. \"txid\" (string, required) The transaction id (must be in mempool)\n"
453+
"2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n"
454454
"\nResult (for verbose=false):\n"
455455
"[ (json array of strings)\n"
456456
" \"transactionid\" (string) The transaction id of an in-mempool ancestor transaction\n"
@@ -513,8 +513,8 @@ UniValue getmempooldescendants(const JSONRPCRequest& request)
513513
"getmempooldescendants txid (verbose)\n"
514514
"\nIf txid is in the mempool, returns all in-mempool descendants.\n"
515515
"\nArguments:\n"
516-
"1. \"txid\" (string, required) The transaction id (must be in mempool)\n"
517-
"2. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n"
516+
"1. \"txid\" (string, required) The transaction id (must be in mempool)\n"
517+
"2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n"
518518
"\nResult (for verbose=false):\n"
519519
"[ (json array of strings)\n"
520520
" \"transactionid\" (string) The transaction id of an in-mempool descendant transaction\n"
@@ -607,10 +607,10 @@ UniValue getblockhash(const JSONRPCRequest& request)
607607
{
608608
if (request.fHelp || request.params.size() != 1)
609609
throw runtime_error(
610-
"getblockhash index\n"
611-
"\nReturns hash of block in best-block-chain at index provided.\n"
610+
"getblockhash height\n"
611+
"\nReturns hash of block in best-block-chain at height provided.\n"
612612
"\nArguments:\n"
613-
"1. index (numeric, required) The block index\n"
613+
"1. height (numeric, required) The height index\n"
614614
"\nResult:\n"
615615
"\"hash\" (string) The block hash\n"
616616
"\nExamples:\n"
@@ -691,12 +691,12 @@ UniValue getblock(const JSONRPCRequest& request)
691691
{
692692
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
693693
throw runtime_error(
694-
"getblock \"hash\" ( verbose )\n"
694+
"getblock \"blockhash\" ( verbose )\n"
695695
"\nIf verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
696696
"If verbose is true, returns an Object with information about block <hash>.\n"
697697
"\nArguments:\n"
698-
"1. \"hash\" (string, required) The block hash\n"
699-
"2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n"
698+
"1. \"blockhash\" (string, required) The block hash\n"
699+
"2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n"
700700
"\nResult (for verbose = true):\n"
701701
"{\n"
702702
" \"hash\" : \"hash\", (string) the block hash (same as provided)\n"
@@ -1257,12 +1257,12 @@ UniValue preciousblock(const JSONRPCRequest& request)
12571257
{
12581258
if (request.fHelp || request.params.size() != 1)
12591259
throw runtime_error(
1260-
"preciousblock \"hash\"\n"
1260+
"preciousblock \"blockhash\"\n"
12611261
"\nTreats a block as if it were received before others with the same work.\n"
12621262
"\nA later preciousblock call can override the effect of an earlier one.\n"
12631263
"\nThe effects of preciousblock are not retained across restarts.\n"
12641264
"\nArguments:\n"
1265-
"1. hash (string, required) the hash of the block to mark as precious\n"
1265+
"1. \"blockhash\" (string, required) the hash of the block to mark as precious\n"
12661266
"\nResult:\n"
12671267
"\nExamples:\n"
12681268
+ HelpExampleCli("preciousblock", "\"blockhash\"")
@@ -1295,10 +1295,10 @@ UniValue invalidateblock(const JSONRPCRequest& request)
12951295
{
12961296
if (request.fHelp || request.params.size() != 1)
12971297
throw runtime_error(
1298-
"invalidateblock \"hash\"\n"
1298+
"invalidateblock \"blockhash\"\n"
12991299
"\nPermanently marks a block as invalid, as if it violated a consensus rule.\n"
13001300
"\nArguments:\n"
1301-
"1. hash (string, required) the hash of the block to mark as invalid\n"
1301+
"1. \"blockhash\" (string, required) the hash of the block to mark as invalid\n"
13021302
"\nResult:\n"
13031303
"\nExamples:\n"
13041304
+ HelpExampleCli("invalidateblock", "\"blockhash\"")
@@ -1333,11 +1333,11 @@ UniValue reconsiderblock(const JSONRPCRequest& request)
13331333
{
13341334
if (request.fHelp || request.params.size() != 1)
13351335
throw runtime_error(
1336-
"reconsiderblock \"hash\"\n"
1336+
"reconsiderblock \"blockhash\"\n"
13371337
"\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\n"
13381338
"This can be used to undo the effects of invalidateblock.\n"
13391339
"\nArguments:\n"
1340-
"1. hash (string, required) the hash of the block to reconsider\n"
1340+
"1. \"blockhash\" (string, required) the hash of the block to reconsider\n"
13411341
"\nResult:\n"
13421342
"\nExamples:\n"
13431343
+ HelpExampleCli("reconsiderblock", "\"blockhash\"")
@@ -1372,9 +1372,9 @@ static const CRPCCommand commands[] =
13721372
{ "blockchain", "getblockchaininfo", &getblockchaininfo, true, {} },
13731373
{ "blockchain", "getbestblockhash", &getbestblockhash, true, {} },
13741374
{ "blockchain", "getblockcount", &getblockcount, true, {} },
1375-
{ "blockchain", "getblock", &getblock, true, {"hash","verbose"} },
1376-
{ "blockchain", "getblockhash", &getblockhash, true, {"index"} },
1377-
{ "blockchain", "getblockheader", &getblockheader, true, {"hash","verbose"} },
1375+
{ "blockchain", "getblock", &getblock, true, {"blockhash","verbose"} },
1376+
{ "blockchain", "getblockhash", &getblockhash, true, {"height"} },
1377+
{ "blockchain", "getblockheader", &getblockheader, true, {"blockhash","verbose"} },
13781378
{ "blockchain", "getchaintips", &getchaintips, true, {} },
13791379
{ "blockchain", "getdifficulty", &getdifficulty, true, {} },
13801380
{ "blockchain", "getmempoolancestors", &getmempoolancestors, true, {"txid","verbose"} },
@@ -1386,13 +1386,13 @@ static const CRPCCommand commands[] =
13861386
{ "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true, {} },
13871387
{ "blockchain", "verifychain", &verifychain, true, {"checklevel","nblocks"} },
13881388

1389-
{ "blockchain", "preciousblock", &preciousblock, true, {"hash"} },
1389+
{ "blockchain", "preciousblock", &preciousblock, true, {"blockhash"} },
13901390

13911391
/* Not shown in help */
1392-
{ "hidden", "invalidateblock", &invalidateblock, true, {"hash"} },
1393-
{ "hidden", "reconsiderblock", &reconsiderblock, true, {"hash"} },
1392+
{ "hidden", "invalidateblock", &invalidateblock, true, {"blockhash"} },
1393+
{ "hidden", "reconsiderblock", &reconsiderblock, true, {"blockhash"} },
13941394
{ "hidden", "waitfornewblock", &waitfornewblock, true, {"timeout"} },
1395-
{ "hidden", "waitforblock", &waitforblock, true, {"hash","timeout"} },
1395+
{ "hidden", "waitforblock", &waitforblock, true, {"blockhash","timeout"} },
13961396
{ "hidden", "waitforblockheight", &waitforblockheight, true, {"height","timeout"} },
13971397
};
13981398

src/rpc/client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
5151
{ "listreceivedbyaccount", 2, "include_watchonly" },
5252
{ "getbalance", 1, "minconf" },
5353
{ "getbalance", 2, "include_watchonly" },
54-
{ "getblockhash", 0, "index" },
54+
{ "getblockhash", 0, "height" },
5555
{ "waitforblockheight", 0, "height" },
5656
{ "waitforblockheight", 1, "timeout" },
5757
{ "waitforblock", 1, "timeout" },
@@ -61,7 +61,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
6161
{ "sendfrom", 2, "amount" },
6262
{ "sendfrom", 3, "minconf" },
6363
{ "listtransactions", 1, "count" },
64-
{ "listtransactions", 2, "from" },
64+
{ "listtransactions", 2, "skip" },
6565
{ "listtransactions", 3, "include_watchonly" },
6666
{ "listaccounts", 0, "minconf" },
6767
{ "listaccounts", 1, "include_watchonly" },

src/rpc/mining.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ UniValue getnetworkhashps(const JSONRPCRequest& request)
8484
"Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
8585
"\nArguments:\n"
8686
"1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
87-
"2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
87+
"2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
8888
"\nResult:\n"
8989
"x (numeric) Hashes per second estimated\n"
9090
"\nExamples:\n"
@@ -153,7 +153,7 @@ UniValue generate(const JSONRPCRequest& request)
153153
"generate nblocks ( maxtries )\n"
154154
"\nMine up to nblocks blocks immediately (before the RPC call returns)\n"
155155
"\nArguments:\n"
156-
"1. nblocks (numeric, required) How many blocks are generated immediately.\n"
156+
"1. nblocks (numeric, required) How many blocks are generated immediately.\n"
157157
"2. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n"
158158
"\nResult:\n"
159159
"[ blockhashes ] (array) hashes of blocks generated\n"
@@ -189,8 +189,8 @@ UniValue generatetoaddress(const JSONRPCRequest& request)
189189
"generatetoaddress nblocks address (maxtries)\n"
190190
"\nMine blocks immediately to a specified address (before the RPC call returns)\n"
191191
"\nArguments:\n"
192-
"1. nblocks (numeric, required) How many blocks are generated immediately.\n"
193-
"2. address (string, required) The address to send the newly generated bitcoin to.\n"
192+
"1. nblocks (numeric, required) How many blocks are generated immediately.\n"
193+
"2. address (string, required) The address to send the newly generated bitcoin to.\n"
194194
"3. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n"
195195
"\nResult:\n"
196196
"[ blockhashes ] (array) hashes of blocks generated\n"
@@ -264,10 +264,10 @@ UniValue prioritisetransaction(const JSONRPCRequest& request)
264264
"Accepts the transaction into mined blocks at a higher (or lower) priority\n"
265265
"\nArguments:\n"
266266
"1. \"txid\" (string, required) The transaction id.\n"
267-
"2. priority delta (numeric, required) The priority to add or subtract.\n"
267+
"2. priority_delta (numeric, required) The priority to add or subtract.\n"
268268
" The transaction selection algorithm considers the tx as it would have a higher priority.\n"
269269
" (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n"
270-
"3. fee delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n"
270+
"3. fee_delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n"
271271
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
272272
" considers the transaction as it would have paid a higher (or lower) fee.\n"
273273
"\nResult:\n"
@@ -717,8 +717,8 @@ UniValue submitblock(const JSONRPCRequest& request)
717717
"The 'jsonparametersobject' parameter is currently ignored.\n"
718718
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
719719

720-
"\nArguments:\n"
721-
"1. \"hexdata\" (string, required) the hex-encoded block data to submit\n"
720+
"\nArguments\n"
721+
"1. \"hexdata\" (string, required) the hex-encoded block data to submit\n"
722722
"2. \"parameters\" (string, optional) object of optional parameters\n"
723723
" {\n"
724724
" \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n"
@@ -781,7 +781,7 @@ UniValue estimatefee(const JSONRPCRequest& request)
781781
"\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
782782
"confirmation within nblocks blocks.\n"
783783
"\nArguments:\n"
784-
"1. nblocks (numeric)\n"
784+
"1. nblocks (numeric, required)\n"
785785
"\nResult:\n"
786786
"n (numeric) estimated fee-per-kilobyte\n"
787787
"\n"
@@ -814,7 +814,7 @@ UniValue estimatepriority(const JSONRPCRequest& request)
814814
"\nDEPRECATED. Estimates the approximate priority a zero-fee transaction needs to begin\n"
815815
"confirmation within nblocks blocks.\n"
816816
"\nArguments:\n"
817-
"1. nblocks (numeric)\n"
817+
"1. nblocks (numeric, required)\n"
818818
"\nResult:\n"
819819
"n (numeric) estimated priority\n"
820820
"\n"
@@ -879,7 +879,7 @@ UniValue estimatesmartpriority(const JSONRPCRequest& request)
879879
"confirmation within nblocks blocks if possible and return the number of blocks\n"
880880
"for which the estimate is valid.\n"
881881
"\nArguments:\n"
882-
"1. nblocks (numeric)\n"
882+
"1. nblocks (numeric, required)\n"
883883
"\nResult:\n"
884884
"{\n"
885885
" \"priority\" : x.x, (numeric) estimated priority\n"

src/rpc/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ UniValue verifymessage(const JSONRPCRequest& request)
328328
"verifymessage \"address\" \"signature\" \"message\"\n"
329329
"\nVerify a signed message\n"
330330
"\nArguments:\n"
331-
"1. \"address\" (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"

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ UniValue setban(const JSONRPCRequest& request)
471471
"setban \"subnet\" \"add|remove\" (bantime) (absolute)\n"
472472
"\nAttempts add or remove a IP/Subnet from the banned list.\n"
473473
"\nArguments:\n"
474-
"1. \"subnet\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n"
474+
"1. \"subnet\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n"
475475
"2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n"
476476
"3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n"
477477
"4. \"absolute\" (boolean, optional) If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n"

0 commit comments

Comments
 (0)