feat: rename reth_primitives::RecoveredTx functions to match alloy::Recovered (#13663)

This commit is contained in:
Tuan Tran
2025-01-06 21:27:43 +07:00
committed by GitHub
parent d10af50e45
commit 20d3fa6bbb
27 changed files with 48 additions and 49 deletions

View File

@ -1546,17 +1546,17 @@ impl<T> RecoveredTx<T> {
}
/// Returns a reference to [`TransactionSigned`]
pub const fn as_signed(&self) -> &T {
pub const fn tx(&self) -> &T {
&self.signed_transaction
}
/// Transform back to [`TransactionSigned`]
pub fn into_signed(self) -> T {
pub fn into_tx(self) -> T {
self.signed_transaction
}
/// Dissolve Self to its component
pub fn to_components(self) -> (T, Address) {
pub fn into_parts(self) -> (T, Address) {
(self.signed_transaction, self.signer)
}

View File

@ -12,7 +12,7 @@ pub type PooledTransactionsElementEcRecovered<T = PooledTransaction> = Recovered
impl PooledTransactionsElementEcRecovered {
/// Transform back to [`RecoveredTx`]
pub fn into_ecrecovered_transaction(self) -> RecoveredTx<TransactionSigned> {
let (tx, signer) = self.to_components();
let (tx, signer) = self.into_parts();
RecoveredTx::from_signed_transaction(tx.into(), signer)
}