From d97732e0261777e45898db579dd29548ff6b4097 Mon Sep 17 00:00:00 2001 From: joshieDo <93316087+joshieDo@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:14:41 +0000 Subject: [PATCH] fix test --- .../static-file/src/static_file_producer.rs | 38 ++++++++++++------- crates/static-file/types/src/lib.rs | 5 ++- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/crates/static-file/static-file/src/static_file_producer.rs b/crates/static-file/static-file/src/static_file_producer.rs index 56b25d0d4a4d8..df682de90b110 100644 --- a/crates/static-file/static-file/src/static_file_producer.rs +++ b/crates/static-file/static-file/src/static_file_producer.rs @@ -228,10 +228,7 @@ where ) }), block_meta: finalized_block_numbers.block_meta.and_then(|finalized_block_number| { - self.get_static_file_target( - highest_static_files.block_meta, - finalized_block_number, - ) + self.get_static_file_target(highest_static_files.block_meta, finalized_block_number) }), }; @@ -329,7 +326,7 @@ mod tests { headers: Some(1), receipts: Some(1), transactions: Some(1), - block_meta: Some(1), + block_meta: None, }) .expect("get static file targets"); assert_eq!( @@ -338,13 +335,18 @@ mod tests { headers: Some(0..=1), receipts: Some(0..=1), transactions: Some(0..=1), - block_meta: Some(0..=1) + block_meta: None } ); assert_matches!(static_file_producer.run(targets), Ok(_)); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(1), receipts: Some(1), transactions: Some(1), block_meta: Some(1) } + HighestStaticFiles { + headers: Some(1), + receipts: Some(1), + transactions: Some(1), + block_meta: None + } ); let targets = static_file_producer @@ -352,7 +354,7 @@ mod tests { headers: Some(3), receipts: Some(3), transactions: Some(3), - block_meta: Some(3), + block_meta: None, }) .expect("get static file targets"); assert_eq!( @@ -361,13 +363,18 @@ mod tests { headers: Some(2..=3), receipts: Some(2..=3), transactions: Some(2..=3), - block_meta: Some(2..=3) + block_meta: None } ); assert_matches!(static_file_producer.run(targets), Ok(_)); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(3), receipts: Some(3), transactions: Some(3), block_meta: Some(3) } + HighestStaticFiles { + headers: Some(3), + receipts: Some(3), + transactions: Some(3), + block_meta: None + } ); let targets = static_file_producer @@ -375,7 +382,7 @@ mod tests { headers: Some(4), receipts: Some(4), transactions: Some(4), - block_meta: Some(4), + block_meta: None, }) .expect("get static file targets"); assert_eq!( @@ -384,7 +391,7 @@ mod tests { headers: Some(4..=4), receipts: Some(4..=4), transactions: Some(4..=4), - block_meta: Some(4..=4) + block_meta: None } ); assert_matches!( @@ -393,7 +400,12 @@ mod tests { ); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(3), receipts: Some(3), transactions: Some(3), block_meta: Some(3) } + HighestStaticFiles { + headers: Some(3), + receipts: Some(3), + transactions: Some(3), + block_meta: None + } ); } diff --git a/crates/static-file/types/src/lib.rs b/crates/static-file/types/src/lib.rs index 398755698afea..bf52b4dee36e1 100644 --- a/crates/static-file/types/src/lib.rs +++ b/crates/static-file/types/src/lib.rs @@ -92,7 +92,10 @@ pub struct StaticFileTargets { impl StaticFileTargets { /// Returns `true` if any of the targets are [Some]. pub const fn any(&self) -> bool { - self.headers.is_some() || self.receipts.is_some() || self.transactions.is_some() || self.block_meta.is_some() + self.headers.is_some() || + self.receipts.is_some() || + self.transactions.is_some() || + self.block_meta.is_some() } /// Returns `true` if all targets are either [`None`] or has beginning of the range equal to the