feat: use alloy block types (#13518)

This commit is contained in:
Matthias Seitz
2024-12-31 10:30:15 +01:00
committed by GitHub
parent 9a062c0844
commit f163b3d3f9
8 changed files with 111 additions and 388 deletions

View File

@ -146,7 +146,6 @@ impl PruneInput {
mod tests {
use super::*;
use alloy_primitives::B256;
use reth_primitives_traits::BlockBody;
use reth_provider::{
providers::BlockchainProvider2,
test_utils::{create_test_provider_factory, MockEthProvider},
@ -243,8 +242,7 @@ mod tests {
let range = input.get_next_tx_num_range(&provider).expect("Expected range").unwrap();
// Calculate the total number of transactions
let num_txs =
blocks.iter().map(|block| block.body.transactions().len() as u64).sum::<u64>();
let num_txs = blocks.iter().map(|block| block.body.transactions.len() as u64).sum::<u64>();
assert_eq!(range, 0..=num_txs - 1);
}
@ -290,8 +288,7 @@ mod tests {
let range = input.get_next_tx_num_range(&provider).expect("Expected range").unwrap();
// Calculate the total number of transactions
let num_txs =
blocks.iter().map(|block| block.body.transactions().len() as u64).sum::<u64>();
let num_txs = blocks.iter().map(|block| block.body.transactions.len() as u64).sum::<u64>();
assert_eq!(range, 0..=num_txs - 1,);
}
@ -325,8 +322,7 @@ mod tests {
// Get the last tx number
// Calculate the total number of transactions
let num_txs =
blocks.iter().map(|block| block.body.transactions().len() as u64).sum::<u64>();
let num_txs = blocks.iter().map(|block| block.body.transactions.len() as u64).sum::<u64>();
let max_range = num_txs - 1;
// Create a prune input with a previous checkpoint that is the last tx number