mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-23 17:11:44 +00:00
Add extra %
This commit is contained in:
parent
99e2704c2c
commit
8f42e485c7
@ -286,10 +286,9 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
|
|||||||
def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
|
def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
|
||||||
epoch = get_current_epoch(state)
|
epoch = get_current_epoch(state)
|
||||||
withdrawal_index = state.next_withdrawal_index
|
withdrawal_index = state.next_withdrawal_index
|
||||||
validator_index = state.latest_withdrawal_validator_index
|
validator_index = ValidatorIndex((state.latest_validator_index + 1) % len(state.validators))
|
||||||
withdrawals: List[Withdrawal] = []
|
withdrawals: List[Withdrawal] = []
|
||||||
for _ in range(len(state.validators)):
|
for _ in range(len(state.validators)):
|
||||||
validator_index = ValidatorIndex((validator_index + 1) % len(state.validators))
|
|
||||||
validator = state.validators[validator_index]
|
validator = state.validators[validator_index]
|
||||||
balance = state.balances[validator_index]
|
balance = state.balances[validator_index]
|
||||||
if is_fully_withdrawable_validator(validator, balance, epoch):
|
if is_fully_withdrawable_validator(validator, balance, epoch):
|
||||||
@ -310,6 +309,7 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
|
|||||||
withdrawal_index += WithdrawalIndex(1)
|
withdrawal_index += WithdrawalIndex(1)
|
||||||
if len(withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD:
|
if len(withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD:
|
||||||
break
|
break
|
||||||
|
validator_index = ValidatorIndex((validator_index + 1) % len(state.validators))
|
||||||
return withdrawals
|
return withdrawals
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user