mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 12:42:05 +02:00
test: Start only the number of nodes that are needed
This commit is contained in:
@ -11,9 +11,10 @@ from test_framework.util import (
|
|||||||
)
|
)
|
||||||
from test_framework.messages import CTransaction, COIN
|
from test_framework.messages import CTransaction, COIN
|
||||||
|
|
||||||
|
|
||||||
class TxnMallTest(BitcoinTestFramework):
|
class TxnMallTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 3
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
@ -38,7 +39,7 @@ class TxnMallTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
# All nodes should start with 1,250 BTC:
|
# All nodes should start with 1,250 BTC:
|
||||||
starting_balance = 1250
|
starting_balance = 1250
|
||||||
for i in range(4):
|
for i in range(3):
|
||||||
assert_equal(self.nodes[i].getbalance(), starting_balance)
|
assert_equal(self.nodes[i].getbalance(), starting_balance)
|
||||||
self.nodes[i].getnewaddress() # bug workaround, coins generated assigned to first getnewaddress!
|
self.nodes[i].getnewaddress() # bug workaround, coins generated assigned to first getnewaddress!
|
||||||
|
|
||||||
@ -139,5 +140,6 @@ class TxnMallTest(BitcoinTestFramework):
|
|||||||
expected -= 50
|
expected -= 50
|
||||||
assert_equal(self.nodes[0].getbalance(), expected)
|
assert_equal(self.nodes[0].getbalance(), expected)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
TxnMallTest().main()
|
TxnMallTest().main()
|
||||||
|
@ -11,9 +11,10 @@ from test_framework.util import (
|
|||||||
find_output,
|
find_output,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TxnMallTest(BitcoinTestFramework):
|
class TxnMallTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 3
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
@ -39,7 +40,7 @@ class TxnMallTest(BitcoinTestFramework):
|
|||||||
for n in self.nodes:
|
for n in self.nodes:
|
||||||
assert n.getblockchaininfo()["initialblockdownload"] == False
|
assert n.getblockchaininfo()["initialblockdownload"] == False
|
||||||
|
|
||||||
for i in range(4):
|
for i in range(3):
|
||||||
assert_equal(self.nodes[i].getbalance(), starting_balance)
|
assert_equal(self.nodes[i].getbalance(), starting_balance)
|
||||||
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!
|
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!
|
||||||
|
|
||||||
@ -136,5 +137,6 @@ class TxnMallTest(BitcoinTestFramework):
|
|||||||
# Node1's balance should be its initial balance (1250 for 25 block rewards) plus the doublespend:
|
# Node1's balance should be its initial balance (1250 for 25 block rewards) plus the doublespend:
|
||||||
assert_equal(self.nodes[1].getbalance(), 1250 + 1240)
|
assert_equal(self.nodes[1].getbalance(), 1250 + 1240)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
TxnMallTest().main()
|
TxnMallTest().main()
|
||||||
|
Reference in New Issue
Block a user