Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_basic.py
Show All 9 Lines | |||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import ( | ||||
assert_array_result, | assert_array_result, | ||||
assert_equal, | assert_equal, | ||||
assert_fee_amount, | assert_fee_amount, | ||||
assert_raises_rpc_error, | assert_raises_rpc_error, | ||||
connect_nodes_bi, | connect_nodes_bi, | ||||
count_bytes, | count_bytes, | ||||
sync_blocks, | |||||
wait_until, | wait_until, | ||||
) | ) | ||||
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 | ||||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# restart the nodes with -walletbroadcast=1 | # restart the nodes with -walletbroadcast=1 | ||||
self.stop_nodes() | self.stop_nodes() | ||||
self.start_node(0, self.extra_args[0]) | self.start_node(0, self.extra_args[0]) | ||||
self.start_node(1, self.extra_args[1]) | self.start_node(1, self.extra_args[1]) | ||||
self.start_node(2, self.extra_args[2]) | self.start_node(2, self.extra_args[2]) | ||||
connect_nodes_bi(self.nodes[0], self.nodes[1]) | connect_nodes_bi(self.nodes[0], self.nodes[1]) | ||||
connect_nodes_bi(self.nodes[1], self.nodes[2]) | connect_nodes_bi(self.nodes[1], self.nodes[2]) | ||||
connect_nodes_bi(self.nodes[0], self.nodes[2]) | connect_nodes_bi(self.nodes[0], self.nodes[2]) | ||||
sync_blocks(self.nodes[0:3]) | self.sync_blocks(self.nodes[0:3]) | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
sync_blocks(self.nodes[0:3]) | self.sync_blocks(self.nodes[0:3]) | ||||
node_2_bal += 2 | node_2_bal += 2 | ||||
# tx should be added to balance because after restarting the nodes tx | # tx should be added to balance because after restarting the nodes tx | ||||
# should be broadcasted | # should be broadcasted | ||||
assert_equal(self.nodes[2].getbalance(), node_2_bal) | assert_equal(self.nodes[2].getbalance(), node_2_bal) | ||||
# send a tx with value in a string (PR#6380 +) | # send a tx with value in a string (PR#6380 +) | ||||
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "2") | txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "2") | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |