mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat(txpool): add PoolTransaction::consensus_ref (#22182)
Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
committed by
GitHub
parent
2be3788481
commit
d71a0c0c7b
@@ -704,6 +704,10 @@ impl PoolTransaction for MockTransaction {
|
||||
|
||||
type Pooled = PooledTransactionVariant;
|
||||
|
||||
fn consensus_ref(&self) -> Recovered<&Self::Consensus> {
|
||||
unimplemented!("mock transaction does not wrap a consensus transaction")
|
||||
}
|
||||
|
||||
fn into_consensus(self) -> Recovered<Self::Consensus> {
|
||||
self.into()
|
||||
}
|
||||
|
||||
@@ -1257,6 +1257,9 @@ pub trait PoolTransaction:
|
||||
self.clone().into_consensus()
|
||||
}
|
||||
|
||||
/// Returns a reference to the consensus transaction with the recovered sender.
|
||||
fn consensus_ref(&self) -> Recovered<&Self::Consensus>;
|
||||
|
||||
/// Define a method to convert from the `Self` type to `Consensus`
|
||||
fn into_consensus(self) -> Recovered<Self::Consensus>;
|
||||
|
||||
@@ -1447,6 +1450,10 @@ impl PoolTransaction for EthPooledTransaction {
|
||||
self.transaction().clone()
|
||||
}
|
||||
|
||||
fn consensus_ref(&self) -> Recovered<&Self::Consensus> {
|
||||
Recovered::new_unchecked(&*self.transaction, self.transaction.signer())
|
||||
}
|
||||
|
||||
fn into_consensus(self) -> Recovered<Self::Consensus> {
|
||||
self.transaction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user