From 2c877f92445c9aff945b94c8c4548b5447b539a1 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Fri, 7 Mar 2025 01:48:47 +0400 Subject: [PATCH] fix --- crates/consensus/src/transaction/envelope.rs | 11 +++-------- crates/network/src/any/unknowns.rs | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/crates/consensus/src/transaction/envelope.rs b/crates/consensus/src/transaction/envelope.rs index 04689235be4..333ed443f62 100644 --- a/crates/consensus/src/transaction/envelope.rs +++ b/crates/consensus/src/transaction/envelope.rs @@ -390,15 +390,10 @@ impl TxEnvelope { /// Recover the signer of the transaction. #[cfg(feature = "k256")] pub fn try_into_recovered( - &self, + self, ) -> Result, alloy_primitives::SignatureError> { - match self { - Self::Legacy(tx) => tx.try_into_recovered(), - Self::Eip2930(tx) => tx.try_into_recovered(), - Self::Eip1559(tx) => tx.try_into_recovered(), - Self::Eip4844(tx) => tx.try_into_recovered(), - Self::Eip7702(tx) => tx.try_into_recovered(), - } + let signer = self.recover_signer()?; + Ok(crate::transaction::Recovered::new_unchecked(self, signer)) } /// Calculate the signing hash for the transaction. diff --git a/crates/network/src/any/unknowns.rs b/crates/network/src/any/unknowns.rs index 6723de43bce..8448d0a15ec 100644 --- a/crates/network/src/any/unknowns.rs +++ b/crates/network/src/any/unknowns.rs @@ -410,7 +410,7 @@ mod tests { let tx: AnyRpcTransaction = serde_json::from_str(input).unwrap(); - let AnyTxEnvelope::Unknown(inner) = tx.inner.inner.clone() else { + let AnyTxEnvelope::Unknown(inner) = tx.inner.inner.tx().clone() else { panic!("expected unknown envelope"); };