diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -327,13 +327,13 @@ if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) { throw std::runtime_error( - "waitforblockheight (timeout)\n" + "waitforblockheight height ( timeout )\n" "\nWaits for (at least) block height and returns the height and " "hash\n" "of the current tip.\n" "\nReturns the current block on timeout or exit.\n" "\nArguments:\n" - "1. height (required, int) Block height to wait for (int)\n" + "1. height (int, required) Block height to wait for (int)\n" "2. timeout (int, optional, default=0) Time in milliseconds to " "wait for a response. 0 indicates no timeout.\n" "\nResult:\n" @@ -772,13 +772,13 @@ if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) { throw std::runtime_error( - "getblockheader \"hash\" ( verbose )\n" + "getblockheader \"blockhash\" ( verbose )\n" "\nIf verbose is false, returns a string that is serialized, " "hex-encoded data for blockheader 'hash'.\n" "If verbose is true, returns an Object with information about " "blockheader .\n" "\nArguments:\n" - "1. \"hash\" (string, required) The block hash\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" "\nResult (for verbose = true):\n" @@ -1048,7 +1048,7 @@ const JSONRPCRequest &request) { if (request.fHelp || request.params.size() != 1) { throw std::runtime_error( - "pruneblockchain\n" + "pruneblockchain height\n" "\nArguments:\n" "1. \"height\" (numeric, required) The block height to prune " "up to. May be set to a discrete height, or a unix timestamp\n" @@ -1859,7 +1859,7 @@ const JSONRPCRequest &request) { if (request.fHelp || request.params.size() > 2) { throw std::runtime_error( - "getchaintxstats ( nblocks blockhash )\n" + "getchaintxstats ( nblocks \"blockhash\" )\n" "\nCompute statistics about the total number and rate of " "transactions in the chain.\n" "\nArguments:\n" @@ -2363,7 +2363,7 @@ if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) { throw std::runtime_error( - "scantxoutset ( )\n" + "scantxoutset \"action\" [scanobjects,...]\n" "\nEXPERIMENTAL warning: this call may be removed or changed in " "future releases.\n" "\nScans the unspent transaction output set for entries that match " diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -269,7 +269,7 @@ const JSONRPCRequest &request) { if (request.fHelp || request.params.size() != 3) { throw std::runtime_error( - "prioritisetransaction \n" + "prioritisetransaction \"txid\" dummy fee_delta\n" "Accepts the transaction into mined blocks at a higher (or lower) " "priority\n" "\nArguments:\n" @@ -334,7 +334,7 @@ const JSONRPCRequest &request) { if (request.fHelp || request.params.size() > 1) { throw std::runtime_error( - "getblocktemplate ( TemplateRequest )\n" + "getblocktemplate ( \"template_request\" )\n" "\nIf the request parameters include a 'mode' key, that is used to " "explicitly select between the default 'template' request or a " "'proposal'.\n" diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -248,7 +248,7 @@ (strCommand != "onetry" && strCommand != "add" && strCommand != "remove")) { throw std::runtime_error( - "addnode \"node\" \"add|remove|onetry\"\n" + "addnode \"node\" \"command\"\n" "\nAttempts to add or remove a node from the addnode list.\n" "Or try a connection to a node once.\n" "Nodes added using addnode (or -connect) are protected from DoS " @@ -298,7 +298,7 @@ if (request.fHelp || request.params.size() == 0 || request.params.size() >= 3) { throw std::runtime_error( - "disconnectnode \"[address]\" [nodeid]\n" + "disconnectnode ( \"address\" nodeid )\n" "\nImmediately disconnects from the specified peer node.\n" "\nStrictly one out of 'address' and 'nodeid' can be provided to " "identify the node.\n" @@ -623,7 +623,7 @@ if (request.fHelp || request.params.size() < 2 || (strCommand != "add" && strCommand != "remove")) { throw std::runtime_error( - "setban \"subnet\" \"add|remove\" (bantime) (absolute)\n" + "setban \"subnet\" \"command\" ( bantime absolute )\n" "\nAttempts to add or remove a IP/Subnet from the banned list.\n" "\nArguments:\n" "1. \"subnet\" (string, required) The IP/Subnet (see " @@ -767,7 +767,7 @@ const JSONRPCRequest &request) { if (request.fHelp || request.params.size() != 1) { throw std::runtime_error( - "setnetworkactive true|false\n" + "setnetworkactive state\n" "\nDisable/enable all p2p network activity.\n" "\nArguments:\n" "1. \"state\" (boolean, required) true to " diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -331,7 +331,7 @@ static UniValue uptime(const Config &config, const JSONRPCRequest &jsonRequest) { - if (jsonRequest.fHelp || jsonRequest.params.size() > 1) { + if (jsonRequest.fHelp || jsonRequest.params.size() > 0) { throw std::runtime_error("uptime\n" "\nReturns the total uptime of the server.\n" "\nResult:\n" diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -409,7 +409,7 @@ if (request.fHelp || request.params.size() != 2) { throw std::runtime_error( - "importprunedfunds\n" + "importprunedfunds \"rawtransaction\" \"txoutproof\"\n" "\nImports funds without rescan. Corresponding address or script " "must previously be included in wallet. Aimed towards pruned " "wallets. The end-user is responsible to import additional " @@ -1410,8 +1410,8 @@ // clang-format off if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) { throw std::runtime_error( - "importmulti \"requests\" ( \"options\" )\n\n" - "Import addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n\n" + "importmulti \"requests\" ( \"options\" )\n" + "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n\n" "Arguments:\n" "1. requests (array, required) Data to be imported\n" " [ (array of json objects)\n" diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1099,7 +1099,7 @@ " The default is 1 if an account is " "provided or 0 if no account is provided\n") : std::string( - "getbalance ( \"(dummy)\" minconf include_watchonly )\n" + "getbalance ( \"dummy\" minconf include_watchonly )\n" "\nReturns the total available balance.\n" "The available balance is what the wallet considers " "currently spendable, and is\n" @@ -2206,7 +2206,7 @@ std::string help_text{}; if (!IsDeprecatedRPCEnabled(gArgs, "accounts")) { help_text = - "listtransactions (dummy count skip include_watchonly)\n" + "listtransactions ( \"dummy\" count skip include_watchonly)\n" "\nReturns up to 'count' most recent transactions skipping the " "first 'from' transactions for account 'account'.\n" "Note that the \"account\" argument and \"otheraccount\" return " diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py --- a/test/functional/feature_pruning.py +++ b/test/functional/feature_pruning.py @@ -310,7 +310,7 @@ return index def prune(index, expected_ret=None): - ret = node.pruneblockchain(height(index)) + ret = node.pruneblockchain(height=height(index)) # Check the return value. When use_timestamp is True, just check # that the return value is less than or equal to the expected # value, because when more than one block is generated per second, diff --git a/test/functional/mining_basic.py b/test/functional/mining_basic.py --- a/test/functional/mining_basic.py +++ b/test/functional/mining_basic.py @@ -30,7 +30,9 @@ if rehash: block.hashMerkleRoot = block.calc_merkle_root() rsp = node.getblocktemplate( - {'data': block.serialize().hex(), 'mode': 'proposal'}) + template_request={ + 'data': block.serialize().hex(), + 'mode': 'proposal'}) assert_equal(rsp, expect) diff --git a/test/functional/p2p_disconnect_ban.py b/test/functional/p2p_disconnect_ban.py --- a/test/functional/p2p_disconnect_ban.py +++ b/test/functional/p2p_disconnect_ban.py @@ -24,7 +24,7 @@ self.log.info("setban: successfully ban single IP address") # node1 should have 2 connections to node0 at this point assert_equal(len(self.nodes[1].getpeerinfo()), 2) - self.nodes[1].setban("127.0.0.1", "add") + self.nodes[1].setban(subnet="127.0.0.1", command="add") wait_until(lambda: len(self.nodes[1].getpeerinfo()) == 0, timeout=10) # all nodes must be disconnected at this point assert_equal(len(self.nodes[1].getpeerinfo()), 0) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -167,7 +167,7 @@ -8, "Block is not in main chain", self.nodes[0].getchaintxstats, blockhash=blockhash) self.nodes[0].reconsiderblock(blockhash) - chaintxstats = self.nodes[0].getchaintxstats(1) + chaintxstats = self.nodes[0].getchaintxstats(nblocks=1) # 200 txs plus genesis tx assert_equal(chaintxstats['txcount'], 201) # tx rate should be 1 per 10 minutes, or 1/600 @@ -250,7 +250,7 @@ besthash = node.getbestblockhash() secondbesthash = node.getblockhash(199) - header = node.getblockheader(besthash) + header = node.getblockheader(blockhash=besthash) assert_equal(header['hash'], besthash) assert_equal(header['height'], 200) @@ -364,7 +364,8 @@ def assert_waitforheight(height, timeout=2): assert_equal( - node.waitforblockheight(height, timeout)['height'], + node.waitforblockheight( + height=height, timeout=timeout)['height'], current_height) assert_waitforheight(0) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -84,13 +84,13 @@ assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) - self.nodes[0].setnetworkactive(False) + self.nodes[0].setnetworkactive(state=False) assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], False) # Wait a bit for all sockets to close wait_until(lambda: self.nodes[0].getnetworkinfo()[ 'connections'] == 0, timeout=3) - self.nodes[0].setnetworkactive(True) + self.nodes[0].setnetworkactive(state=True) connect_nodes_bi(self.nodes[0], self.nodes[1]) assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) @@ -99,7 +99,7 @@ assert_equal(self.nodes[0].getaddednodeinfo(), []) # add a node (node2) to node0 ip_port = "127.0.0.1:{}".format(p2p_port(2)) - self.nodes[0].addnode(ip_port, 'add') + self.nodes[0].addnode(node=ip_port, command='add') # check that the node has indeed been added added_nodes = self.nodes[0].getaddednodeinfo(ip_port) assert_equal(len(added_nodes), 1) diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -129,7 +129,7 @@ "pubkeys": [address['pubkey']], "internal": True }] - result = self.nodes[1].importmulti(request) + result = self.nodes[1].importmulti(requests=request) assert_equal(result[0]['success'], True) address_assert = self.nodes[1].getaddressinfo(address['address']) assert_equal(address_assert['iswatchonly'], True) @@ -145,7 +145,7 @@ "timestamp": "now", "pubkeys": [address['pubkey']] }] - result = self.nodes[1].importmulti(request) + result = self.nodes[1].importmulti(requests=request) assert_equal(result[0]['success'], False) assert_equal(result[0]['error']['code'], -8) assert_equal(result[0]['error']['message'], diff --git a/test/functional/wallet_importprunedfunds.py b/test/functional/wallet_importprunedfunds.py --- a/test/functional/wallet_importprunedfunds.py +++ b/test/functional/wallet_importprunedfunds.py @@ -82,7 +82,8 @@ # Import with affiliated address with no rescan self.nodes[1].importaddress(address=address2, rescan=False) - self.nodes[1].importprunedfunds(rawtxn2, proof2) + self.nodes[1].importprunedfunds( + rawtransaction=rawtxn2, txoutproof=proof2) assert [tx for tx in self.nodes[1].listtransactions( include_watchonly=True) if tx['txid'] == txnid2]