Skip to content

Commit fa4b8c9

Browse files
author
MarcoFalke
committed
test: add_nodes can only be called once after set_test_params
1 parent faa8311 commit fa4b8c9

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ def run_test(self):
279279
# Public helper methods. These can be accessed by the subclass test scripts.
280280

281281
def add_nodes(self, num_nodes, extra_args=None, *, rpchost=None, binary=None):
282-
"""Instantiate TestNode objects"""
282+
"""Instantiate TestNode objects.
283+
284+
Should only be called once after the nodes have been specified in
285+
set_test_params()."""
283286
if self.bind_to_localhost_only:
284287
extra_confs = [["bind=127.0.0.1"]] * num_nodes
285288
else:
@@ -292,7 +295,19 @@ def add_nodes(self, num_nodes, extra_args=None, *, rpchost=None, binary=None):
292295
assert_equal(len(extra_args), num_nodes)
293296
assert_equal(len(binary), num_nodes)
294297
for i in range(num_nodes):
295-
self.nodes.append(TestNode(i, get_datadir_path(self.options.tmpdir, i), rpchost=rpchost, timewait=self.rpc_timewait, bitcoind=binary[i], bitcoin_cli=self.options.bitcoincli, mocktime=self.mocktime, coverage_dir=self.options.coveragedir, extra_conf=extra_confs[i], extra_args=extra_args[i], use_cli=self.options.usecli))
298+
self.nodes.append(TestNode(
299+
i,
300+
get_datadir_path(self.options.tmpdir, i),
301+
rpchost=rpchost,
302+
timewait=self.rpc_timewait,
303+
bitcoind=binary[i],
304+
bitcoin_cli=self.options.bitcoincli,
305+
mocktime=self.mocktime,
306+
coverage_dir=self.options.coveragedir,
307+
extra_conf=extra_confs[i],
308+
extra_args=extra_args[i],
309+
use_cli=self.options.usecli,
310+
))
296311

297312
def start_node(self, i, *args, **kwargs):
298313
"""Start a bitcoind"""

0 commit comments

Comments
 (0)