From 7063cc408ab920f6a779afbc3907d5e60de7f66a Mon Sep 17 00:00:00 2001 From: thinkAfCod Date: Sun, 21 Apr 2024 23:32:13 +0800 Subject: [PATCH] fix: beacon fetcher test case --- .../src/main/java/io/optimism/l1/BeaconBlobFetcher.java | 1 - .../test/java/io/optimism/l1/BeaconBlobFetcherTest.java | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hildr-node/src/main/java/io/optimism/l1/BeaconBlobFetcher.java b/hildr-node/src/main/java/io/optimism/l1/BeaconBlobFetcher.java index 2c599a0c..0c34aaf7 100644 --- a/hildr-node/src/main/java/io/optimism/l1/BeaconBlobFetcher.java +++ b/hildr-node/src/main/java/io/optimism/l1/BeaconBlobFetcher.java @@ -152,7 +152,6 @@ public List getBlobSidecards(String blockId, final List blockId, indices); } - List blobSiders = res.getData(); return res.getData(); } diff --git a/hildr-node/src/test/java/io/optimism/l1/BeaconBlobFetcherTest.java b/hildr-node/src/test/java/io/optimism/l1/BeaconBlobFetcherTest.java index 94428538..0a524632 100644 --- a/hildr-node/src/test/java/io/optimism/l1/BeaconBlobFetcherTest.java +++ b/hildr-node/src/test/java/io/optimism/l1/BeaconBlobFetcherTest.java @@ -31,7 +31,7 @@ static void setUp() { if (!TestConstants.isConfiguredApiKeyEnv) { return; } - fetcher = new BeaconBlobFetcher(config.l1BeaconUrl()); + fetcher = new BeaconBlobFetcher(config.l1BeaconUrl(), config.l1BeaconArchiverUrl()); } @Test @@ -57,10 +57,9 @@ void getBlobSidecardsAlreadyPrune() { if (!TestConstants.isConfiguredApiKeyEnv) { return; } - var blobFetcher = new BeaconBlobFetcher(config.l1BeaconUrl(), config.l1BeaconArchiverUrl()); - BigInteger slotFromTime = blobFetcher.getSlotFromTime(BigInteger.valueOf(1708659300L)); - List blobSidecards = blobFetcher.getBlobSidecards(slotFromTime.toString(), null); - assertTrue(blobSidecards != null && blobSidecards.size() > 0); + BigInteger slotFromTime = fetcher.getSlotFromTime(BigInteger.valueOf(1708659300L)); + List blobSidecards = fetcher.getBlobSidecards(slotFromTime.toString(), null); + assertTrue(blobSidecards != null && !blobSidecards.isEmpty()); } @Test