diff --git a/test/functional/dip4-coinbasemerkleroots.py b/test/functional/dip4-coinbasemerkleroots.py index b4f41bca2..c5dbfb99a 100755 --- a/test/functional/dip4-coinbasemerkleroots.py +++ b/test/functional/dip4-coinbasemerkleroots.py @@ -37,8 +37,8 @@ class TestNode(NodeConnCB): class LLMQCoinbaseCommitmentsTest(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) def run_test(self): self.test_node = TestNode() diff --git a/test/functional/llmq-chainlocks.py b/test/functional/llmq-chainlocks.py index 90a9771f3..5adff69be 100755 --- a/test/functional/llmq-chainlocks.py +++ b/test/functional/llmq-chainlocks.py @@ -17,8 +17,8 @@ Checks LLMQs based ChainLocks ''' class LLMQChainLocksTest(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) def run_test(self): diff --git a/test/functional/llmq-dkgerrors.py b/test/functional/llmq-dkgerrors.py index 4dc9ea325..1400d730d 100755 --- a/test/functional/llmq-dkgerrors.py +++ b/test/functional/llmq-dkgerrors.py @@ -14,8 +14,8 @@ Simulate and check DKG errors ''' class LLMQDKGErrors(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) def run_test(self): diff --git a/test/functional/llmq-is-cl-conflicts.py b/test/functional/llmq-is-cl-conflicts.py index 066628b6f..c3f43f3df 100755 --- a/test/functional/llmq-is-cl-conflicts.py +++ b/test/functional/llmq-is-cl-conflicts.py @@ -45,8 +45,8 @@ class TestNode(NodeConnCB): class LLMQ_IS_CL_Conflicts(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) #disable_mocktime() def run_test(self): diff --git a/test/functional/llmq-signing.py b/test/functional/llmq-signing.py index 5988afbc9..ddea8b909 100755 --- a/test/functional/llmq-signing.py +++ b/test/functional/llmq-signing.py @@ -17,8 +17,8 @@ Checks LLMQs signing sessions ''' class LLMQSigningTest(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) def run_test(self): diff --git a/test/functional/llmq-simplepose.py b/test/functional/llmq-simplepose.py index 392f4ebee..e9cb62bf9 100755 --- a/test/functional/llmq-simplepose.py +++ b/test/functional/llmq-simplepose.py @@ -16,8 +16,8 @@ Checks simple PoSe system based on LLMQ commitments ''' class LLMQSimplePoSeTest(DashTestFramework): - def __init__(self): - super().__init__(6, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True) def run_test(self): diff --git a/test/functional/p2p-instantsend.py b/test/functional/p2p-instantsend.py index 6ea369f7b..ff52e6dfe 100755 --- a/test/functional/p2p-instantsend.py +++ b/test/functional/p2p-instantsend.py @@ -12,8 +12,8 @@ InstantSendTest -- test InstantSend functionality (prevent doublespend for uncon ''' class InstantSendTest(DashTestFramework): - def __init__(self): - super().__init__(9, 5, [], fast_dip3_enforcement=True) + def set_test_params(self): + self.set_dash_test_params(9, 5, [], fast_dip3_enforcement=True) # set sender, receiver, isolated nodes self.isolated_idx = 1 self.receiver_idx = 2 diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 400105c88..0f2a21872 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -482,8 +482,7 @@ class MasternodeInfo: class DashTestFramework(BitcoinTestFramework): - def __init__(self, num_nodes, masterodes_count, extra_args, fast_dip3_enforcement=False): - super().__init__() + def set_dash_test_params(self, num_nodes, masterodes_count, extra_args, fast_dip3_enforcement=False): self.mn_count = masterodes_count self.num_nodes = num_nodes self.mninfo = [] @@ -500,8 +499,8 @@ class DashTestFramework(BitcoinTestFramework): def create_simple_node(self): idx = len(self.nodes) - args = self.extra_args - self.nodes.append(self.start_node(idx, self.options.tmpdir, args)) + self.add_nodes(1, extra_args=[self.extra_args]) + self.start_node(idx) for i in range(0, idx): connect_nodes(self.nodes[i], idx) @@ -559,23 +558,21 @@ class DashTestFramework(BitcoinTestFramework): copy_datadir(0, idx + start_idx, self.options.tmpdir) # restart faucet node - self.nodes[0] = self.start_node(0, self.options.tmpdir, self.extra_args) + self.start_node(0) def start_masternodes(self): start_idx = len(self.nodes) - for idx in range(0, self.mn_count): - self.nodes.append(None) + self.add_nodes(self.mn_count) executor = ThreadPoolExecutor(max_workers=20) def do_start(idx): args = ['-masternode=1', '-masternodeblsprivkey=%s' % self.mninfo[idx].keyOperator] + self.extra_args - node = self.start_node(idx + start_idx, self.options.tmpdir, args) + self.start_node(idx + start_idx, extra_args=args) self.mninfo[idx].nodeIdx = idx + start_idx - self.mninfo[idx].node = node - self.nodes[idx + start_idx] = node - wait_to_sync(node, True) + self.mninfo[idx].node = self.nodes[idx + start_idx] + wait_to_sync(self.mninfo[idx].node, True) def do_connect(idx): for i in range(0, idx + 1): @@ -606,9 +603,9 @@ class DashTestFramework(BitcoinTestFramework): executor.shutdown() def setup_network(self): - self.nodes = [] # create faucet node for collateral and transactions - self.nodes.append(self.start_node(0, self.options.tmpdir, self.extra_args)) + self.add_nodes(1, extra_args=[self.extra_args]) + self.start_node(0) required_balance = MASTERNODE_COLLATERAL * self.mn_count + 1 while self.nodes[0].getbalance() < required_balance: self.bump_mocktime(1)