Skip to content

Commit

Permalink
Make process_withdrawals slightly cleaner (equivalent functionality) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuterin authored Aug 2, 2024
1 parent 92aeafe commit 7ab2bbe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions specs/capella/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,9 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
```python
def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
expected_withdrawals = get_expected_withdrawals(state)
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 the next withdrawal index if this block contained withdrawals
Expand Down

0 comments on commit 7ab2bbe

Please sign in to comment.