Skip to content

Commit 7ab2bbe

Browse files
authored
Make process_withdrawals slightly cleaner (equivalent functionality) (#3761)
1 parent 92aeafe commit 7ab2bbe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

specs/capella/beacon-chain.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,9 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
379379
```python
380380
def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
381381
expected_withdrawals = get_expected_withdrawals(state)
382-
assert len(payload.withdrawals) == len(expected_withdrawals)
382+
assert payload.withdrawals == expected_withdrawals
383383

384-
for expected_withdrawal, withdrawal in zip(expected_withdrawals, payload.withdrawals):
385-
assert withdrawal == expected_withdrawal
384+
for withdrawal in expected_withdrawals:
386385
decrease_balance(state, withdrawal.validator_index, withdrawal.amount)
387386

388387
# Update the next withdrawal index if this block contained withdrawals

0 commit comments

Comments
 (0)