Skip to content

Commit f02bf18

Browse files
UdjinM6PastaPastaPasta
authored andcommitted
Other fixes
1 parent 23114cd commit f02bf18

File tree

11 files changed

+29
-39
lines changed

11 files changed

+29
-39
lines changed

test/functional/dip3-deterministicmns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def __init__(self):
2626
self.extra_args += ["-sporkkey=cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK"]
2727
self.extra_args += ["-dip3params=135:150"]
2828

29+
30+
def setup_network(self):
2931
disable_mocktime()
3032
self.start_controller_node()
3133

test/functional/fundrawtransaction-hd.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@ def __init__(self):
1313
super().__init__()
1414
self.setup_clean_chain = True
1515
self.num_nodes = 4
16+
self.extra_args = [['-usehd=1']] * self.num_nodes
1617

17-
def setup_network(self, split=False):
18-
self.nodes = start_nodes(4, self.options.tmpdir, [['-usehd=1']] * self.num_nodes, stderr=sys.stdout)
19-
18+
def setup_network(self):
19+
self.setup_nodes(stderr=sys.stdout)
2020
connect_nodes_bi(self.nodes,0,1)
2121
connect_nodes_bi(self.nodes,1,2)
2222
connect_nodes_bi(self.nodes,0,2)
2323
connect_nodes_bi(self.nodes,0,3)
2424

25-
self.is_network_split=False
26-
self.sync_all()
27-
2825
def run_test(self):
2926
self.log.info("Mining blocks...")
3027

@@ -456,7 +453,6 @@ def run_test(self):
456453
connect_nodes_bi(self.nodes,1,2)
457454
connect_nodes_bi(self.nodes,0,2)
458455
connect_nodes_bi(self.nodes,0,3)
459-
self.is_network_split=False
460456
self.sync_all()
461457

462458
# drain the keypool

test/functional/fundrawtransaction.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ def __init__(self):
2121
super().__init__()
2222
self.setup_clean_chain = True
2323
self.num_nodes = 4
24+
self.extra_args = [['-usehd=0']] * self.num_nodes
2425

2526
def setup_network(self, split=False):
26-
self.setup_nodes([['-usehd=0']] * self.num_nodes)
27+
self.setup_nodes()
2728

2829
connect_nodes_bi(self.nodes, 0, 1)
2930
connect_nodes_bi(self.nodes, 1, 2)

test/functional/listtransactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self):
2323

2424
def setup_nodes(self):
2525
#This test requires mocktime
26-
enable_mocktime()
26+
set_cache_mocktime()
2727
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
2828

2929
def run_test(self):

test/functional/p2p-compactblocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self):
9595
self.setup_clean_chain = True
9696
# both nodes has the same version
9797
self.num_nodes = 2
98-
self.extra_args = [["-txindex"]]
98+
self.extra_args = [["-txindex"]] * 2
9999
self.utxos = []
100100

101101
def build_block_on_tip(self, node):

test/functional/p2p-fingerprint.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ def set_test_params(self):
4040
self.setup_clean_chain = True
4141
self.num_nodes = 1
4242

43-
# TODO also remove this when bitcoin#11121 is backported
44-
def setup_network(self, split=False):
45-
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
46-
self.is_network_split = False
47-
4843
# Build a chain of blocks on top of given one
4944
def build_chain(self, nblocks, prev_hash, prev_height, prev_median_time):
5045
blocks = []

test/functional/prioritise_transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self):
1414
super().__init__()
1515
self.setup_clean_chain = True
1616
self.num_nodes = 2
17-
self.extra_args = [["-printpriority=1"] * 2]
17+
self.extra_args = [["-printpriority=1"]] * 2
1818

1919
def run_test(self):
2020
self.txouts = gen_return_txouts()

test/functional/receivedby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self):
3131

3232
def setup_nodes(self):
3333
#This test requires mocktime
34-
enable_mocktime()
34+
set_cache_mocktime()
3535
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
3636

3737
def run_test(self):

test/functional/test_framework/test_framework.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,29 @@
1717
from concurrent.futures import ThreadPoolExecutor
1818

1919
from .util import (
20-
assert_equal,
21-
start_nodes,
2220
PortSeed,
21+
GENESISTIME,
2322
MAX_NODES,
23+
assert_equal,
2424
bitcoind_processes,
2525
check_json_precision,
2626
connect_nodes_bi,
2727
connect_nodes,
28+
copy_datadir,
2829
disable_mocktime,
2930
disconnect_nodes,
3031
enable_coverage,
31-
enable_mocktime,
3232
get_mocktime,
3333
get_rpc_proxy,
3434
initialize_datadir,
3535
log_filename,
3636
p2p_port,
3737
rpc_url,
38+
set_cache_mocktime,
39+
set_genesis_mocktime,
40+
set_mocktime,
3841
set_node_times,
42+
satoshi_round,
3943
start_node,
4044
start_nodes,
4145
stop_node,
@@ -44,15 +48,7 @@
4448
sync_mempools,
4549
sync_masternodes,
4650
wait_for_bitcoind_start,
47-
set_cache_mocktime,
48-
set_genesis_mocktime,
49-
get_mocktime,
50-
set_mocktime,
51-
set_node_times,
52-
p2p_port,
53-
satoshi_round,
54-
wait_to_sync,
55-
copy_datadir)
51+
wait_to_sync)
5652
from .authproxy import JSONRPCException
5753

5854
class BitcoinTestFramework(object):

test/functional/wallet-accounts.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def __init__(self):
2525
super().__init__()
2626
self.setup_clean_chain = True
2727
self.num_nodes = 1
28-
self.extra_args = [[]]
28+
self.extra_args = [["-paytxfee=0.0001"]]
2929

3030
def run_test(self):
3131
node = self.nodes[0]
3232
# Check that there's no UTXO on any of the nodes
3333
assert_equal(len(node.listunspent()), 0)
3434

3535
# Note each time we call generate, all generated coins go into
36-
# the same address, so we call twice to get two addresses w/50 each
36+
# the same address, so we call twice to get two addresses w/500 each
3737
node.generate(1)
3838
node.generate(101)
3939
assert_equal(node.getbalance(), 1000)
@@ -57,9 +57,11 @@ def run_test(self):
5757
common_address = "yd5KMREs3GLMe6mTJYr3YrH1juwNwrFCfB"
5858
txid = node.sendmany(
5959
fromaccount="",
60-
amounts={common_address: 100},
61-
subtractfeefrom=[common_address],
60+
amounts={common_address: 1000},
6261
minconf=1,
62+
addlocked=False,
63+
comment="",
64+
subtractfeefrom=[common_address],
6365
)
6466
tx_details = node.gettransaction(txid)
6567
fee = -tx_details['details'][0]['fee']

0 commit comments

Comments
 (0)