chore: rm reth-primitives from reth-rpc-eth-types (#15004)

This commit is contained in:
Dan Cline
2025-03-13 09:25:39 -04:00
committed by GitHub
parent 2a36f6958e
commit 757f39f1a8
12 changed files with 22 additions and 25 deletions

2
Cargo.lock generated
View File

@@ -9555,10 +9555,10 @@ dependencies = [
"reth-chain-state",
"reth-chainspec",
"reth-errors",
"reth-ethereum-primitives",
"reth-evm",
"reth-execution-types",
"reth-metrics",
"reth-primitives",
"reth-primitives-traits",
"reth-revm",
"reth-rpc-server-types",

View File

@@ -18,7 +18,7 @@ reth-errors.workspace = true
reth-evm.workspace = true
reth-execution-types.workspace = true
reth-metrics.workspace = true
reth-primitives = { workspace = true, features = ["secp256k1"] }
reth-ethereum-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-storage-api.workspace = true
reth-revm.workspace = true

View File

@@ -110,7 +110,7 @@ impl reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'_> {
fn basic_account(
&self,
address: &revm_primitives::Address,
) -> reth_errors::ProviderResult<Option<reth_primitives::Account>> {
) -> reth_errors::ProviderResult<Option<reth_primitives_traits::Account>> {
self.0.basic_account(address)
}
}
@@ -160,14 +160,14 @@ impl StateProvider for StateProviderTraitObjWrapper<'_> {
fn bytecode_by_hash(
&self,
code_hash: &B256,
) -> reth_errors::ProviderResult<Option<reth_primitives::Bytecode>> {
) -> reth_errors::ProviderResult<Option<reth_primitives_traits::Bytecode>> {
self.0.bytecode_by_hash(code_hash)
}
fn account_code(
&self,
addr: &revm_primitives::Address,
) -> reth_errors::ProviderResult<Option<reth_primitives::Bytecode>> {
) -> reth_errors::ProviderResult<Option<reth_primitives_traits::Bytecode>> {
self.0.account_code(addr)
}

View File

@@ -7,8 +7,7 @@ use futures::{future::Either, Stream, StreamExt};
use reth_chain_state::CanonStateNotification;
use reth_errors::{ProviderError, ProviderResult};
use reth_execution_types::Chain;
use reth_primitives::{NodePrimitives, RecoveredBlock};
use reth_primitives_traits::{Block, BlockBody};
use reth_primitives_traits::{Block, BlockBody, NodePrimitives, RecoveredBlock};
use reth_storage_api::{BlockReader, TransactionVariant};
use reth_tasks::{TaskSpawner, TokioTaskExecutor};
use schnellru::{ByLength, Limiter};

View File

@@ -9,7 +9,7 @@ use alloy_sol_types::{ContractError, RevertReason};
pub use api::{AsEthApiError, FromEthApiError, FromEvmError, IntoEthApiError};
use core::time::Duration;
use reth_errors::{BlockExecutionError, RethError};
use reth_primitives_traits::transaction::signed::RecoveryError;
use reth_primitives_traits::transaction::{error::InvalidTransactionError, signed::RecoveryError};
use reth_rpc_server_types::result::{
block_id_to_str, internal_rpc_err, invalid_params_rpc_err, rpc_err, rpc_error_with_code,
};
@@ -584,9 +584,9 @@ impl From<InvalidTransaction> for RpcInvalidTransactionError {
}
}
impl From<reth_primitives::InvalidTransactionError> for RpcInvalidTransactionError {
fn from(err: reth_primitives::InvalidTransactionError) -> Self {
use reth_primitives::InvalidTransactionError;
impl From<InvalidTransactionError> for RpcInvalidTransactionError {
fn from(err: InvalidTransactionError) -> Self {
use InvalidTransactionError;
// This conversion is used to convert any transaction errors that could occur inside the
// txpool (e.g. `eth_sendRawTransaction`) to their corresponding RPC
match err {

View File

@@ -17,8 +17,7 @@ use futures::{
use metrics::atomics::AtomicU64;
use reth_chain_state::CanonStateNotification;
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
use reth_primitives::{NodePrimitives, SealedBlock};
use reth_primitives_traits::{Block, BlockBody};
use reth_primitives_traits::{Block, BlockBody, NodePrimitives, SealedBlock};
use reth_rpc_server_types::constants::gas_oracle::MAX_HEADER_HISTORY;
use reth_storage_api::BlockReaderIdExt;
use serde::{Deserialize, Serialize};

View File

@@ -8,8 +8,7 @@ use alloy_primitives::TxHash;
use alloy_rpc_types_eth::{FilteredParams, Log};
use reth_chainspec::ChainInfo;
use reth_errors::ProviderError;
use reth_primitives::RecoveredBlock;
use reth_primitives_traits::{BlockBody, SignedTransaction};
use reth_primitives_traits::{BlockBody, RecoveredBlock, SignedTransaction};
use reth_storage_api::{BlockReader, ProviderBlock};
use std::sync::Arc;

View File

@@ -8,9 +8,9 @@ use alloy_consensus::BlockHeader;
use alloy_eips::{BlockId, BlockNumberOrTag};
use alloy_primitives::B256;
use derive_more::Constructor;
use reth_ethereum_primitives::Receipt;
use reth_evm::EvmEnv;
use reth_primitives::{Receipt, RecoveredBlock, SealedHeader};
use reth_primitives_traits::Block;
use reth_primitives_traits::{Block, RecoveredBlock, SealedHeader};
/// Configured [`EvmEnv`] for a pending block.
#[derive(Debug, Clone, Constructor)]
@@ -23,7 +23,7 @@ pub struct PendingBlockEnv<B: Block, R, Spec> {
/// The origin for a configured [`PendingBlockEnv`]
#[derive(Clone, Debug)]
pub enum PendingBlockEnvOrigin<B: Block = reth_primitives::Block, R = Receipt> {
pub enum PendingBlockEnvOrigin<B: Block = reth_ethereum_primitives::Block, R = Receipt> {
/// The pending block as received from the CL.
ActualPending(RecoveredBlock<B>, Vec<R>),
/// The _modified_ header of the latest block.

View File

@@ -5,7 +5,7 @@ use alloy_consensus::{transaction::TransactionMeta, ReceiptEnvelope, TxReceipt};
use alloy_eips::eip7840::BlobParams;
use alloy_primitives::{Address, TxKind};
use alloy_rpc_types_eth::{Log, ReceiptWithBloom, TransactionReceipt};
use reth_primitives::{Receipt, TransactionSigned, TxType};
use reth_ethereum_primitives::{Receipt, TransactionSigned, TxType};
use reth_primitives_traits::SignedTransaction;
/// Builds an [`TransactionReceipt`] obtaining the inner receipt envelope from the given closure.

View File

@@ -11,8 +11,9 @@ use reth_evm::{
execute::{BlockBuilder, BlockBuilderOutcome, BlockExecutor},
Evm,
};
use reth_primitives::{Recovered, RecoveredBlock, TxTy};
use reth_primitives_traits::{block::BlockTx, BlockBody as _, SignedTransaction};
use reth_primitives_traits::{
block::BlockTx, BlockBody as _, Recovered, RecoveredBlock, SignedTransaction, TxTy,
};
use reth_rpc_server_types::result::rpc_err;
use reth_rpc_types_compat::{block::from_block, TransactionCompat};
use reth_storage_api::noop::NoopProvider;

View File

@@ -4,8 +4,8 @@
use alloy_primitives::B256;
use alloy_rpc_types_eth::TransactionInfo;
use reth_primitives::{Recovered, TransactionSigned};
use reth_primitives_traits::SignedTransaction;
use reth_ethereum_primitives::TransactionSigned;
use reth_primitives_traits::{Recovered, SignedTransaction};
use reth_rpc_types_compat::TransactionCompat;
/// Represents from where a transaction was fetched.

View File

@@ -1,8 +1,7 @@
//! Commonly used code snippets
use super::{EthApiError, EthResult};
use reth_primitives::Recovered;
use reth_primitives_traits::SignedTransaction;
use reth_primitives_traits::{Recovered, SignedTransaction};
use std::future::Future;
/// Recovers a [`SignedTransaction`] from an enveloped encoded byte stream.