99 default_activation_threshold ,
1010 spec_state_test ,
1111)
12- from eth2spec .test .helpers .keys import pubkey_to_privkey
1312from eth2spec .test .helpers .withdrawals import (
1413 set_eth1_withdrawal_credential_with_balance ,
1514 set_compounding_withdrawal_credential ,
@@ -255,7 +254,6 @@ def test_basic_consolidation_with_compounding_credentials(spec, state):
255254 assert state .validators [source_index ].exit_epoch == expected_exit_epoch
256255
257256
258-
259257@with_electra_and_later
260258@with_presets ([MINIMAL ], "need sufficient consolidation churn limit" )
261259@with_custom_state (
@@ -623,7 +621,7 @@ def test_invalid_inactive_target(spec, state):
623621@spec_test
624622@single_phase
625623def test_invalid_no_source_execution_withdrawal_credential (spec , state ):
626- # Set up a correct consolidation, but source does not have
624+ # Set up a correct consolidation, but source does not have
627625 # an execution withdrawal credential
628626 current_epoch = spec .get_current_epoch (state )
629627 source_index = spec .get_active_validator_indices (state , current_epoch )[0 ]
@@ -639,6 +637,7 @@ def test_invalid_no_source_execution_withdrawal_credential(spec, state):
639637 spec , state , consolidation , success = False
640638 )
641639
640+
642641@with_electra_and_later
643642@with_presets ([MINIMAL ], "need sufficient consolidation churn limit" )
644643@with_custom_state (
@@ -648,7 +647,7 @@ def test_invalid_no_source_execution_withdrawal_credential(spec, state):
648647@spec_test
649648@single_phase
650649def test_invalid_no_target_execution_withdrawal_credential (spec , state ):
651- # Set up a correct consolidation, but target does not have
650+ # Set up a correct consolidation, but target does not have
652651 # an execution withdrawal credential
653652 current_epoch = spec .get_current_epoch (state )
654653 source_index = spec .get_active_validator_indices (state , current_epoch )[0 ]
@@ -666,6 +665,7 @@ def test_invalid_no_target_execution_withdrawal_credential(spec, state):
666665 spec , state , consolidation , success = False
667666 )
668667
668+
669669@with_electra_and_later
670670@with_presets ([MINIMAL ], "need sufficient consolidation churn limit" )
671671@with_custom_state (
@@ -691,7 +691,6 @@ def test_invalid_incorrect_source_address(spec, state):
691691 )
692692 set_eth1_withdrawal_credential_with_balance (spec , state , target_index )
693693
694-
695694 yield from run_consolidation_processing (
696695 spec , state , consolidation , success = False
697696 )
@@ -757,7 +756,6 @@ def test_invalid_unknown_target_pubkey(spec, state):
757756 )
758757
759758
760-
761759def run_consolidation_processing (spec , state , consolidation , success = True ):
762760 """
763761 Run ``process_consolidation``, yielding:
@@ -779,7 +777,6 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
779777 else :
780778 pre_state = state .copy ()
781779
782-
783780 yield 'pre' , state
784781 yield 'consolidation' , consolidation
785782
@@ -802,12 +799,11 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
802799 assert state .validators [source_index ].exit_epoch < spec .FAR_FUTURE_EPOCH
803800 # Check that the exit epoch matches earliest_consolidation_epoch
804801 assert state .validators [source_index ].exit_epoch == state .earliest_consolidation_epoch
805- # Check that the correct consolidation has been appended
802+ # Check that the correct consolidation has been appended
806803 expected_new_pending_consolidation = spec .PendingConsolidation (
807804 source_index = source_index ,
808805 target_index = target_index ,
809806 )
810807 assert state .pending_consolidations == pre_pending_consolidations + [expected_new_pending_consolidation ]
811808 else :
812809 assert pre_state == state
813-
0 commit comments