harmonize `process_withdrawals` spec with #3761

This commit is contained in:
Alex Stokes 2024-08-28 16:01:10 -06:00
parent a5990f99ac
commit c7631634fb
No known key found for this signature in database
1 changed files with 2 additions and 3 deletions

View File

@ -1022,10 +1022,9 @@ def get_expected_withdrawals(state: BeaconState) -> Tuple[Sequence[Withdrawal],
def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
expected_withdrawals, partial_withdrawals_count = get_expected_withdrawals(state) # [Modified in Electra:EIP7251]
assert len(payload.withdrawals) == len(expected_withdrawals)
assert payload.withdrawals == expected_withdrawals
for expected_withdrawal, withdrawal in zip(expected_withdrawals, payload.withdrawals):
assert withdrawal == expected_withdrawal
for withdrawal in expected_withdrawals:
decrease_balance(state, withdrawal.validator_index, withdrawal.amount)
# Update pending partial withdrawals [New in Electra:EIP7251]