diff --git a/crates/consensus/src/transaction/envelope.rs b/crates/consensus/src/transaction/envelope.rs index 348a69cff6c..04689235be4 100644 --- a/crates/consensus/src/transaction/envelope.rs +++ b/crates/consensus/src/transaction/envelope.rs @@ -387,6 +387,20 @@ impl TxEnvelope { } } + /// Recover the signer of the transaction. + #[cfg(feature = "k256")] + pub fn try_into_recovered( + &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(), + } + } + /// Calculate the signing hash for the transaction. pub fn signature_hash(&self) -> B256 { match self {