Apply suggestions from code review

Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
This commit is contained in:
Danny Ryan 2022-03-22 08:03:55 -06:00 committed by GitHub
parent 493b169022
commit 03f9503de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -195,7 +195,7 @@ def is_fully_withdrawable_validator(validator: Validator, epoch: Epoch) -> bool:
"""
Check if ``validator`` is fully withdrawable.
"""
is_eth1_withdrawal_prefix = validator.withdrawal_credentials[0:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX
is_eth1_withdrawal_prefix = validator.withdrawal_credentials[:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX
return is_eth1_withdrawal_prefix and validator.withdrawable_epoch <= epoch < validator.fully_withdrawn_epoch
```
@ -256,10 +256,10 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
dequeued_withdrawals = state.withdrawals_queue[:num_withdrawals]
assert len(dequeued_withdrawals) == len(payload.withdrawals)
for dequeued_receipt, withdrawal in zip(dequeued_withdrawals, payload.withdrawals):
assert dequeued_receipt == withdrawal
for dequeued_withdrawal, withdrawal in zip(dequeued_withdrawals, payload.withdrawals):
assert dequeued_withdrawal == withdrawal
# Remove dequeued receipts from state
# Remove dequeued withdrawals from state
state.withdrawals_queue = state.withdrawals_queue[num_withdrawals:]
```

View File

@ -33,7 +33,7 @@ Otherwise, `notify_forkchoice_updated` inherits all prior functionality.
def notify_forkchoice_updated(self: ExecutionEngine,
head_block_hash: Hash32,
finalized_block_hash: Hash32,
payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]:
payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]: # new in Capella
...
```
@ -49,5 +49,5 @@ class PayloadAttributes(object):
timestamp: uint64
prev_randao: Bytes32
suggested_fee_recipient: ExecutionAddress
withdrawals: Sequence[Withdrawal]
withdrawals: Sequence[Withdrawal] # new in Capella
```