preston's feedback

This commit is contained in:
james-prysm 2024-07-02 22:10:15 -05:00
parent b2cd3ce9a7
commit 03071df6e3
1 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,22 @@ def test_apply_pending_deposit_not_withdrawable_epoch_while_exiting(spec, state)
) )
assert spec.apply_pending_deposit(state,deposit) == False 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 @with_electra_and_later
@spec_state_test @spec_state_test
def test_apply_pending_deposit_withdrawable_epoch_while_exiting(spec, state): 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 spec.apply_pending_deposit(state,deposit) == True
assert state.balances[0] == amount assert state.balances[0] == amount
@with_electra_and_later @with_electra_and_later
@spec_state_test @spec_state_test
def test_apply_pending_deposit_withdrawable_epoch_while_exited(spec, state): def test_apply_pending_deposit_withdrawable_epoch_while_exited(spec, state):