chore: use generics for RecoveredTx (#13650)

This commit is contained in:
Matthias Seitz
2025-01-04 12:14:24 +01:00
committed by GitHub
parent fc9d95a4d1
commit b18b0ee848
7 changed files with 23 additions and 23 deletions

View File

@ -904,10 +904,10 @@ impl EthPoolTransaction for MockTransaction {
}
}
impl TryFrom<RecoveredTx> for MockTransaction {
impl TryFrom<RecoveredTx<TransactionSigned>> for MockTransaction {
type Error = TryFromRecoveredTransactionError;
fn try_from(tx: RecoveredTx) -> Result<Self, Self::Error> {
fn try_from(tx: RecoveredTx<TransactionSigned>) -> Result<Self, Self::Error> {
let sender = tx.signer();
let transaction = tx.into_signed();
let hash = transaction.hash();
@ -1053,7 +1053,7 @@ impl From<PooledTransactionsElementEcRecovered> for MockTransaction {
}
}
impl From<MockTransaction> for RecoveredTx {
impl From<MockTransaction> for RecoveredTx<TransactionSigned> {
fn from(tx: MockTransaction) -> Self {
let signed_tx =
TransactionSigned::new(tx.clone().into(), Signature::test_signature(), *tx.hash());

View File

@ -1453,10 +1453,10 @@ impl EthPoolTransaction for EthPooledTransaction {
}
}
impl TryFrom<RecoveredTx> for EthPooledTransaction {
impl TryFrom<RecoveredTx<TransactionSigned>> for EthPooledTransaction {
type Error = TryFromRecoveredTransactionError;
fn try_from(tx: RecoveredTx) -> Result<Self, Self::Error> {
fn try_from(tx: RecoveredTx<TransactionSigned>) -> Result<Self, Self::Error> {
// ensure we can handle the transaction type and its format
match tx.ty() {
0..=EIP1559_TX_TYPE_ID | EIP7702_TX_TYPE_ID => {
@ -1480,7 +1480,7 @@ impl TryFrom<RecoveredTx> for EthPooledTransaction {
}
}
impl From<EthPooledTransaction> for RecoveredTx {
impl From<EthPooledTransaction> for RecoveredTx<TransactionSigned> {
fn from(tx: EthPooledTransaction) -> Self {
tx.transaction
}