Update get blobs endpoint to return a list of BlobSidecars (#4109)

* Update get blobs endpoint to return BlobSidecarList

* Update code comment

* Update blob retrieval to return BlobSidecarList without Arc

* Remove usage of BlobSidecarList type alias to avoid code conflicts

* Add clippy allow exception
This commit is contained in:
Jimmy Chen
2023-03-22 01:56:32 +11:00
committed by GitHub
parent 78414333a2
commit b40dceaae9
4 changed files with 77 additions and 55 deletions

View File

@@ -1057,6 +1057,23 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.map(Some)
}
// FIXME(jimmy): temporary method added to unblock API work. This method will be replaced by
// the `get_blobs` method below once the new blob sidecar structure (`BlobSidecarList`) is
// implemented in that method.
#[allow(clippy::type_complexity)] // FIXME: this will be fixed by the `BlobSidecarList` alias in Sean's PR
pub fn get_blob_sidecar_list(
&self,
_block_root: &Hash256,
_data_availability_boundary: Epoch,
) -> Result<
Option<
VariableList<Arc<BlobSidecar<T::EthSpec>>, <T::EthSpec as EthSpec>::MaxBlobsPerBlock>,
>,
Error,
> {
unimplemented!("update to use the updated `get_blobs` method instead once this PR is merged: https://github.com/sigp/lighthouse/pull/4104")
}
/// Returns the blobs at the given root, if any.
///
/// Returns `Ok(None)` if the blobs and associated block are not found.