33from typing import ClassVar , Dict , List
44
55from ethereum_test_base_types import Hash
6+ from ethereum_test_base_types .base_types import Bytes
67from ethereum_test_forks import Fork
78from ethereum_test_rpc import BlobAndProofV1 , BlobAndProofV2 , EngineRPC , EthRPC
89from ethereum_test_types import NetworkWrappedTransaction , Transaction
@@ -19,16 +20,17 @@ def versioned_hashes_with_blobs_and_proofs(
1920 """
2021 versioned_hashes : Dict [Hash , BlobAndProofV1 | BlobAndProofV2 ] = {}
2122 for blob in tx .blobs :
22- versioned_hash = blob .versioned_hash ()
23- if blob .kzg_proof is not None :
24- versioned_hashes [versioned_hash ] = BlobAndProofV1 (blob = blob .data , proof = blob .kzg_proof )
25- elif blob .kzg_cell_proofs is not None :
26- versioned_hashes [versioned_hash ] = BlobAndProofV2 (
27- blob = blob .data , proofs = blob .kzg_cell_proofs
23+ if isinstance (blob .proof , Bytes ):
24+ versioned_hashes [blob .versioned_hash ] = BlobAndProofV1 (
25+ blob = blob .data , proof = blob .proof
26+ )
27+ elif isinstance (blob .proof , list ):
28+ versioned_hashes [blob .versioned_hash ] = BlobAndProofV2 (
29+ blob = blob .data , proofs = blob .proof
2830 )
2931 else :
3032 raise ValueError (
31- f"Blob with versioned hash { versioned_hash .hex ()} requires either kzg_proof "
33+ f"Blob with versioned hash { blob . versioned_hash .hex ()} requires either kzg_proof "
3234 "or kzg_cell_proofs, but both are None"
3335 )
3436
0 commit comments