Skip to content

Commit 914faf1

Browse files
committed
Merge #14805: tests: Support calling add_nodes more than once
98a1846 tests: Support calling add_nodes more than once (Steven Roose) Pull request description: Ran into this while writing [a multi-chain test for Elements](ElementsProject/elements#458) where I call this method more than once. Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
2 parents 20c54ee + 98a1846 commit 914faf1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ def add_nodes(self, num_nodes, extra_args=None, *, rpchost=None, binary=None):
294294
assert_equal(len(extra_args), num_nodes)
295295
assert_equal(len(binary), num_nodes)
296296
for i in range(num_nodes):
297-
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))
297+
numnode = len(self.nodes)
298+
self.nodes.append(TestNode(numnode, get_datadir_path(self.options.tmpdir, numnode), 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))
298299

299300
def start_node(self, i, *args, **kwargs):
300301
"""Start a bitcoind"""

0 commit comments

Comments
 (0)