Skip to content

Commit ffebf88

Browse files
committed
Fix testgen and test format
1 parent 96db63e commit ffebf88

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

tests/core/pyspec/eth2spec/test/electra/block_processing/test_process_execution_layer_consolidation_request.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def test_consolidation_balance_through_two_churn_epochs(spec, state):
405405
)
406406
@spec_test
407407
@single_phase
408-
def test_invalid_source_equals_target(spec, state):
408+
def test_incorrect_source_equals_target(spec, state):
409409
current_epoch = spec.get_current_epoch(state)
410410
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
411411

@@ -434,7 +434,7 @@ def test_invalid_source_equals_target(spec, state):
434434
)
435435
@spec_test
436436
@single_phase
437-
def test_invalid_exceed_pending_consolidations_limit(spec, state):
437+
def test_incorrect_exceed_pending_consolidations_limit(spec, state):
438438
state.pending_consolidations = [
439439
spec.PendingConsolidation(source_index=0, target_index=1)
440440
] * spec.PENDING_CONSOLIDATIONS_LIMIT
@@ -462,7 +462,7 @@ def test_invalid_exceed_pending_consolidations_limit(spec, state):
462462
@with_electra_and_later
463463
@spec_state_test
464464
@single_phase
465-
def test_invalid_not_enough_consolidation_churn_available(spec, state):
465+
def test_incorrect_not_enough_consolidation_churn_available(spec, state):
466466
state.validators = state.validators[0:2]
467467
state.pending_consolidations = [
468468
spec.PendingConsolidation(source_index=0, target_index=1)
@@ -495,7 +495,7 @@ def test_invalid_not_enough_consolidation_churn_available(spec, state):
495495
)
496496
@spec_test
497497
@single_phase
498-
def test_invalid_exited_source(spec, state):
498+
def test_incorrect_exited_source(spec, state):
499499
# Set up an otherwise correct consolidation
500500
current_epoch = spec.get_current_epoch(state)
501501
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -527,7 +527,7 @@ def test_invalid_exited_source(spec, state):
527527
)
528528
@spec_test
529529
@single_phase
530-
def test_invalid_exited_target(spec, state):
530+
def test_incorrect_exited_target(spec, state):
531531
# Set up an otherwise correct consolidation
532532
current_epoch = spec.get_current_epoch(state)
533533
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -557,7 +557,7 @@ def test_invalid_exited_target(spec, state):
557557
)
558558
@spec_test
559559
@single_phase
560-
def test_invalid_inactive_source(spec, state):
560+
def test_incorrect_inactive_source(spec, state):
561561
# Set up an otherwise correct consolidation
562562
current_epoch = spec.get_current_epoch(state)
563563
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -589,7 +589,7 @@ def test_invalid_inactive_source(spec, state):
589589
)
590590
@spec_test
591591
@single_phase
592-
def test_invalid_inactive_target(spec, state):
592+
def test_incorrect_inactive_target(spec, state):
593593
# Set up an otherwise correct consolidation
594594
current_epoch = spec.get_current_epoch(state)
595595
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -620,7 +620,7 @@ def test_invalid_inactive_target(spec, state):
620620
)
621621
@spec_test
622622
@single_phase
623-
def test_invalid_no_source_execution_withdrawal_credential(spec, state):
623+
def test_incorrect_no_source_execution_withdrawal_credential(spec, state):
624624
# Set up a correct consolidation, but source does not have
625625
# an execution withdrawal credential
626626
current_epoch = spec.get_current_epoch(state)
@@ -646,7 +646,7 @@ def test_invalid_no_source_execution_withdrawal_credential(spec, state):
646646
)
647647
@spec_test
648648
@single_phase
649-
def test_invalid_no_target_execution_withdrawal_credential(spec, state):
649+
def test_incorrect_no_target_execution_withdrawal_credential(spec, state):
650650
# Set up a correct consolidation, but target does not have
651651
# an execution withdrawal credential
652652
current_epoch = spec.get_current_epoch(state)
@@ -674,7 +674,7 @@ def test_invalid_no_target_execution_withdrawal_credential(spec, state):
674674
)
675675
@spec_test
676676
@single_phase
677-
def test_invalid_incorrect_source_address(spec, state):
677+
def test_incorrect_incorrect_source_address(spec, state):
678678
# Set up an otherwise correct consolidation
679679
current_epoch = spec.get_current_epoch(state)
680680
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -704,7 +704,7 @@ def test_invalid_incorrect_source_address(spec, state):
704704
)
705705
@spec_test
706706
@single_phase
707-
def test_invalid_unknown_source_pubkey(spec, state):
707+
def test_incorrect_unknown_source_pubkey(spec, state):
708708
# Set up an otherwise correct consolidation
709709
current_epoch = spec.get_current_epoch(state)
710710
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -734,7 +734,7 @@ def test_invalid_unknown_source_pubkey(spec, state):
734734
)
735735
@spec_test
736736
@single_phase
737-
def test_invalid_unknown_target_pubkey(spec, state):
737+
def test_incorrect_unknown_target_pubkey(spec, state):
738738
# Set up an otherwise correct consolidation
739739
current_epoch = spec.get_current_epoch(state)
740740
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -760,7 +760,7 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
760760
"""
761761
Run ``process_consolidation``, yielding:
762762
- pre-state ('pre')
763-
- consolidation ('consolidation')
763+
- execution_layer_consolidation_request ('execution_layer_consolidation_request')
764764
- post-state ('post').
765765
If ``valid == False``, run expecting ``AssertionError``
766766
"""
@@ -778,7 +778,7 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
778778
pre_state = state.copy()
779779

780780
yield 'pre', state
781-
yield 'consolidation', consolidation
781+
yield 'execution_layer_consolidation_request', consolidation
782782

783783
spec.process_execution_layer_consolidation_request(state, consolidation)
784784

tests/formats/operations/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ Operations:
4646
| `withdrawals` | `ExecutionPayload` | `execution_payload` | `process_withdrawals(state, execution_payload)` (new in Capella) |
4747
| `bls_to_execution_change` | `SignedBLSToExecutionChange` | `address_change` | `process_bls_to_execution_change(state, address_change)` (new in Capella) |
4848
| `deposit_receipt` | `DepositReceipt` | `deposit_receipt` | `process_deposit_receipt(state, deposit_receipt)` (new in Electra) |
49-
| `exits` | `ExecutionLayerExit` | `execution_layer_exit` | `process_execution_layer_exit(state, execution_layer_exit)` (new in Electra) |
49+
| `execution_layer_withdrawal_request` | `ExecutionLayerWithdrawalRequest` | `execution_layer_withdrawal_request` | `process_execution_layer_withdrawal_request(state, execution_layer_withdrawal_request)` (new in Electra) |
50+
| `execution_layer_consolidation_request` | `ExecutionLayerConsolidationRequest` | `execution_layer_consolidation_request` | `process_execution_layer_consolidation_request(state, execution_layer_consolidation_request)` (new in Electra) |
5051

5152
Note that `block_header` is not strictly an operation (and is a full `Block`), but processed in the same manner, and hence included here.
5253

tests/generators/operations/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
_new_electra_mods = {key: 'eth2spec.test.electra.block_processing.test_process_' + key for key in [
4747
'attestation',
48-
'execution_layer_consolidation_requests',
48+
'execution_layer_consolidation_request',
4949
'deposit_receipt',
5050
'execution_layer_withdrawal_request',
5151
'voluntary_exit'

0 commit comments

Comments
 (0)