Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 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 wallet.""" | """Test the wallet.""" | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import * | from test_framework.util import * | ||||
from test_framework.mininode import * | from test_framework.mininode import * | ||||
class WalletTest(BitcoinTestFramework): | class WalletTest(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 = [ | self.extra_args = [ | ||||
['-usehd={:d}'.format(i % 2 == 0)] for i in range(4)] | ['-usehd={:d}'.format(i % 2 == 0), "-deprecatedrpc=signrawtransaction"] for i in range(4)] | ||||
def setup_network(self): | def setup_network(self): | ||||
self.add_nodes(4, self.extra_args) | self.add_nodes(4, self.extra_args) | ||||
self.start_node(0) | self.start_node(0) | ||||
self.start_node(1) | self.start_node(1) | ||||
self.start_node(2) | self.start_node(2) | ||||
connect_nodes_bi(self.nodes, 0, 1) | connect_nodes_bi(self.nodes, 0, 1) | ||||
connect_nodes_bi(self.nodes, 1, 2) | connect_nodes_bi(self.nodes, 1, 2) | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463 | # disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463 | ||||
# '-salvagewallet', | # '-salvagewallet', | ||||
] | ] | ||||
chainlimit = 6 | chainlimit = 6 | ||||
for m in maintenance: | for m in maintenance: | ||||
self.log.info("check " + m) | self.log.info("check " + m) | ||||
self.stop_nodes() | self.stop_nodes() | ||||
# set lower ancestor limit for later | # set lower ancestor limit for later | ||||
self.start_node(0, [m, "-limitancestorcount=" + str(chainlimit)]) | self.start_node(0, [m, "-limitancestorcount=" + | ||||
self.start_node(1, [m, "-limitancestorcount=" + str(chainlimit)]) | str(chainlimit), "-deprecatedrpc=signrawtransaction"]) | ||||
self.start_node(2, [m, "-limitancestorcount=" + str(chainlimit)]) | self.start_node(1, [m, "-limitancestorcount=" + | ||||
str(chainlimit), "-deprecatedrpc=signrawtransaction"]) | |||||
self.start_node(2, [m, "-limitancestorcount=" + | |||||
str(chainlimit), "-deprecatedrpc=signrawtransaction"]) | |||||
while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: | while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: | ||||
# reindex will leave rpc warm up "early"; Wait for it to finish | # reindex will leave rpc warm up "early"; Wait for it to finish | ||||
time.sleep(0.1) | time.sleep(0.1) | ||||
assert_equal(balance_nodes, [ | assert_equal(balance_nodes, [ | ||||
self.nodes[i].getbalance() for i in range(3)]) | self.nodes[i].getbalance() for i in range(3)]) | ||||
# Exercise listsinceblock with the last two blocks | # Exercise listsinceblock with the last two blocks | ||||
coinbase_tx_1 = self.nodes[0].listsinceblock(blocks[0]) | coinbase_tx_1 = self.nodes[0].listsinceblock(blocks[0]) | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |