@@ -250,6 +250,7 @@ def run_test(self):
250250
251251 self .activate_v20 (expected_activation_height = 900 )
252252 self .log .info ("Activated v20 at height:" + str (node .getblockcount ()))
253+ assert softfork_active (node_wallet , 'withdrawals' )
253254
254255 for _ in range (2 ):
255256 self .dynamically_add_masternode (evo = True )
@@ -431,12 +432,8 @@ def test_asset_unlocks(self, node_wallet, node, pubkey):
431432 self .check_mempool_result (tx = asset_unlock_tx_too_late ,
432433 result_expected = {'allowed' : False , 'reject-reason' : 'bad-assetunlock-too-late' })
433434
434- self . log . info ( "Checking that two quorums later it is too late because quorum is not active..." )
435+ # TODO remove this quorum
435436 self .mine_quorum_2_nodes ()
436- self .log .info ("Expecting new reject-reason..." )
437- assert not softfork_active (self .nodes [0 ], 'withdrawals' )
438- self .check_mempool_result (tx = asset_unlock_tx_too_late ,
439- result_expected = {'allowed' : False , 'reject-reason' : 'bad-assetunlock-too-old-quorum' })
440437
441438 block_to_reconsider = node .getbestblockhash ()
442439 self .log .info ("Test block invalidation with asset unlock tx..." )
@@ -450,9 +447,6 @@ def test_asset_unlocks(self, node_wallet, node, pubkey):
450447 self .validate_credit_pool_balance (locked - 2 * COIN )
451448
452449 self .log .info ("Forcibly mining asset_unlock_tx_too_late and ensure block is invalid" )
453- assert not softfork_active (self .nodes [0 ], 'withdrawals' )
454- self .create_and_check_block ([asset_unlock_tx_too_late ], expected_error = "bad-assetunlock-too-old-quorum" )
455-
456450 self .generate (node , 1 )
457451
458452 self .validate_credit_pool_balance (locked - 2 * COIN )
@@ -464,7 +458,6 @@ def test_asset_unlocks(self, node_wallet, node, pubkey):
464458
465459 def test_withdrawal_limits (self , node_wallet , node , pubkey ):
466460 self .log .info ("Testing withdrawal limits before v22 'withdrawal fork'..." )
467- assert not softfork_active (node_wallet , 'withdrawals' )
468461
469462 self .log .info ("Too big withdrawal is expected to not be mined" )
470463 asset_unlock_tx_full = self .create_assetunlock (201 , 1 + self .get_credit_pool_balance (), pubkey )
@@ -527,12 +520,12 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
527520 self .generate (node , 1 )
528521 credit_pool_balance_1 = self .get_credit_pool_balance ()
529522 assert_greater_than (credit_pool_balance_1 , 10_901 * COIN )
530- limit_amount_1 = 1000 * COIN
523+ limit_amount_1 = 2000 * COIN
531524 self .log .info ("Create 5 transactions and make sure that only 4 of them can be mined" )
532- self .log .info ("because their sum is bigger than the hard-limit (1000 )" )
525+ self .log .info ("because their sum is bigger than the hard-limit (2000 )" )
533526 # take most of limit by one big tx for faster testing and
534527 # create several tiny withdrawal with exactly 1 *invalid* / causes spend above limit tx
535- withdrawals = [600 * COIN , 100 * COIN , 100 * COIN , 100 * COIN - 10000 , 100 * COIN + 10001 ]
528+ withdrawals = [1600 * COIN , 100 * COIN , 100 * COIN , 100 * COIN - 10000 , 100 * COIN + 10001 ]
536529 amount_to_withdraw_1 = sum (withdrawals )
537530 index = 400
538531 for next_amount in withdrawals :
@@ -549,11 +542,11 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
549542 amount_actually_withdrawn = total - new_total
550543 self .log .info ("Testing that we tried to withdraw more than we could" )
551544 assert_greater_than (amount_to_withdraw_1 , amount_actually_withdrawn )
552- self .log .info ("Checking that we tried to withdraw more than the hard-limit (1000 )" )
545+ self .log .info ("Checking that we tried to withdraw more than the hard-limit (2000 )" )
553546 assert_greater_than (amount_to_withdraw_1 , limit_amount_1 )
554547 self .log .info ("Checking we didn't actually withdraw more than allowed by the limit" )
555548 assert_greater_than_or_equal (limit_amount_1 , amount_actually_withdrawn )
556- assert_equal (amount_actually_withdrawn , 900 * COIN + 10001 )
549+ assert_equal (amount_actually_withdrawn , 1900 * COIN + 10001 )
557550
558551 self .generate (node , 1 )
559552 self .log .info ("Checking that exactly 1 tx stayed in mempool..." )
@@ -563,7 +556,7 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
563556 pending_txid = node .getrawmempool ()[0 ]
564557
565558 amount_to_withdraw_2 = limit_amount_1 - amount_actually_withdrawn
566- self .log .info (f"We can still consume { Decimal (str (amount_to_withdraw_2 / COIN ))} before we hit the hard-limit (1000 )" )
559+ self .log .info (f"We can still consume { Decimal (str (amount_to_withdraw_2 / COIN ))} before we hit the hard-limit (2000 )" )
567560 index += 1
568561 asset_unlock_tx = self .create_assetunlock (index , amount_to_withdraw_2 , pubkey )
569562 self .send_tx_simple (asset_unlock_tx )
@@ -586,8 +579,7 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
586579 self .check_mempool_size ()
587580
588581 self .log .info ("Creating new asset-unlock tx. It should be mined exactly 1 block after" )
589- credit_pool_balance_2 = self .get_credit_pool_balance ()
590- limit_amount_2 = credit_pool_balance_2 // 10
582+ limit_amount_2 = 2000 * COIN
591583 index += 1
592584 asset_unlock_tx = self .create_assetunlock (index , limit_amount_2 , pubkey )
593585 self .send_tx (asset_unlock_tx )
@@ -614,7 +606,6 @@ def test_withdrawal_limits(self, node_wallet, node, pubkey):
614606 self .log .info ("Checking that credit pool is not changed..." )
615607 assert_equal (new_total , self .get_credit_pool_balance ())
616608 self .check_mempool_size ()
617- assert not softfork_active (node_wallet , 'withdrawals' )
618609
619610
620611 def test_mn_rr (self , node_wallet , node , pubkey ):
@@ -646,10 +637,6 @@ def test_mn_rr(self, node_wallet, node, pubkey):
646637 assert_equal (locked , self .get_credit_pool_balance ())
647638
648639 def test_withdrawal_fork (self , node_wallet , node , pubkey ):
649- self .log .info ("Testing asset unlock after 'withdrawal' activation..." )
650- assert softfork_active (node_wallet , 'withdrawals' )
651- self .log .info (f'post-withdrawals height: { node .getblockcount ()} credit: { self .get_credit_pool_balance ()} ' )
652-
653640 index = 501
654641 while index < 511 :
655642 self .log .info (f"Generating new Asset Unlock tx, index={ index } ..." )
0 commit comments