Skip to content

Commit 01a2c7b

Browse files
committed
Add test_fork_has_compounding_withdrawal_credential test case
1 parent 5f48840 commit 01a2c7b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/core/pyspec/eth2spec/test/electra/fork/test_electra_fork_basic.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@ def test_fork_random_misc_balances(spec, phases, state):
8080
@with_meta_tags(ELECTRA_FORK_TEST_META_TAGS)
8181
def test_fork_random_large_validator_set(spec, phases, state):
8282
yield from run_fork_test(phases[ELECTRA], state)
83+
84+
85+
@with_phases(phases=[DENEB], other_phases=[ELECTRA])
86+
@spec_test
87+
@with_state
88+
@with_meta_tags(ELECTRA_FORK_TEST_META_TAGS)
89+
def test_fork_has_compounding_withdrawal_credential(spec, phases, state):
90+
post_spec = phases[ELECTRA]
91+
validator = state.validators[0]
92+
state.balances[0] = post_spec.MIN_ACTIVATION_BALANCE + 1
93+
validator.withdrawal_credentials = post_spec.COMPOUNDING_WITHDRAWAL_PREFIX + validator.withdrawal_credentials[1:]
94+
post_state = yield from run_fork_test(post_spec, state)
95+
96+
assert len(post_state.pending_balance_deposits) > 0

tests/core/pyspec/eth2spec/test/helpers/electra/fork.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ def run_fork_test(post_spec, pre_state):
6363
assert post_state.fork.epoch == post_spec.get_current_epoch(post_state)
6464

6565
yield 'post', post_state
66+
67+
return post_state

0 commit comments

Comments
 (0)