From 7004e91ec5570ab3de489aa8093636c68d81af9c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 18 Apr 2024 09:50:01 +1000 Subject: [PATCH] Fix tests. --- .../beacon_chain/src/data_availability_checker.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/beacon_node/beacon_chain/src/data_availability_checker.rs b/beacon_node/beacon_chain/src/data_availability_checker.rs index 6080e9fba77..e482fd3582b 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker.rs @@ -315,11 +315,6 @@ impl DataAvailabilityChecker { blocks: Vec>, ) -> Result>, AvailabilityCheckError> { let mut results = Vec::with_capacity(blocks.len()); - let kzg = self - .kzg - .as_ref() - .ok_or(AvailabilityCheckError::KzgNotInitialized)?; - let all_blobs: BlobSidecarList = blocks .iter() .filter(|block| self.blobs_required_for_block(block.as_block())) @@ -331,6 +326,10 @@ impl DataAvailabilityChecker { // verify kzg for all blobs at once if !all_blobs.is_empty() { + let kzg = self + .kzg + .as_ref() + .ok_or(AvailabilityCheckError::KzgNotInitialized)?; verify_kzg_for_blob_list(all_blobs.iter(), kzg)?; }