Add `test_fork_has_compounding_withdrawal_credential` test case

This commit is contained in:
Hsiao-Wei Wang 2024-05-13 15:27:52 +03:00
parent 5f48840f4d
commit 01a2c7ba07
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 16 additions and 0 deletions

View File

@ -80,3 +80,17 @@ def test_fork_random_misc_balances(spec, phases, state):
@with_meta_tags(ELECTRA_FORK_TEST_META_TAGS)
def test_fork_random_large_validator_set(spec, phases, state):
yield from run_fork_test(phases[ELECTRA], state)
@with_phases(phases=[DENEB], other_phases=[ELECTRA])
@spec_test
@with_state
@with_meta_tags(ELECTRA_FORK_TEST_META_TAGS)
def test_fork_has_compounding_withdrawal_credential(spec, phases, state):
post_spec = phases[ELECTRA]
validator = state.validators[0]
state.balances[0] = post_spec.MIN_ACTIVATION_BALANCE + 1
validator.withdrawal_credentials = post_spec.COMPOUNDING_WITHDRAWAL_PREFIX + validator.withdrawal_credentials[1:]
post_state = yield from run_fork_test(post_spec, state)
assert len(post_state.pending_balance_deposits) > 0

View File

@ -63,3 +63,5 @@ def run_fork_test(post_spec, pre_state):
assert post_state.fork.epoch == post_spec.get_current_epoch(post_state)
yield 'post', post_state
return post_state