mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 01:04:43 +02:00
rpc: Correctly name arguments
This commit is contained in:
@@ -249,7 +249,7 @@ class PruneTest(BitcoinTestFramework):
|
||||
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,
|
||||
|
||||
@@ -30,9 +30,10 @@ from test_framework.util import (
|
||||
def assert_template(node, block, expect, rehash=True):
|
||||
if rehash:
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal'})
|
||||
rsp = node.getblocktemplate(template_request={'data': b2x(block.serialize()), 'mode': 'proposal'})
|
||||
assert_equal(rsp, expect)
|
||||
|
||||
|
||||
class MiningTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 2
|
||||
|
||||
@@ -22,7 +22,7 @@ class DisconnectBanTest(BitcoinTestFramework):
|
||||
|
||||
self.log.info("setban: successfully ban single IP address")
|
||||
assert_equal(len(self.nodes[1].getpeerinfo()), 2) # node1 should have 2 connections to node0 at this point
|
||||
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)
|
||||
assert_equal(len(self.nodes[1].getpeerinfo()), 0) # all nodes must be disconnected at this point
|
||||
assert_equal(len(self.nodes[1].listbanned()), 1)
|
||||
|
||||
@@ -133,7 +133,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-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
|
||||
@@ -211,7 +211,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
|
||||
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)
|
||||
@@ -287,7 +287,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
|
||||
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)
|
||||
|
||||
@@ -74,12 +74,12 @@ class NetTest(BitcoinTestFramework):
|
||||
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, 1)
|
||||
assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True)
|
||||
assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2)
|
||||
@@ -88,7 +88,7 @@ class NetTest(BitcoinTestFramework):
|
||||
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)
|
||||
|
||||
@@ -152,7 +152,7 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
"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)
|
||||
@@ -167,7 +167,7 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
"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'], 'Internal must be set to true for nonstandard scriptPubKey imports.')
|
||||
|
||||
@@ -81,7 +81,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
|
||||
|
||||
# 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]
|
||||
|
||||
# Import with private key with no rescan
|
||||
|
||||
Reference in New Issue
Block a user