47
47
48
48
class AssetLocksTest (DashTestFramework ):
49
49
def set_test_params (self ):
50
- self .set_dash_test_params (5 , 3 , [["-whitelist=127.0.0.1" , "-llmqtestinstantsenddip0024=llmq_test_instantsend" ]] * 5 , evo_count = 3 )
50
+ self .set_dash_test_params (4 , 2 , [["-whitelist=127.0.0.1" , "-llmqtestinstantsenddip0024=llmq_test_instantsend" ]] * 4 , evo_count = 2 )
51
51
52
52
def skip_test_if_missing_module (self ):
53
53
self .skip_if_no_wallet ()
@@ -229,6 +229,13 @@ def slowly_generate_batch(self, count):
229
229
self .nodes [1 ].generate (batch )
230
230
self .sync_all ()
231
231
232
+ # This functional test intentionally setup only 2 MN and only 2 Evo nodes
233
+ # to ensure that corner case of quorum with minimum amount of nodes as possible
234
+ # does not cause any issues in Dash Core
235
+ def mine_quorum_2_nodes (self , llmq_type_name , llmq_type ):
236
+ self .mine_quorum (llmq_type_name = llmq_type_name , expected_members = 2 , expected_connections = 1 , expected_contributions = 2 , expected_commitments = 2 , llmq_type = llmq_type )
237
+
238
+
232
239
def run_test (self ):
233
240
node_wallet = self .nodes [0 ]
234
241
node = self .nodes [1 ]
@@ -241,9 +248,9 @@ def run_test(self):
241
248
self .nodes [0 ].sporkupdate ("SPORK_2_INSTANTSEND_ENABLED" , 0 )
242
249
self .wait_for_sporks_same ()
243
250
244
- self .mine_quorum (llmq_type_name = 'llmq_test_instantsend' , llmq_type = 104 )
251
+ self .mine_quorum_2_nodes (llmq_type_name = 'llmq_test_instantsend' , llmq_type = 104 )
245
252
246
- for _ in range (3 ):
253
+ for _ in range (2 ):
247
254
self .dynamically_add_masternode (evo = True )
248
255
node .generate (8 )
249
256
self .sync_blocks ()
@@ -321,7 +328,7 @@ def test_asset_locks(self, node_wallet, node, pubkey):
321
328
self .create_and_check_block ([extra_lock_tx ], expected_error = 'bad-cbtx-assetlocked-amount' )
322
329
323
330
self .log .info ("Mine a quorum..." )
324
- self .mine_quorum (llmq_type_name = 'llmq_test_platform' , llmq_type = 106 , expected_connections = 2 , expected_members = 3 , expected_contributions = 3 , expected_complaints = 0 , expected_justifications = 0 , expected_commitments = 3 )
331
+ self .mine_quorum_2_nodes (llmq_type_name = 'llmq_test_platform' , llmq_type = 106 )
325
332
326
333
self .validate_credit_pool_balance (locked_1 )
327
334
@@ -407,7 +414,7 @@ def test_asset_unlocks(self, node_wallet, node, pubkey):
407
414
reason = "double copy" )
408
415
409
416
self .log .info ("Mining next quorum to check tx 'asset_unlock_tx_late' is still valid..." )
410
- self .mine_quorum (llmq_type_name = " llmq_test_platform" , llmq_type = 106 )
417
+ self .mine_quorum_2_nodes (llmq_type_name = ' llmq_test_platform' , llmq_type = 106 )
411
418
self .log .info ("Checking credit pool amount is same..." )
412
419
self .validate_credit_pool_balance (locked - 1 * COIN )
413
420
self .check_mempool_result (tx = asset_unlock_tx_late , result_expected = {'allowed' : True , 'fees' : {'base' : Decimal (str (tiny_amount / COIN ))}})
@@ -427,7 +434,7 @@ def test_asset_unlocks(self, node_wallet, node, pubkey):
427
434
result_expected = {'allowed' : False , 'reject-reason' : 'bad-assetunlock-too-late' })
428
435
429
436
self .log .info ("Checking that two quorums later it is too late because quorum is not active..." )
430
- self .mine_quorum (llmq_type_name = " llmq_test_platform" , llmq_type = 106 )
437
+ self .mine_quorum_2_nodes (llmq_type_name = ' llmq_test_platform' , llmq_type = 106 )
431
438
self .log .info ("Expecting new reject-reason..." )
432
439
self .check_mempool_result (tx = asset_unlock_tx_too_late ,
433
440
result_expected = {'allowed' : False , 'reject-reason' : 'bad-assetunlock-not-active-quorum' })
@@ -504,7 +511,7 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
504
511
505
512
self .log .info ("Fast forward to the next day to reset all current unlock limits..." )
506
513
self .slowly_generate_batch (blocks_in_one_day )
507
- self .mine_quorum (llmq_type_name = " llmq_test_platform" , llmq_type = 106 )
514
+ self .mine_quorum_2_nodes (llmq_type_name = ' llmq_test_platform' , llmq_type = 106 )
508
515
509
516
total = self .get_credit_pool_balance ()
510
517
coins = node_wallet .listunspent ()
0 commit comments