mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
primitives: rm more alloy_primitives reexports (#11250)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -11,6 +11,7 @@ pub use exex::ExExLauncher;
|
||||
|
||||
use std::{future::Future, sync::Arc};
|
||||
|
||||
use alloy_primitives::utils::format_ether;
|
||||
use alloy_rpc_types::engine::ClientVersionV1;
|
||||
use futures::{future::Either, stream, stream_select, StreamExt};
|
||||
use reth_beacon_consensus::{
|
||||
@ -33,7 +34,6 @@ use reth_node_core::{
|
||||
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
|
||||
};
|
||||
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
|
||||
use reth_primitives::format_ether;
|
||||
use reth_provider::providers::BlockchainProvider;
|
||||
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
|
||||
use reth_tasks::TaskExecutor;
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
#![allow(missing_docs)]
|
||||
use alloy_primitives::hex_literal::hex;
|
||||
use alloy_rlp::Decodable;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use pprof::criterion::{Output, PProfProfiler};
|
||||
use reth_primitives::{hex_literal::hex, TransactionSigned};
|
||||
use reth_primitives::TransactionSigned;
|
||||
|
||||
/// Benchmarks the recovery of the public key from the ECDSA message using criterion.
|
||||
pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
|
||||
@ -709,8 +709,8 @@ impl<'a> arbitrary::Arbitrary<'a> for BlockBody {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{BlockNumberOrTag::*, *};
|
||||
use crate::hex_literal::hex;
|
||||
use alloy_eips::eip1898::HexStringMissingPrefixError;
|
||||
use alloy_primitives::hex_literal::hex;
|
||||
use alloy_rlp::{Decodable, Encodable};
|
||||
use std::str::FromStr;
|
||||
|
||||
|
||||
@ -72,9 +72,7 @@ pub use transaction::{
|
||||
pub use alloy_primitives::{
|
||||
self, address, b256, bloom, bytes,
|
||||
bytes::{Buf, BufMut, BytesMut},
|
||||
hex, hex_literal, ruint,
|
||||
utils::format_ether,
|
||||
Bytes, StorageValue, TxHash, TxIndex, TxNumber, B128, B256, B512, B64, U128, U256, U64,
|
||||
hex, Bytes, TxHash, B256, U256, U64,
|
||||
};
|
||||
pub use reth_ethereum_forks::*;
|
||||
pub use revm_primitives::{self, JumpTable};
|
||||
|
||||
@ -65,9 +65,9 @@ pub fn calculate_ommers_root(ommers: &[Header]) -> B256 {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{constants::EMPTY_ROOT_HASH, hex_literal::hex, Block, U256};
|
||||
use crate::{constants::EMPTY_ROOT_HASH, Block, U256};
|
||||
use alloy_genesis::GenesisAccount;
|
||||
use alloy_primitives::{b256, Address};
|
||||
use alloy_primitives::{b256, hex_literal::hex, Address};
|
||||
use alloy_rlp::Decodable;
|
||||
use reth_chainspec::{HOLESKY, MAINNET, SEPOLIA};
|
||||
use reth_trie_common::root::{state_root_ref_unhashed, state_root_unhashed};
|
||||
|
||||
@ -501,8 +501,7 @@ impl<'a> Encodable for ReceiptWithBloomEncoder<'a> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::hex_literal::hex;
|
||||
use alloy_primitives::{address, b256, bytes};
|
||||
use alloy_primitives::{address, b256, bytes, hex_literal::hex};
|
||||
|
||||
// Test vector from: https://eips.ethereum.org/EIPS/eip-2481
|
||||
#[test]
|
||||
|
||||
@ -1921,7 +1921,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn decode_raw_tx_and_recover_signer() {
|
||||
use crate::hex_literal::hex;
|
||||
use alloy_primitives::hex_literal::hex;
|
||||
// transaction is from ropsten
|
||||
|
||||
let hash: B256 =
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
use crate::U64;
|
||||
use alloy_primitives::U8;
|
||||
use alloy_primitives::{U64, U8};
|
||||
use alloy_rlp::{Decodable, Encodable};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ impl StateProvider for StateProviderTest {
|
||||
&self,
|
||||
account: Address,
|
||||
storage_key: StorageKey,
|
||||
) -> ProviderResult<Option<reth_primitives::StorageValue>> {
|
||||
) -> ProviderResult<Option<alloy_primitives::StorageValue>> {
|
||||
Ok(self.accounts.get(&account).and_then(|(storage, _)| storage.get(&storage_key).copied()))
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ use std::{
|
||||
use futures_util::TryStreamExt;
|
||||
use tracing::*;
|
||||
|
||||
use alloy_primitives::TxNumber;
|
||||
use reth_db::tables;
|
||||
use reth_db_api::{
|
||||
cursor::{DbCursorRO, DbCursorRW},
|
||||
@ -13,7 +14,7 @@ use reth_db_api::{
|
||||
transaction::DbTxMut,
|
||||
};
|
||||
use reth_network_p2p::bodies::{downloader::BodyDownloader, response::BlockResponse};
|
||||
use reth_primitives::{StaticFileSegment, TxNumber};
|
||||
use reth_primitives::StaticFileSegment;
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileWriter},
|
||||
BlockReader, DBProvider, ProviderError, StaticFileProviderFactory, StatsReader,
|
||||
@ -621,7 +622,7 @@ mod tests {
|
||||
UnwindStageTestRunner,
|
||||
},
|
||||
};
|
||||
use alloy_primitives::{BlockHash, BlockNumber};
|
||||
use alloy_primitives::{BlockHash, BlockNumber, TxNumber};
|
||||
use futures_util::Stream;
|
||||
use reth_db::{static_file::HeaderMask, tables};
|
||||
use reth_db_api::{
|
||||
@ -637,7 +638,7 @@ mod tests {
|
||||
error::DownloadResult,
|
||||
};
|
||||
use reth_primitives::{
|
||||
BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment, TxNumber, B256,
|
||||
BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment, B256,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::StaticFileWriter, test_utils::MockNodeTypesWithDB, HeaderProvider,
|
||||
|
||||
@ -658,16 +658,14 @@ where
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::test_utils::TestStageDB;
|
||||
use alloy_primitives::{keccak256, Address};
|
||||
use alloy_primitives::{hex_literal::hex, keccak256, Address};
|
||||
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, hex_literal::hex, Account, Bytecode, SealedBlock, StorageEntry, B256, U256,
|
||||
};
|
||||
use reth_primitives::{address, Account, Bytecode, SealedBlock, StorageEntry, B256, U256};
|
||||
use reth_provider::{
|
||||
test_utils::create_test_provider_factory, AccountReader, DatabaseProviderFactory,
|
||||
ReceiptProvider, StaticFileProviderFactory,
|
||||
|
||||
@ -42,7 +42,7 @@ use utils::*;
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::test_utils::{StorageKind, TestStageDB};
|
||||
use alloy_primitives::{keccak256, BlockNumber};
|
||||
use alloy_primitives::{hex_literal::hex, keccak256, BlockNumber};
|
||||
use alloy_rlp::Decodable;
|
||||
use reth_chainspec::ChainSpecBuilder;
|
||||
use reth_db::{
|
||||
@ -56,9 +56,7 @@ mod tests {
|
||||
};
|
||||
use reth_evm_ethereum::execute::EthExecutorProvider;
|
||||
use reth_exex::ExExManagerHandle;
|
||||
use reth_primitives::{
|
||||
address, hex_literal::hex, Account, Bytecode, SealedBlock, StaticFileSegment, B256, U256,
|
||||
};
|
||||
use reth_primitives::{address, Account, Bytecode, SealedBlock, StaticFileSegment, B256, U256};
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileWriter},
|
||||
test_utils::MockNodeTypesWithDB,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use alloy_primitives::Address;
|
||||
use alloy_primitives::{Address, TxNumber};
|
||||
use reth_config::config::SenderRecoveryConfig;
|
||||
use reth_consensus::ConsensusError;
|
||||
use reth_db::{static_file::TransactionMask, tables, RawValue};
|
||||
@ -7,7 +7,7 @@ use reth_db_api::{
|
||||
transaction::{DbTx, DbTxMut},
|
||||
DbTxUnwindExt,
|
||||
};
|
||||
use reth_primitives::{GotExpected, StaticFileSegment, TransactionSignedNoHash, TxNumber};
|
||||
use reth_primitives::{GotExpected, StaticFileSegment, TransactionSignedNoHash};
|
||||
use reth_provider::{
|
||||
BlockReader, DBProvider, HeaderProvider, ProviderError, PruneCheckpointReader,
|
||||
StaticFileProviderFactory, StatsReader,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
use alloy_primitives::{TxHash, TxNumber};
|
||||
use num_traits::Zero;
|
||||
use reth_config::config::{EtlConfig, TransactionLookupConfig};
|
||||
use reth_db::{tables, RawKey, RawValue};
|
||||
@ -6,7 +7,6 @@ use reth_db_api::{
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
use reth_etl::Collector;
|
||||
use reth_primitives::{TxHash, TxNumber};
|
||||
use reth_provider::{
|
||||
BlockReader, DBProvider, PruneCheckpointReader, PruneCheckpointWriter,
|
||||
StaticFileProviderFactory, StatsReader, TransactionsProvider, TransactionsProviderExt,
|
||||
@ -109,7 +109,7 @@ where
|
||||
}
|
||||
}
|
||||
if input.target_reached() {
|
||||
return Ok(ExecOutput::done(input.checkpoint()))
|
||||
return Ok(ExecOutput::done(input.checkpoint()));
|
||||
}
|
||||
|
||||
// 500MB temporary files
|
||||
@ -172,7 +172,7 @@ where
|
||||
"Transaction hashes inserted"
|
||||
);
|
||||
|
||||
break
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ where
|
||||
let mut rev_walker = body_cursor.walk_back(Some(*range.end()))?;
|
||||
while let Some((number, body)) = rev_walker.next().transpose()? {
|
||||
if number <= unwind_to {
|
||||
break
|
||||
break;
|
||||
}
|
||||
|
||||
// Delete all transactions that belong to this block
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use alloy_primitives::{keccak256, Address, BlockNumber};
|
||||
use alloy_primitives::{keccak256, Address, BlockNumber, TxNumber};
|
||||
use reth_chainspec::MAINNET;
|
||||
use reth_db::{
|
||||
tables,
|
||||
@ -15,8 +15,8 @@ use reth_db_api::{
|
||||
DatabaseError as DbError,
|
||||
};
|
||||
use reth_primitives::{
|
||||
Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, TxNumber,
|
||||
B256, U256,
|
||||
Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, B256,
|
||||
U256,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter},
|
||||
|
||||
@ -56,7 +56,7 @@ impl Deref for LoadedJar {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{test_utils::create_test_provider_factory, HeaderProvider};
|
||||
use alloy_primitives::{BlockHash, B256, U256};
|
||||
use alloy_primitives::{BlockHash, TxNumber, B256, U256};
|
||||
use rand::seq::SliceRandom;
|
||||
use reth_db::{
|
||||
test_utils::create_test_static_files_dir, CanonicalHeaders, HeaderNumbers,
|
||||
@ -65,7 +65,7 @@ mod tests {
|
||||
use reth_db_api::transaction::DbTxMut;
|
||||
use reth_primitives::{
|
||||
static_file::{find_fixed_range, SegmentRangeInclusive, DEFAULT_BLOCKS_PER_STATIC_FILE},
|
||||
Header, Receipt, TransactionSignedNoHash, TxNumber,
|
||||
Header, Receipt, TransactionSignedNoHash,
|
||||
};
|
||||
use reth_storage_api::{ReceiptProvider, TransactionsProvider};
|
||||
use reth_testing_utils::generators::{self, random_header_range};
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
//! Dummy blocks and data for tests
|
||||
use crate::{DatabaseProviderRW, ExecutionOutcome};
|
||||
use alloy_consensus::TxLegacy;
|
||||
use alloy_primitives::{map::HashMap, Address, BlockNumber, Log, Parity, Sealable, TxKind};
|
||||
use alloy_primitives::{
|
||||
hex_literal::hex, map::HashMap, Address, BlockNumber, Log, Parity, Sealable, TxKind,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use reth_db::tables;
|
||||
use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
|
||||
use reth_primitives::{
|
||||
alloy_primitives, b256, hex_literal::hex, Account, BlockBody, Bytes, Header, Receipt,
|
||||
SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction, TransactionSigned,
|
||||
TxType, Withdrawal, Withdrawals, B256, U256,
|
||||
alloy_primitives, b256, Account, BlockBody, Bytes, Header, Receipt, SealedBlock,
|
||||
SealedBlockWithSenders, SealedHeader, Signature, Transaction, TransactionSigned, TxType,
|
||||
Withdrawal, Withdrawals, B256, U256,
|
||||
};
|
||||
use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
|
||||
use revm::{db::BundleState, primitives::AccountInfo};
|
||||
|
||||
@ -209,8 +209,8 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use alloy_primitives::hex_literal::hex;
|
||||
use reth_db_api::{cursor::DbCursorRW, transaction::DbTxMut};
|
||||
use reth_primitives::hex_literal::hex;
|
||||
use reth_provider::test_utils::create_test_provider_factory;
|
||||
|
||||
#[test]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use alloy_primitives::{keccak256, Address, B256, U256};
|
||||
use alloy_primitives::{hex_literal::hex, keccak256, Address, B256, U256};
|
||||
use proptest::{prelude::ProptestConfig, proptest};
|
||||
use proptest_arbitrary_interop::arb;
|
||||
use reth_db::{tables, test_utils::TempDatabase, DatabaseEnv};
|
||||
@ -8,7 +8,7 @@ use reth_db_api::{
|
||||
cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO},
|
||||
transaction::DbTxMut,
|
||||
};
|
||||
use reth_primitives::{constants::EMPTY_ROOT_HASH, hex_literal::hex, Account, StorageEntry};
|
||||
use reth_primitives::{constants::EMPTY_ROOT_HASH, Account, StorageEntry};
|
||||
use reth_provider::{
|
||||
test_utils::create_test_provider_factory, DatabaseProviderRW, StorageTrieWriter, TrieWriter,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user