@@ -207,10 +207,9 @@ impl TransactionParser for CardanoTransactionParser {
207
207
from_immutable : Option < ImmutableFileNumber > ,
208
208
until_immutable : ImmutableFileNumber ,
209
209
) -> StdResult < Vec < CardanoTransaction > > {
210
- let up_to_file_number = until_immutable;
211
210
let is_in_bounds = |number : ImmutableFileNumber | match from_immutable {
212
- Some ( from) => from <= number && number <= up_to_file_number ,
213
- None => number <= up_to_file_number ,
211
+ Some ( from) => ( from..=until_immutable ) . contains ( & number) ,
212
+ None => number <= until_immutable ,
214
213
} ;
215
214
let immutable_chunks = ImmutableFile :: list_completed_in_dir ( dirpath) ?
216
215
. into_iter ( )
@@ -278,7 +277,7 @@ mod tests {
278
277
279
278
#[ tokio:: test]
280
279
async fn test_parse_expected_number_of_transactions ( ) {
281
- // We known the number of transactions in those prebuilt immutables
280
+ // We know the number of transactions in those prebuilt immutables
282
281
let immutable_files = [ ( "00000" , 0usize ) , ( "00001" , 2 ) , ( "00002" , 3 ) ] ;
283
282
let db_path = Path :: new ( "../mithril-test-lab/test_data/immutable/" ) ;
284
283
assert ! ( get_number_of_immutable_chunk_in_dir( db_path) >= 3 ) ;
@@ -298,7 +297,7 @@ mod tests {
298
297
299
298
#[ tokio:: test]
300
299
async fn test_parse_from_lower_bound_until_upper_bound ( ) {
301
- // We known the number of transactions in those prebuilt immutables
300
+ // We know the number of transactions in those prebuilt immutables
302
301
let immutable_files = [ ( "00002" , 3 ) ] ;
303
302
let db_path = Path :: new ( "../mithril-test-lab/test_data/immutable/" ) ;
304
303
assert ! ( get_number_of_immutable_chunk_in_dir( db_path) >= 3 ) ;
@@ -356,7 +355,7 @@ mod tests {
356
355
357
356
#[ tokio:: test]
358
357
async fn test_parse_up_to_given_beacon ( ) {
359
- // We known the number of transactions in those prebuilt immutables
358
+ // We know the number of transactions in those prebuilt immutables
360
359
let immutable_files = [ ( "00000" , 0usize ) , ( "00001" , 2 ) ] ;
361
360
let db_path = Path :: new ( "../mithril-test-lab/test_data/immutable/" ) ;
362
361
assert ! ( get_number_of_immutable_chunk_in_dir( db_path) >= 2 ) ;
0 commit comments