Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test_fork_pending_deposits_are_sorted test #3995

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,30 @@ def test_fork_pre_activation(spec, phases, state):
assert len(post_state.pending_deposits) > 0


@with_phases(phases=[DENEB], other_phases=[ELECTRA])
@spec_test
@with_state
@with_meta_tags(ELECTRA_FORK_TEST_META_TAGS)
def test_fork_pending_deposits_are_sorted(spec, phases, state):
post_spec = phases[ELECTRA]
state.validators[0].activation_epoch = spec.FAR_FUTURE_EPOCH
state.validators[0].activation_eligibility_epoch = 2
state.validators[1].activation_epoch = spec.FAR_FUTURE_EPOCH
state.validators[1].activation_eligibility_epoch = 3
state.validators[2].activation_epoch = spec.FAR_FUTURE_EPOCH
state.validators[2].activation_eligibility_epoch = 2
state.validators[3].activation_epoch = spec.FAR_FUTURE_EPOCH
state.validators[3].activation_eligibility_epoch = 1

post_state = yield from run_fork_test(post_spec, state)

assert len(post_state.pending_deposits) == 4
assert post_state.pending_deposits[0].pubkey == state.validators[3].pubkey
assert post_state.pending_deposits[1].pubkey == state.validators[0].pubkey
assert post_state.pending_deposits[2].pubkey == state.validators[2].pubkey
assert post_state.pending_deposits[3].pubkey == state.validators[1].pubkey


@with_phases(phases=[DENEB], other_phases=[ELECTRA])
@spec_test
@with_state
Expand Down