right ret

This commit is contained in:
Potuz 2022-11-03 15:07:03 -03:00
parent 329bafa6e2
commit a09d617737
2 changed files with 2 additions and 3 deletions

View File

@ -310,7 +310,7 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
withdrawal_index = WithdrawalIndex(withdrawal_index + 1) withdrawal_index = WithdrawalIndex(withdrawal_index + 1)
if len(ret) == MAX_WITHDRAWALS_PER_PAYLOAD: if len(ret) == MAX_WITHDRAWALS_PER_PAYLOAD:
break break
return ret return withdrawals
``` ```
#### New `process_withdrawals` #### New `process_withdrawals`

View File

@ -30,8 +30,7 @@ def build_empty_execution_payload(spec, state, randao_mix=None):
transactions=empty_txs, transactions=empty_txs,
) )
if is_post_capella(spec): if is_post_capella(spec):
num_withdrawals = min(spec.MAX_WITHDRAWALS_PER_PAYLOAD, len(state.withdrawal_queue)) payload.withdrawals = spec.get_expected_withdrawals(state)
payload.withdrawals = state.withdrawal_queue[:num_withdrawals]
# TODO: real RLP + block hash logic would be nice, requires RLP and keccak256 dependency however. # TODO: real RLP + block hash logic would be nice, requires RLP and keccak256 dependency however.
payload.block_hash = spec.Hash32(spec.hash(payload.hash_tree_root() + b"FAKE RLP HASH")) payload.block_hash = spec.Hash32(spec.hash(payload.hash_tree_root() + b"FAKE RLP HASH"))