remove IntoRecoveredTransaction (#11221)

This commit is contained in:
nk_ysg
2024-09-26 01:10:11 +08:00
committed by GitHub
parent 4ef9635fa9
commit 76a6e0db69
13 changed files with 21 additions and 37 deletions

View File

@ -5,7 +5,6 @@ use reth_beacon_consensus::{BeaconEngineMessage, ForkchoiceStatus};
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_engine_primitives::EngineTypes;
use reth_evm::execute::BlockExecutorProvider;
use reth_primitives::IntoRecoveredTransaction;
use reth_provider::{CanonChainTracker, StateProviderFactory};
use reth_stages_api::PipelineEvent;
use reth_tokio_util::EventStream;

View File

@ -33,8 +33,7 @@ use reth_primitives::{
constants::{eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE},
proofs::{self, calculate_requests_root},
revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg},
Block, BlockBody, EthereumHardforks, Header, IntoRecoveredTransaction, Receipt,
EMPTY_OMMER_ROOT_HASH,
Block, BlockBody, EthereumHardforks, Header, Receipt, EMPTY_OMMER_ROOT_HASH,
};
use reth_provider::{ChainSpecProvider, StateProviderFactory};
use reth_revm::database::StateProviderDatabase;

View File

@ -17,7 +17,7 @@ use reth_primitives::{
constants::BEACON_NONCE,
proofs,
revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg},
Block, BlockBody, Header, IntoRecoveredTransaction, Receipt, TxType, EMPTY_OMMER_ROOT_HASH,
Block, BlockBody, Header, Receipt, TxType, EMPTY_OMMER_ROOT_HASH,
};
use reth_provider::StateProviderFactory;
use reth_revm::database::StateProviderDatabase;

View File

@ -62,9 +62,9 @@ pub use transaction::BlobTransactionValidationError;
pub use transaction::{
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionMeta,
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHashOrNumber,
TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
InvalidTransactionError, Signature, Transaction, TransactionMeta, TransactionSigned,
TransactionSignedEcRecovered, TransactionSignedNoHash, TxHashOrNumber, TxType,
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
LEGACY_TX_TYPE_ID,
};

View File

@ -1634,15 +1634,6 @@ impl Decodable for TransactionSignedEcRecovered {
}
}
/// Ensures the transaction can be sent over the
/// network
pub trait IntoRecoveredTransaction {
/// Converts to this type into a [`TransactionSignedEcRecovered`].
///
/// Note: this takes `&self` since indented usage is via `Arc<Self>`.
fn to_recovered_transaction(&self) -> TransactionSignedEcRecovered;
}
/// Generic wrapper with encoded Bytes, such as transaction data.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct WithEncoded<T>(Bytes, pub T);

View File

