Skip to content

Commit

Permalink
Danny's review 1st pass
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Nov 7, 2022
1 parent dac756e commit 2f89f50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions specs/capella/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
assert withdrawal == expected_withdrawal
decrease_balance(state, withdrawal.validator_index, withdrawal.amount)
if len(expected_withdrawals) > 0:
# `withdrawal` holds the last withdrawal object in the payload.
state.next_withdrawal_index = WithdrawalIndex(withdrawal.index + 1)
state.latest_withdrawal_validator_index = withdrawal.validator_index
latest_withdrawal = payload.withdrawals[-1]
state.next_withdrawal_index = WithdrawalIndex(latest_withdrawal.index + 1)
state.latest_withdrawal_validator_index = latest_withdrawal.validator_index
```

#### Modified `process_execution_payload`
Expand Down
6 changes: 3 additions & 3 deletions tests/core/pyspec/eth2spec/test/capella/sanity/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_exit_and_bls_change(spec, state):
assert spec.is_fully_withdrawable_validator(validator, balance, validator.withdrawable_epoch)


def _valid_withdrawl(spec, state):
def _valid_withdrawal(spec, state):
fully_withdrawable_indices, partial_withdrawals_indices = prepare_expected_withdrawals(
spec, state, num_partial_withdrawals=spec.MAX_WITHDRAWALS_PER_PAYLOAD * 4,
num_full_withdrawals=spec.MAX_WITHDRAWALS_PER_PAYLOAD * 4)
Expand Down Expand Up @@ -173,7 +173,7 @@ def _valid_withdrawl(spec, state):
@with_capella_and_later
@spec_state_test
def test_withdrawal_success_two_blocks(spec, state):
pre_state, signed_block_1, pre_next_withdrawal_index = _valid_withdrawl(spec, state)
pre_state, signed_block_1, pre_next_withdrawal_index = _valid_withdrawal(spec, state)

yield 'pre', pre_state

Expand All @@ -190,7 +190,7 @@ def test_withdrawal_success_two_blocks(spec, state):
@with_capella_and_later
@spec_state_test
def test_withdrawal_fail_second_block_payload_isnt_compatible(spec, state):
_valid_withdrawl(spec, state)
_valid_withdrawal(spec, state)

# Block 2
block = build_empty_block_for_next_slot(spec, state)
Expand Down

0 comments on commit 2f89f50

Please sign in to comment.