add consolidation_requests_root to get_execution_payload_header test helper

This commit is contained in:
fradamt 2024-05-22 09:37:16 +02:00
parent f0ef76ada1
commit 1970b56f8f

View File

@ -37,6 +37,7 @@ def get_execution_payload_header(spec, execution_payload):
if is_post_electra(spec):
payload_header.deposit_receipts_root = spec.hash_tree_root(execution_payload.deposit_receipts)
payload_header.withdrawal_requests_root = spec.hash_tree_root(execution_payload.withdrawal_requests)
payload_header.consolidation_requests_root = spec.hash_tree_root(execution_payload.consolidation_requests)
return payload_header
@ -59,7 +60,8 @@ def compute_el_header_block_hash(spec,
transactions_trie_root,
withdrawals_trie_root=None,
deposit_receipts_trie_root=None,
withdrawal_requests_root=None):
withdrawal_requests_root=None,
consolidation_requests_root=None):
"""
Computes the RLP execution block hash described by an `ExecutionPayloadHeader`.
"""
@ -110,6 +112,8 @@ def compute_el_header_block_hash(spec,
execution_payload_header_rlp.append((Binary(32, 32), deposit_receipts_trie_root))
# withdrawal requests root
execution_payload_header_rlp.append((Binary(32, 32), withdrawal_requests_root))
# consolidation requests root
execution_payload_header_rlp.append((Binary(32, 32), consolidation_requests_root))
sedes = List([schema for schema, _ in execution_payload_header_rlp])
values = [value for _, value in execution_payload_header_rlp]