From 8afbc1908347f6ba46d3b57efba17fcedb4e9de9 Mon Sep 17 00:00:00 2001 From: Louis Brown <48462338+louisbrown0212@users.noreply.github.com> Date: Fri, 16 May 2025 13:16:45 -0300 Subject: [PATCH] chore: Mark into_recovered_unchecked as deprecated (#16283) --- crates/primitives-traits/src/transaction/signed.rs | 1 + crates/rpc/rpc-eth-api/src/helpers/transaction.rs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/primitives-traits/src/transaction/signed.rs b/crates/primitives-traits/src/transaction/signed.rs index 610775b68e..1142664851 100644 --- a/crates/primitives-traits/src/transaction/signed.rs +++ b/crates/primitives-traits/src/transaction/signed.rs @@ -104,6 +104,7 @@ pub trait SignedTransaction: /// ensuring that the signature has a low `s` value_ (EIP-2). /// /// Returns `RecoveryError` if the transaction's signature is invalid. + #[deprecated(note = "Use try_into_recovered_unchecked instead")] #[auto_impl(keep_default_for(&, Arc))] fn into_recovered_unchecked(self) -> Result, RecoveryError> { self.recover_signer_unchecked().map(|signer| Recovered::new_unchecked(self, signer)) diff --git a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs index 3f4ff96673..e519d0ba74 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs @@ -6,7 +6,10 @@ use crate::{ helpers::estimate::EstimateCall, FromEthApiError, FullEthApiTypes, IntoEthApiError, RpcNodeCore, RpcNodeCoreExt, RpcReceipt, RpcTransaction, }; -use alloy_consensus::{transaction::TransactionMeta, BlockHeader, Transaction}; +use alloy_consensus::{ + transaction::{SignerRecoverable, TransactionMeta}, + BlockHeader, Transaction, +}; use alloy_dyn_abi::TypedData; use alloy_eips::{eip2718::Encodable2718, BlockId}; use alloy_network::TransactionBuilder; @@ -483,7 +486,7 @@ pub trait LoadTransaction: SpawnBlocking + FullEthApiTypes + RpcNodeCoreExt { // part of pending block) and already. We don't need to // check for pre EIP-2 because this transaction could be pre-EIP-2. let transaction = tx - .into_recovered_unchecked() + .try_into_recovered_unchecked() .map_err(|_| EthApiError::InvalidTransactionSignature)?; let tx = TransactionSource::Block {