@ -20,8 +20,8 @@ use reth_primitives::{
BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, EVMError, Env, ExecutionResult, InvalidTransaction,
ResultAndState, SpecId,
},
Block, BlockBody, Header, IntoRecoveredTransaction, Receipt, Requests, SealedBlockWithSenders,
SealedHeader, TransactionSignedEcRecovered, EMPTY_OMMER_ROOT_HASH,
Block, BlockBody, Header, Receipt, Requests, SealedBlockWithSenders, SealedHeader,
TransactionSignedEcRecovered, EMPTY_OMMER_ROOT_HASH,
};
use reth_provider::{
BlockReader, BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, ProviderError,

View File

@ -19,7 +19,7 @@ use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, server::IdProvider};
use reth_chainspec::ChainInfo;
use reth_node_api::EthApiTypes;
use reth_primitives::{IntoRecoveredTransaction, TransactionSignedEcRecovered};
use reth_primitives::TransactionSignedEcRecovered;
use reth_provider::{BlockIdReader, BlockReader, EvmEnvProvider, ProviderError};
use reth_rpc_eth_api::{EthFilterApiServer, FullEthApiTypes, RpcTransaction, TransactionCompat};
use reth_rpc_eth_types::{

View File

@ -16,7 +16,6 @@ use jsonrpsee::{
server::SubscriptionMessage, types::ErrorObject, PendingSubscriptionSink, SubscriptionSink,
};
use reth_network_api::NetworkInfo;
use reth_primitives::IntoRecoveredTransaction;
use reth_provider::{BlockReader, CanonStateSubscriptions, EvmEnvProvider};
use reth_rpc_eth_api::{pubsub::EthPubSubApiServer, FullEthApiTypes, RpcTransaction};
use reth_rpc_eth_types::logs_utils;

View File

@ -17,8 +17,8 @@ use reth_chainspec::{ChainSpec, ChainSpecProvider};
use reth_execution_types::ChangedAccount;
use reth_fs_util::FsPathError;
use reth_primitives::{
alloy_primitives::Sealable, BlockNumberOrTag, IntoRecoveredTransaction,
PooledTransactionsElementEcRecovered, SealedHeader, TransactionSigned,
alloy_primitives::Sealable, BlockNumberOrTag, PooledTransactionsElementEcRecovered,
SealedHeader, TransactionSigned,
};
use reth_storage_api::{errors::provider::ProviderError, BlockReaderIdExt, StateProviderFactory};
use reth_tasks::TaskSpawner;

View File

@ -87,8 +87,7 @@ use reth_eth_wire_types::HandleMempoolData;
use reth_execution_types::ChangedAccount;
use reth_primitives::{
BlobTransaction, BlobTransactionSidecar, IntoRecoveredTransaction, PooledTransactionsElement,
TransactionSigned,
BlobTransaction, BlobTransactionSidecar, PooledTransactionsElement, TransactionSigned,
};
use std::{
collections::{HashMap, HashSet},

View File

@ -8,8 +8,8 @@ use crate::{
use alloy_primitives::{Address, TxHash, B256, U256};
use futures_util::future::Either;
use reth_primitives::{
BlobTransactionSidecar, IntoRecoveredTransaction, PooledTransactionsElementEcRecovered,
SealedBlock, TransactionSignedEcRecovered,
BlobTransactionSidecar, PooledTransactionsElementEcRecovered, SealedBlock,
TransactionSignedEcRecovered,
};
use std::{fmt, future::Future, time::Instant};
@ -380,10 +380,11 @@ impl<T: PoolTransaction> ValidPoolTransaction<T> {
}
}
impl<T: PoolTransaction<Consensus = TransactionSignedEcRecovered>> IntoRecoveredTransaction
for ValidPoolTransaction<T>
{
fn to_recovered_transaction(&self) -> TransactionSignedEcRecovered {
impl<T: PoolTransaction<Consensus = TransactionSignedEcRecovered>> ValidPoolTransaction<T> {
/// Converts to this type into a [`TransactionSignedEcRecovered`].
///
/// Note: this takes `&self` since indented usage is via `Arc<Self>`.
pub fn to_recovered_transaction(&self) -> TransactionSignedEcRecovered {
self.transaction.clone().into_consensus()
}
}

View File

@ -17,7 +17,7 @@ use reth::{
args::utils::DefaultChainSpecParser,
builder::NodeHandle,
cli::Cli,
primitives::{Address, BlockNumberOrTag, IntoRecoveredTransaction},
primitives::{Address, BlockNumberOrTag},
revm::{
inspector_handle_register,
interpreter::{Interpreter, OpCode},

View File

@ -14,12 +14,8 @@ use alloy_rpc_types_trace::{parity::TraceType, tracerequest::TraceCallRequest};
use clap::Parser;
use futures_util::StreamExt;
use reth::{
args::utils::DefaultChainSpecParser,
builder::NodeHandle,
cli::Cli,
primitives::{Address, IntoRecoveredTransaction},
rpc::compat::transaction::transaction_to_call_request,
transaction_pool::TransactionPool,
args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli, primitives::Address,
rpc::compat::transaction::transaction_to_call_request, transaction_pool::TransactionPool,
};
use reth_node_ethereum::node::EthereumNode;