Skip to content

Commit faabce7

Browse files
author
MarcoFalke
committed
test: Start only the number of nodes that are needed
1 parent 9bbf08b commit faabce7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/functional/wallet_txn_clone.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
)
1212
from test_framework.messages import CTransaction, COIN
1313

14+
1415
class TxnMallTest(BitcoinTestFramework):
1516
def set_test_params(self):
16-
self.num_nodes = 4
17+
self.num_nodes = 3
1718
self.supports_cli = False
1819

1920
def skip_test_if_missing_module(self):
@@ -38,7 +39,7 @@ def run_test(self):
3839

3940
# All nodes should start with 1,250 BTC:
4041
starting_balance = 1250
41-
for i in range(4):
42+
for i in range(3):
4243
assert_equal(self.nodes[i].getbalance(), starting_balance)
4344
self.nodes[i].getnewaddress() # bug workaround, coins generated assigned to first getnewaddress!
4445

@@ -139,5 +140,6 @@ def run_test(self):
139140
expected -= 50
140141
assert_equal(self.nodes[0].getbalance(), expected)
141142

143+
142144
if __name__ == '__main__':
143145
TxnMallTest().main()

test/functional/wallet_txn_doublespend.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
find_output,
1212
)
1313

14+
1415
class TxnMallTest(BitcoinTestFramework):
1516
def set_test_params(self):
16-
self.num_nodes = 4
17+
self.num_nodes = 3
1718
self.supports_cli = False
1819

1920
def skip_test_if_missing_module(self):
@@ -39,7 +40,7 @@ def run_test(self):
3940
for n in self.nodes:
4041
assert n.getblockchaininfo()["initialblockdownload"] == False
4142

42-
for i in range(4):
43+
for i in range(3):
4344
assert_equal(self.nodes[i].getbalance(), starting_balance)
4445
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!
4546

@@ -136,5 +137,6 @@ def run_test(self):
136137
# Node1's balance should be its initial balance (1250 for 25 block rewards) plus the doublespend:
137138
assert_equal(self.nodes[1].getbalance(), 1250 + 1240)
138139

140+
139141
if __name__ == '__main__':
140142
TxnMallTest().main()

0 commit comments

Comments
 (0)