feat: enforce relations between block parts on NodePrimitives (#12846)

This commit is contained in:
Arsenii Kulikov
2024-11-25 17:44:00 +04:00
committed by GitHub
parent 863c5233fc
commit 9f37d40b78
3 changed files with 11 additions and 47 deletions

View File

@ -172,7 +172,7 @@ mod tests {
// [ Headers Creation and Commit ]
{
let sf_rw = StaticFileProvider::<()>::read_write(&static_dir)
let sf_rw = StaticFileProvider::<EthPrimitives>::read_write(&static_dir)
.expect("Failed to create static file provider")
.with_custom_blocks_per_file(blocks_per_file);
@ -191,8 +191,8 @@ mod tests {
// Helper function to prune headers and validate truncation results
fn prune_and_validate(
writer: &mut StaticFileProviderRWRefMut<'_, ()>,
sf_rw: &StaticFileProvider<()>,
writer: &mut StaticFileProviderRWRefMut<'_, EthPrimitives>,
sf_rw: &StaticFileProvider<EthPrimitives>,
static_dir: impl AsRef<Path>,
prune_count: u64,
expected_tip: Option<u64>,

View File

@ -22,8 +22,8 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_errors::ProviderError;
use reth_evm::ConfigureEvmEnv;
use reth_primitives::{
Account, Block, BlockWithSenders, Bytecode, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, TransactionMeta, TransactionSigned,
Account, Block, BlockWithSenders, Bytecode, EthPrimitives, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned,
};
use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId};
@ -558,7 +558,7 @@ impl PruneCheckpointReader for NoopProvider {
}
impl StaticFileProviderFactory for NoopProvider {
type Primitives = ();
type Primitives = EthPrimitives;
fn static_file_provider(&self) -> StaticFileProvider<Self::Primitives> {
StaticFileProvider::read_only(PathBuf::default(), false).unwrap()