feat: Introduce with_signer_ref helper (#16235)

This commit is contained in:
Louis Brown
2025-05-14 11:14:19 -03:00
committed by GitHub
parent 3c82dfa496
commit 836a17de65

View File

@@ -116,6 +116,14 @@ pub trait SignedTransaction:
fn with_signer(self, signer: Address) -> Recovered<Self> {
Recovered::new_unchecked(self, signer)
}
/// Returns the [`Recovered`] transaction with the given signer, using a reference to self.
///
/// Note: assumes the given signer is the signer of this transaction.
#[auto_impl(keep_default_for(&, Arc))]
fn with_signer_ref(&self, signer: Address) -> Recovered<&Self> {
Recovered::new_unchecked(self, signer)
}
}
impl<T> SignedTransaction for EthereumTxEnvelope<T>