primitives: rm more alloy_primitives reexports (#11255)

This commit is contained in:
Thomas Coratger
2024-09-29 18:48:54 +02:00
committed by GitHub
parent 55bf29e6d2
commit ea1d04aa75
70 changed files with 150 additions and 128 deletions

View File

@ -1,5 +1,5 @@
#![allow(unreachable_pub)]
use alloy_primitives::Address;
use alloy_primitives::{Address, B256, U256};
use itertools::concat;
use reth_chainspec::ChainSpec;
use reth_db::{tables, test_utils::TempDatabase, Database, DatabaseEnv};
@ -7,7 +7,7 @@ use reth_db_api::{
cursor::DbCursorRO,
transaction::{DbTx, DbTxMut},
};
use reth_primitives::{alloy_primitives::Sealable, Account, SealedBlock, SealedHeader, B256, U256};
use reth_primitives::{alloy_primitives::Sealable, Account, SealedBlock, SealedHeader};
use reth_provider::{DatabaseProvider, DatabaseProviderFactory, TrieWriter};
use reth_stages::{
stages::{AccountHashingStage, StorageHashingStage},

View File

@ -17,7 +17,7 @@
//! # use reth_downloaders::headers::reverse_headers::ReverseHeadersDownloaderBuilder;
//! # use reth_network_p2p::test_utils::{TestBodiesClient, TestHeadersClient};
//! # use reth_evm_ethereum::execute::EthExecutorProvider;
//! # use reth_primitives::B256;
//! # use alloy_primitives::B256;
//! # use reth_chainspec::MAINNET;
//! # use reth_prune_types::PruneModes;
//! # use reth_network_peers::PeerId;

View File

@ -41,11 +41,11 @@ use crate::{
},
StageSet, StageSetBuilder,
};
use alloy_primitives::B256;
use reth_config::config::StageConfig;
use reth_consensus::Consensus;
use reth_evm::execute::BlockExecutorProvider;
use reth_network_p2p::{bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader};
use reth_primitives::B256;
use reth_provider::HeaderSyncGapProvider;
use reth_prune_types::PruneModes;
use reth_stages_api::Stage;

View File

@ -622,7 +622,7 @@ mod tests {
UnwindStageTestRunner,
},
};
use alloy_primitives::{BlockHash, BlockNumber, TxNumber};
use alloy_primitives::{BlockHash, BlockNumber, TxNumber, B256};
use futures_util::Stream;
use reth_db::{static_file::HeaderMask, tables};
use reth_db_api::{
@ -637,9 +637,7 @@ mod tests {
},
error::DownloadResult,
};
use reth_primitives::{
BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment, B256,
};
use reth_primitives::{BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment};
use reth_provider::{
providers::StaticFileWriter, test_utils::MockNodeTypesWithDB, HeaderProvider,
ProviderFactory, StaticFileProviderFactory, TransactionsProvider,

View File

@ -658,14 +658,14 @@ where
mod tests {
use super::*;
use crate::test_utils::TestStageDB;
use alloy_primitives::{hex_literal::hex, keccak256, Address};
use alloy_primitives::{address, hex_literal::hex, keccak256, Address, B256, U256};
use alloy_rlp::Decodable;
use assert_matches::assert_matches;
use reth_chainspec::ChainSpecBuilder;
use reth_db_api::{models::AccountBeforeTx, transaction::DbTxMut};
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_execution_errors::BlockValidationError;
use reth_primitives::{address, Account, Bytecode, SealedBlock, StorageEntry, B256, U256};
use reth_primitives::{Account, Bytecode, SealedBlock, StorageEntry};
use reth_provider::{
test_utils::create_test_provider_factory, AccountReader, DatabaseProviderFactory,
ReceiptProvider, StaticFileProviderFactory,

View File

@ -1,4 +1,4 @@
use alloy_primitives::keccak256;
use alloy_primitives::{keccak256, B256};
use itertools::Itertools;
use reth_config::config::{EtlConfig, HashingConfig};
use reth_db::{tables, RawKey, RawTable, RawValue};
@ -7,7 +7,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut},
};
use reth_etl::Collector;
use reth_primitives::{Account, B256};
use reth_primitives::Account;
use reth_provider::{AccountExtReader, DBProvider, HashingWriter, StatsReader};
use reth_stages_api::{
AccountHashingCheckpoint, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint,
@ -65,8 +65,8 @@ impl AccountHashingStage {
provider: &reth_provider::DatabaseProvider<Tx, Spec>,
opts: SeedOpts,
) -> Result<Vec<(alloy_primitives::Address, reth_primitives::Account)>, StageError> {
use alloy_primitives::U256;
use reth_db_api::models::AccountBeforeTx;
use reth_primitives::U256;
use reth_provider::{StaticFileProviderFactory, StaticFileWriter};
use reth_testing_utils::{
generators,
@ -298,8 +298,9 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
UnwindStageTestRunner,
};
use alloy_primitives::U256;
use assert_matches::assert_matches;
use reth_primitives::{Account, U256};
use reth_primitives::Account;
use reth_provider::providers::StaticFileWriter;
use reth_stages_api::StageUnitCheckpoint;
use test_utils::*;

View File

@ -1,4 +1,4 @@
use alloy_primitives::keccak256;
use alloy_primitives::{bytes::BufMut, keccak256, B256};
use itertools::Itertools;
use reth_config::config::{EtlConfig, HashingConfig};
use reth_db::tables;
@ -9,7 +9,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut},
};
use reth_etl::Collector;
use reth_primitives::{BufMut, StorageEntry, B256};
use reth_primitives::StorageEntry;
use reth_provider::{DBProvider, HashingWriter, StatsReader, StorageReader};
use reth_stages_api::{
EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId,
@ -212,14 +212,14 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner,
};
use alloy_primitives::Address;
use alloy_primitives::{Address, U256};
use assert_matches::assert_matches;
use rand::Rng;
use reth_db_api::{
cursor::{DbCursorRW, DbDupCursorRO},
models::StoredBlockBodyIndices,
};
use reth_primitives::{SealedBlock, U256};
use reth_primitives::SealedBlock;
use reth_provider::providers::StaticFileWriter;
use reth_testing_utils::generators::{
self, random_block_range, random_contract_account_range, BlockRangeParams,

View File

@ -1,4 +1,4 @@
use alloy_primitives::{BlockHash, BlockNumber};
use alloy_primitives::{BlockHash, BlockNumber, B256};
use futures_util::StreamExt;
use reth_codecs::Compact;
use reth_config::config::EtlConfig;
@ -11,7 +11,7 @@ use reth_db_api::{
};
use reth_etl::Collector;
use reth_network_p2p::headers::{downloader::HeaderDownloader, error::HeadersDownloaderError};
use reth_primitives::{SealedHeader, StaticFileSegment, B256};
use reth_primitives::{SealedHeader, StaticFileSegment};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
BlockHashReader, DBProvider, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider,
@ -378,10 +378,11 @@ mod tests {
use crate::test_utils::{
stage_test_suite, ExecuteStageTestRunner, StageTestRunner, UnwindStageTestRunner,
};
use alloy_primitives::B256;
use assert_matches::assert_matches;
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
alloy_primitives::Sealable, BlockBody, SealedBlock, SealedBlockWithSenders, B256,
alloy_primitives::Sealable, BlockBody, SealedBlock, SealedBlockWithSenders,
};
use reth_provider::{BlockWriter, ProviderFactory, StaticFileProviderFactory};
use reth_stages_api::StageUnitCheckpoint;

View File

@ -148,7 +148,7 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner,
};
use alloy_primitives::BlockNumber;
use alloy_primitives::{address, BlockNumber, B256};
use itertools::Itertools;
use reth_db::BlockNumberList;
use reth_db_api::{
@ -159,7 +159,6 @@ mod tests {
},
transaction::DbTx,
};
use reth_primitives::{address, B256};
use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory};
use reth_testing_utils::generators::{
self, random_block_range, random_changeset_range, random_contract_account_range,

View File

@ -153,7 +153,7 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError,
TestStageDB, UnwindStageTestRunner,
};
use alloy_primitives::{Address, BlockNumber};
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use itertools::Itertools;
use reth_db::BlockNumberList;
use reth_db_api::{
@ -164,7 +164,7 @@ mod tests {
},
transaction::DbTx,
};
use reth_primitives::{address, b256, StorageEntry, B256, U256};
use reth_primitives::StorageEntry;
use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory};
use reth_testing_utils::generators::{
self, random_block_range, random_changeset_range, random_contract_account_range,

View File

@ -1,9 +1,9 @@
use alloy_primitives::BlockNumber;
use alloy_primitives::{BlockNumber, B256};
use reth_codecs::Compact;
use reth_consensus::ConsensusError;
use reth_db::tables;
use reth_db_api::transaction::{DbTx, DbTxMut};
use reth_primitives::{alloy_primitives::Sealable, GotExpected, SealedHeader, B256};
use reth_primitives::{alloy_primitives::Sealable, GotExpected, SealedHeader};
use reth_provider::{
DBProvider, HeaderProvider, ProviderError, StageCheckpointReader, StageCheckpointWriter,
StatsReader, TrieWriter,
@ -374,10 +374,10 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner,
};
use alloy_primitives::keccak256;
use alloy_primitives::{keccak256, U256};
use assert_matches::assert_matches;
use reth_db_api::cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO};
use reth_primitives::{SealedBlock, StaticFileSegment, StorageEntry, U256};
use reth_primitives::{SealedBlock, StaticFileSegment, StorageEntry};
use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory};
use reth_stages_api::StageUnitCheckpoint;
use reth_testing_utils::generators::{

View File

@ -42,7 +42,7 @@ use utils::*;
mod tests {
use super::*;
use crate::test_utils::{StorageKind, TestStageDB};
use alloy_primitives::{hex_literal::hex, keccak256, BlockNumber};
use alloy_primitives::{address, hex_literal::hex, keccak256, BlockNumber, B256, U256};
use alloy_rlp::Decodable;
use reth_chainspec::ChainSpecBuilder;
use reth_db::{
@ -56,7 +56,7 @@ mod tests {
};
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_exex::ExExManagerHandle;
use reth_primitives::{address, Account, Bytecode, SealedBlock, StaticFileSegment, B256, U256};
use reth_primitives::{Account, Bytecode, SealedBlock, StaticFileSegment};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
test_utils::MockNodeTypesWithDB,

View File

@ -169,7 +169,8 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner,
};
use reth_primitives::{SealedBlock, B256};
use alloy_primitives::B256;
use reth_primitives::SealedBlock;
use reth_provider::{
providers::StaticFileWriter, TransactionsProvider, TransactionsProviderExt,
};

View File

@ -334,10 +334,10 @@ struct FailedSenderRecoveryError {
#[cfg(test)]
mod tests {
use alloy_primitives::BlockNumber;
use alloy_primitives::{BlockNumber, B256};
use assert_matches::assert_matches;
use reth_db_api::cursor::DbCursorRO;
use reth_primitives::{SealedBlock, TransactionSigned, B256};
use reth_primitives::{SealedBlock, TransactionSigned};
use reth_provider::{
providers::StaticFileWriter, DatabaseProviderFactory, PruneCheckpointWriter,
StaticFileProviderFactory, TransactionsProvider,

View File

@ -250,9 +250,9 @@ mod tests {
stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind,
TestRunnerError, TestStageDB, UnwindStageTestRunner,
};
use alloy_primitives::BlockNumber;
use alloy_primitives::{BlockNumber, B256};
use assert_matches::assert_matches;
use reth_primitives::{SealedBlock, B256};
use reth_primitives::SealedBlock;
use reth_provider::{
providers::StaticFileWriter, DatabaseProviderFactory, StaticFileProviderFactory,
};

View File

@ -1,4 +1,4 @@
use alloy_primitives::{keccak256, Address, BlockNumber, TxNumber};
use alloy_primitives::{keccak256, Address, BlockNumber, TxNumber, B256, U256};
use reth_chainspec::MAINNET;
use reth_db::{
tables,
@ -15,8 +15,7 @@ use reth_db_api::{
DatabaseError as DbError,
};
use reth_primitives::{
Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, B256,
U256,
Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash,
};
use reth_provider::{
providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter},