Skip to content

Commit 5270d79

Browse files
committed
Use generalized op types for Electra transition tests
1 parent 8e8930c commit 5270d79

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/core/pyspec/eth2spec/test/electra/transition/test_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_transition_with_full_withdrawal_request_right_after_fork(
6363
post_spec,
6464
pre_tag,
6565
post_tag,
66-
operation_type=OperationType.FULL_WITHDRAWAL_REQUEST,
66+
operation_type=OperationType.WITHDRAWAL_REQUEST,
6767
operation_at_slot=fork_epoch * spec.SLOTS_PER_EPOCH,
6868
)
6969

@@ -75,7 +75,7 @@ def test_transition_with_full_withdrawal_request_right_after_fork(
7575
@with_fork_metas([ForkMeta(pre_fork_name=pre, post_fork_name=post, fork_epoch=2)
7676
for pre, post in AFTER_ELECTRA_PRE_POST_FORKS])
7777
@always_bls
78-
def test_transition_with_switch_to_compounding_request_right_after_fork(
78+
def test_transition_with_consolidation_request_right_after_fork(
7979
state,
8080
fork_epoch,
8181
spec,
@@ -84,7 +84,7 @@ def test_transition_with_switch_to_compounding_request_right_after_fork(
8484
post_tag
8585
):
8686
"""
87-
Create a SWITCH_TO_COMPOUNDING_REQUEST right *after* the transition
87+
Create a CONSOLIDATION_REQUEST right *after* the transition
8888
"""
8989
yield from run_transition_with_operation(
9090
state,
@@ -93,6 +93,6 @@ def test_transition_with_switch_to_compounding_request_right_after_fork(
9393
post_spec,
9494
pre_tag,
9595
post_tag,
96-
operation_type=OperationType.SWITCH_TO_COMPOUNDING_REQUEST,
96+
operation_type=OperationType.CONSOLIDATION_REQUEST,
9797
operation_at_slot=fork_epoch * spec.SLOTS_PER_EPOCH,
9898
)

tests/core/pyspec/eth2spec/test/helpers/fork_transition.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class OperationType(Enum):
5353
VOLUNTARY_EXIT = auto()
5454
BLS_TO_EXECUTION_CHANGE = auto()
5555
DEPOSIT_REQUEST = auto()
56-
FULL_WITHDRAWAL_REQUEST = auto()
57-
SWITCH_TO_COMPOUNDING_REQUEST = auto()
56+
WITHDRAWAL_REQUEST = auto()
57+
CONSOLIDATION_REQUEST = auto()
5858

5959

6060
def _set_operations_by_dict(block, operation_dict):
@@ -348,12 +348,12 @@ def run_transition_with_operation(state,
348348
amount = post_spec.MIN_ACTIVATION_BALANCE
349349
deposit_request = prepare_deposit_request(post_spec, selected_validator_index, amount, signed=True)
350350
operation_dict = {'execution_requests.deposits': [deposit_request]}
351-
elif operation_type == OperationType.FULL_WITHDRAWAL_REQUEST:
351+
elif operation_type == OperationType.WITHDRAWAL_REQUEST:
352352
selected_validator_index = 0
353353
withdrawal_request = prepare_withdrawal_request(
354354
post_spec, state, selected_validator_index, amount=post_spec.FULL_EXIT_REQUEST_AMOUNT)
355355
operation_dict = {'execution_requests.withdrawals': [withdrawal_request]}
356-
elif operation_type == OperationType.SWITCH_TO_COMPOUNDING_REQUEST:
356+
elif operation_type == OperationType.CONSOLIDATION_REQUEST:
357357
selected_validator_index = 0
358358
consolidation_request = prepare_switch_to_compounding_request(post_spec, state, selected_validator_index)
359359
operation_dict = {'execution_requests.consolidations': [consolidation_request]}
@@ -389,10 +389,10 @@ def _check_state():
389389
signature=deposit_request.signature,
390390
slot=state.slot,
391391
)]
392-
elif operation_type == OperationType.FULL_WITHDRAWAL_REQUEST:
392+
elif operation_type == OperationType.WITHDRAWAL_REQUEST:
393393
validator = state.validators[selected_validator_index]
394394
assert validator.exit_epoch < post_spec.FAR_FUTURE_EPOCH
395-
elif operation_type == OperationType.SWITCH_TO_COMPOUNDING_REQUEST:
395+
elif operation_type == OperationType.CONSOLIDATION_REQUEST:
396396
validator = state.validators[selected_validator_index]
397397
assert validator.withdrawal_credentials[:1] == post_spec.COMPOUNDING_WITHDRAWAL_PREFIX
398398

0 commit comments

Comments
 (0)