fix `test_top_up_and_partial_withdrawable_validator`: set different expected value for post-electra

This commit is contained in:
Hsiao-Wei Wang 2024-04-17 18:40:38 +08:00
parent 2ecbe194f7
commit b290ec7d0c
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
1 changed files with 9 additions and 9 deletions

View File

@ -359,13 +359,13 @@ def test_top_up_and_partial_withdrawable_validator(spec, state):
signed_block = state_transition_and_sign_block(spec, state, block)
# ensure we go through an epoch transition, to account for post-electra behavior
block_in_next_epoch = build_empty_block(spec, state, slot=state.slot + spec.SLOTS_PER_EPOCH)
signed_block_in_next_epoch = state_transition_and_sign_block(spec, state, block_in_next_epoch)
yield 'blocks', [signed_block, signed_block_in_next_epoch]
yield 'blocks', [signed_block]
yield 'post', state
if is_post_electra(spec):
assert state.pending_balance_deposits[0].amount == amount
assert state.pending_balance_deposits[0].index == validator_index
else:
# Since withdrawals happen before deposits, it becomes partially withdrawable after state transition.
validator = state.validators[validator_index]
balance = state.balances[validator_index]