Clean up `is_data_available`. Remove the stub `retrieve_blobs_and_proofs` responses.
This commit is contained in:
parent
d2d351f7c9
commit
e79caff2f7
|
@ -21,9 +21,9 @@ T = TypeVar('T') # For generic function
|
|||
@classmethod
|
||||
def sundry_functions(cls) -> str:
|
||||
return '''
|
||||
def retrieve_blobs_and_proofs(beacon_block_root: Root) -> PyUnion[Tuple[Blob, KZGProof], Tuple[str, str]]:
|
||||
def retrieve_blobs_and_proofs(beacon_block_root: Root) -> Tuple[Sequence[Blob], Sequence[KZGProof]]:
|
||||
# pylint: disable=unused-argument
|
||||
return ("TEST", "TEST")'''
|
||||
return [], []'''
|
||||
|
||||
@classmethod
|
||||
def execution_engine_cls(cls) -> str:
|
||||
|
|
|
@ -55,11 +55,6 @@ def is_data_available(beacon_block_root: Root, blob_kzg_commitments: Sequence[KZ
|
|||
# `MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS`
|
||||
blobs, proofs = retrieve_blobs_and_proofs(beacon_block_root)
|
||||
|
||||
# For testing, `retrieve_blobs_and_proofs` returns ("TEST", "TEST").
|
||||
# TODO: Remove it once we have a way to inject `BlobSidecar` into tests.
|
||||
if isinstance(blobs, str) or isinstance(proofs, str):
|
||||
return True
|
||||
|
||||
return verify_blob_kzg_proof_batch(blobs, blob_kzg_commitments, proofs)
|
||||
```
|
||||
|
||||
|
|
|
@ -10,11 +10,18 @@ from eth2spec.test.helpers.attestations import (
|
|||
|
||||
|
||||
class BlobData(NamedTuple):
|
||||
"""
|
||||
The return values of ``retrieve_blobs_and_proofs`` helper.
|
||||
"""
|
||||
blobs: Sequence[Any]
|
||||
proofs: Sequence[bytes]
|
||||
|
||||
|
||||
def with_blob_data(spec, blob_data, func):
|
||||
"""
|
||||
This helper runs the given ``func`` with monkeypatched ``retrieve_blobs_and_proofs``
|
||||
that returns ``blob_data.blobs, blob_data.proofs``.
|
||||
"""
|
||||
def retrieve_blobs_and_proofs(beacon_block_root):
|
||||
return blob_data.blobs, blob_data.proofs
|
||||
|
||||
|
|
Loading…
Reference in New Issue