diff --git a/crates/prune/src/pruner.rs b/crates/prune/src/pruner.rs index 7be4cfdb5d2e..4ba7be7ceb1e 100644 --- a/crates/prune/src/pruner.rs +++ b/crates/prune/src/pruner.rs @@ -1506,15 +1506,19 @@ mod tests { let tx = TestTransaction::default(); let mut rng = generators::rng(); - let tip = 300; - let blocks = random_block_range(&mut rng, 0..=tip, H256::zero(), 1..5); + let tip = 20000; + let blocks = [ + random_block_range(&mut rng, 0..=100, H256::zero(), 1..5), + random_block_range(&mut rng, (100 + 1)..=(tip - 100), H256::zero(), 0..1), + random_block_range(&mut rng, (tip - 100 + 1)..=tip, H256::zero(), 1..5), + ] + .concat(); tx.insert_blocks(blocks.iter(), None).expect("insert blocks"); let mut receipts = Vec::new(); let (deposit_contract_addr, _) = random_eoa_account(&mut rng); for block in &blocks { - assert!(!block.body.is_empty()); for (txi, transaction) in block.body.iter().enumerate() { let mut receipt = random_receipt(&mut rng, transaction, Some(1)); receipt.logs.push(random_log( @@ -1552,7 +1556,7 @@ mod tests { ..Default::default() }, // Less than total amount of blocks to prune to test the batching logic - PruneBatchSizes::default().with_storage_history(10), + PruneBatchSizes::default().with_receipts(10), ); let result = pruner.prune_receipts_by_logs(&provider, tip);