storage: clean up reth-primitives import (#10761)

This commit is contained in:
nk_ysg
2024-09-07 17:12:16 +08:00
committed by GitHub
parent 5194bcfbcc
commit 10f3320782
18 changed files with 38 additions and 25 deletions

3
Cargo.lock generated
View File

@ -6667,6 +6667,7 @@ name = "reth-db-common"
version = "1.0.6"
dependencies = [
"alloy-genesis",
"alloy-primitives",
"boyer-moore-magiclen",
"eyre",
"reth-chainspec",
@ -8655,6 +8656,7 @@ dependencies = [
name = "reth-storage-api"
version = "1.0.6"
dependencies = [
"alloy-primitives",
"auto_impl",
"reth-chainspec",
"reth-db-models",
@ -8670,6 +8672,7 @@ dependencies = [
name = "reth-storage-errors"
version = "1.0.6"
dependencies = [
"alloy-primitives",
"alloy-rlp",
"derive_more 1.0.0",
"reth-fs-util",

View File

@ -25,6 +25,7 @@ reth-node-types.workspace = true
# eth
alloy-genesis.workspace = true
alloy-primitives.workspace = true
# misc
eyre.workspace = true

View File

@ -1,6 +1,7 @@
//! Reth genesis initialization utility functions.
use alloy_genesis::GenesisAccount;
use alloy_primitives::{Address, B256, U256};
use reth_chainspec::ChainSpec;
use reth_codecs::Compact;
use reth_config::config::EtlConfig;
@ -8,9 +9,7 @@ use reth_db::tables;
use reth_db_api::{database::Database, transaction::DbTxMut, DatabaseError};
use reth_etl::Collector;
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{
Account, Address, Bytecode, Receipts, StaticFileSegment, StorageEntry, B256, U256,
};
use reth_primitives::{Account, Bytecode, Receipts, StaticFileSegment, StorageEntry};
use reth_provider::{
errors::provider::ProviderResult,
providers::{StaticFileProvider, StaticFileWriter},

View File

@ -11,10 +11,14 @@ repository.workspace = true
workspace = true
[dependencies]
alloy-rlp.workspace = true
# reth
reth-primitives.workspace = true
reth-fs-util.workspace = true
# alloy
alloy-primitives.workspace = true
alloy-rlp.workspace = true
# misc
derive_more.workspace = true

View File

@ -1,9 +1,7 @@
use crate::{db::DatabaseError, lockfile::StorageLockError, writer::UnifiedStorageWriterError};
use alloy_primitives::{Address, BlockHash, BlockNumber, TxNumber, B256, U256};
use derive_more::Display;
use reth_primitives::{
Address, BlockHash, BlockHashOrNumber, BlockNumber, GotExpected, StaticFileSegment,
TxHashOrNumber, TxNumber, B256, U256,
};
use reth_primitives::{BlockHashOrNumber, GotExpected, StaticFileSegment, TxHashOrNumber};
#[cfg(feature = "std")]
use std::path::PathBuf;

View File

@ -22,4 +22,7 @@ reth-stages-types.workspace = true
reth-storage-errors.workspace = true
reth-trie.workspace = true
# alloy
alloy-primitives.workspace = true
auto_impl.workspace = true

View File

@ -1,6 +1,7 @@
use alloy_primitives::{Address, BlockNumber};
use auto_impl::auto_impl;
use reth_db_models::AccountBeforeTx;
use reth_primitives::{Account, Address, BlockNumber};
use reth_primitives::Account;
use reth_storage_errors::provider::ProviderResult;
use std::{
collections::{BTreeMap, BTreeSet},

View File

@ -2,10 +2,11 @@ use crate::{
BlockIdReader, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt,
RequestsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
};
use alloy_primitives::{BlockNumber, B256};
use reth_db_models::StoredBlockBodyIndices;
use reth_primitives::{
Block, BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, BlockWithSenders, Header,
Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, B256,
Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Header, Receipt,
SealedBlock, SealedBlockWithSenders, SealedHeader,
};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeInclusive;

View File

@ -1,4 +1,5 @@
use reth_primitives::{BlockHashOrNumber, BlockNumber, B256};
use alloy_primitives::{BlockNumber, B256};
use reth_primitives::BlockHashOrNumber;
use reth_storage_errors::provider::ProviderResult;
/// Client trait for fetching block hashes by number.

View File

@ -1,6 +1,7 @@
use crate::BlockHashReader;
use alloy_primitives::{BlockNumber, B256};
use reth_chainspec::ChainInfo;
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, B256};
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
/// Client trait for getting important block numbers (such as the latest block number), converting

View File

@ -1,4 +1,5 @@
use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, Header, SealedHeader, U256};
use alloy_primitives::{BlockHash, BlockNumber, U256};
use reth_primitives::{BlockHashOrNumber, Header, SealedHeader};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeBounds;

View File

@ -1,8 +1,8 @@
//! Various noop implementations for traits.
use crate::{BlockHashReader, BlockNumReader};
use alloy_primitives::{BlockNumber, B256};
use reth_chainspec::ChainInfo;
use reth_primitives::{BlockNumber, B256};
use reth_storage_errors::provider::ProviderResult;
/// Supports various api interfaces for testing purposes.

View File

@ -1,7 +1,6 @@
use crate::BlockIdReader;
use reth_primitives::{
BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, Receipt, TxHash, TxNumber,
};
use alloy_primitives::{BlockNumber, TxHash, TxNumber};
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag, Receipt};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeBounds;

View File

@ -1,4 +1,4 @@
use reth_primitives::BlockNumber;
use alloy_primitives::BlockNumber;
use reth_stages_types::{StageCheckpoint, StageId};
use reth_storage_errors::provider::ProviderResult;

View File

@ -2,11 +2,11 @@ use super::{
AccountReader, BlockHashReader, BlockIdReader, StateProofProvider, StateRootProvider,
StorageRootProvider,
};
use alloy_primitives::{Address, BlockHash, BlockNumber, B256, U256};
use auto_impl::auto_impl;
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
Address, BlockHash, BlockId, BlockNumHash, BlockNumber, BlockNumberOrTag, Bytecode, StorageKey,
StorageValue, B256, KECCAK_EMPTY, U256,
BlockId, BlockNumHash, BlockNumberOrTag, Bytecode, StorageKey, StorageValue, KECCAK_EMPTY,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};

View File

@ -1,4 +1,5 @@
use reth_primitives::{Address, BlockNumber, StorageEntry, B256};
use alloy_primitives::{Address, BlockNumber, B256};
use reth_primitives::StorageEntry;
use reth_storage_errors::provider::ProviderResult;
use std::{
collections::{BTreeMap, BTreeSet},

View File

@ -1,7 +1,7 @@
use crate::{BlockNumReader, BlockReader};
use alloy_primitives::{Address, BlockNumber, TxHash, TxNumber};
use reth_primitives::{
Address, BlockHashOrNumber, BlockNumber, TransactionMeta, TransactionSigned,
TransactionSignedNoHash, TxHash, TxNumber,
BlockHashOrNumber, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::ops::{Range, RangeBounds, RangeInclusive};

View File

@ -1,4 +1,4 @@
use reth_primitives::{Address, Bytes, B256};
use alloy_primitives::{Address, Bytes, B256};
use reth_storage_errors::provider::ProviderResult;
use reth_trie::{
prefix_set::TriePrefixSetsMut, updates::TrieUpdates, AccountProof, HashedPostState,