Update engine_getBlobsV2 response type and add getBlobsV2 tests (#7505)

Update `engine_getBlobsV2` response type to `Option<Vec<BlobsAndProofV2>>`. See recent spec change [here](https://github.com/ethereum/execution-apis/pull/630).

Added some tests to cover basic fetch blob scenarios.
This commit is contained in:
Jimmy Chen
2025-05-26 14:33:34 +10:00
committed by GitHub
parent a2797d4bbd
commit f01dc556d1
8 changed files with 549 additions and 63 deletions

View File

@@ -727,7 +727,7 @@ impl HttpJsonRpc {
pub async fn get_blobs_v2<E: EthSpec>(
&self,
versioned_hashes: Vec<Hash256>,
) -> Result<Vec<Option<BlobAndProofV2<E>>>, Error> {
) -> Result<Option<Vec<BlobAndProofV2<E>>>, Error> {
let params = json!([versioned_hashes]);
self.rpc_request(

View File

@@ -1864,7 +1864,7 @@ impl<E: EthSpec> ExecutionLayer<E> {
pub async fn get_blobs_v2(
&self,
query: Vec<Hash256>,
) -> Result<Vec<Option<BlobAndProofV2<E>>>, Error> {
) -> Result<Option<Vec<BlobAndProofV2<E>>>, Error> {
let capabilities = self.get_engine_capabilities(None).await?;
if capabilities.get_blobs_v2 {