From 03071df6e39ba764ac94dcc44a0fbe74e219bd1f Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 2 Jul 2024 22:10:15 -0500 Subject: [PATCH] preston's feedback --- .../test_apply_pending_deposit.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_apply_pending_deposit.py b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_apply_pending_deposit.py index 548116eba..ef40a030f 100644 --- a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_apply_pending_deposit.py +++ b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_apply_pending_deposit.py @@ -47,6 +47,22 @@ def test_apply_pending_deposit_not_withdrawable_epoch_while_exiting(spec, state) ) assert spec.apply_pending_deposit(state,deposit) == False +@with_electra_and_later +@spec_state_test +def test_apply_pending_deposit_not_withdrawable_epoch_at_current_epoch_while_exiting(spec, state): + amount = 100 + # validator exit epoch must be less than far future + state.validators[0].exit_epoch = spec.FAR_FUTURE_EPOCH - 1 + state.validators[0].withdrawable_epoch = spec.get_current_epoch(state) + + deposit = spec.PendingDeposit( + pubkey=state.validators[0].pubkey, + withdrawal_credentials= state.validators[0].withdrawal_credentials, + amount=amount, + slot=spec.GENESIS_SLOT, + ) + assert spec.apply_pending_deposit(state,deposit) == False + @with_electra_and_later @spec_state_test def test_apply_pending_deposit_withdrawable_epoch_while_exiting(spec, state): @@ -67,6 +83,7 @@ def test_apply_pending_deposit_withdrawable_epoch_while_exiting(spec, state): assert spec.apply_pending_deposit(state,deposit) == True assert state.balances[0] == amount + @with_electra_and_later @spec_state_test def test_apply_pending_deposit_withdrawable_epoch_while_exited(spec, state):