mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-20 15:38:55 +00:00
Danny's review 1st pass
This commit is contained in:
parent
dac756efee
commit
2f89f5096d
@ -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`
|
||||
|
@ -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)
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user