Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_listsinceblock.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2017-2019 The Bitcoin Core developers | # Copyright (c) 2017-2019 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the listsincelast RPC.""" | """Test the listsincelast RPC.""" | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import assert_equal, assert_array_result, assert_raises_rpc_error | from test_framework.util import ( | ||||
assert_array_result, | |||||
assert_equal, | |||||
assert_raises_rpc_error, | |||||
connect_nodes, | |||||
) | |||||
class ListSinceBlockTest (BitcoinTestFramework): | class ListSinceBlockTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 4 | self.num_nodes = 4 | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.extra_args = [["-noparkdeepreorg"], ["-noparkdeepreorg"], [], []] | self.extra_args = [["-noparkdeepreorg"], ["-noparkdeepreorg"], [], []] | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
def run_test(self): | def run_test(self): | ||||
# All nodes are in IBD from genesis, so they'll need the miner (node2) to be an outbound connection, or have | |||||
# only one connection. (See fPreferredDownload in net_processing) | |||||
connect_nodes(self.nodes[1], self.nodes[2]) | |||||
self.nodes[2].generate(101) | self.nodes[2].generate(101) | ||||
self.sync_all() | self.sync_all() | ||||
self.test_no_blockhash() | self.test_no_blockhash() | ||||
self.test_invalid_blockhash() | self.test_invalid_blockhash() | ||||
self.test_reorg() | self.test_reorg() | ||||
self.test_double_spend() | self.test_double_spend() | ||||
self.test_double_send() | self.test_double_send() | ||||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |