Skip to content

Commit

Permalink
chore: rm usage of PooledTransactionsElementEcRecovered alias (#13690)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jan 6, 2025
1 parent 15b50da commit 28761db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,7 @@ impl TransactionSigned {
}
}

/// Converts from an EIP-4844 [`RecoveredTx`] to a
/// [`PooledTransactionsElementEcRecovered`] with the given sidecar.
/// Converts from an EIP-4844 transaction to a [`PooledTransaction`] with the given sidecar.
///
/// Returns an `Err` containing the original `TransactionSigned` if the transaction is not
/// EIP-4844.
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/transaction/pooled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use crate::RecoveredTx;
use alloy_consensus::transaction::PooledTransaction;

// TODO: remove this foreign type
/// A signed pooled transaction with recovered signer.
pub type PooledTransactionsElementEcRecovered<T = PooledTransaction> = RecoveredTx<T>;

Expand Down
7 changes: 3 additions & 4 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ use rand::{
};
use reth_primitives::{
transaction::{SignedTransactionIntoRecoveredExt, TryFromRecoveredTransactionError},
PooledTransaction, PooledTransactionsElementEcRecovered, RecoveredTx, Transaction,
TransactionSigned, TxType,
PooledTransaction, RecoveredTx, Transaction, TransactionSigned, TxType,
};
use reth_primitives_traits::InMemorySize;
use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
Expand Down Expand Up @@ -1045,8 +1044,8 @@ impl TryFrom<RecoveredTx<TransactionSigned>> for MockTransaction {
}
}

impl From<PooledTransactionsElementEcRecovered> for MockTransaction {
fn from(tx: PooledTransactionsElementEcRecovered) -> Self {
impl From<RecoveredTx<PooledTransaction>> for MockTransaction {
fn from(tx: RecoveredTx<PooledTransaction>) -> Self {
let (tx, signer) = tx.into_parts();
RecoveredTx::<TransactionSigned>::new_unchecked(tx.into(), signer).try_into().expect(
"Failed to convert from PooledTransactionsElementEcRecovered to MockTransaction",
Expand Down
7 changes: 3 additions & 4 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use reth_execution_types::ChangedAccount;
use reth_primitives::{
kzg::KzgSettings,
transaction::{SignedTransactionIntoRecoveredExt, TryFromRecoveredTransactionError},
PooledTransaction, PooledTransactionsElementEcRecovered, RecoveredTx, SealedBlock, Transaction,
TransactionSigned,
PooledTransaction, RecoveredTx, SealedBlock, Transaction, TransactionSigned,
};
use reth_primitives_traits::{BlockBody, SignedTransaction};
#[cfg(feature = "serde")]
Expand Down Expand Up @@ -1242,8 +1241,8 @@ impl<T: SignedTransaction> EthPooledTransaction<T> {
}

/// Conversion from the network transaction type to the pool transaction type.
impl From<PooledTransactionsElementEcRecovered> for EthPooledTransaction {
fn from(tx: PooledTransactionsElementEcRecovered) -> Self {
impl From<RecoveredTx<PooledTransaction>> for EthPooledTransaction {
fn from(tx: RecoveredTx<PooledTransaction>) -> Self {
let encoded_length = tx.encode_2718_len();
let (tx, signer) = tx.into_parts();
match tx {
Expand Down

0 comments on commit 28761db

Please sign in to comment.