mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-04 03:55:22 -05:00
feat: add get_recovered_transaction helper (#16436)
This commit is contained in:
@@ -283,6 +283,15 @@ impl<B: Block> RecoveredBlock<B> {
|
||||
(self.block.into_block(), self.senders)
|
||||
}
|
||||
|
||||
/// Returns the `Recovered<&T>` transaction at the given index.
|
||||
pub fn recovered_transaction(
|
||||
&self,
|
||||
idx: usize,
|
||||
) -> Option<Recovered<&<B::Body as BlockBody>::Transaction>> {
|
||||
let sender = self.senders.get(idx).copied()?;
|
||||
self.block.body().transactions().get(idx).map(|tx| Recovered::new_unchecked(tx, sender))
|
||||
}
|
||||
|
||||
/// Returns an iterator over all transactions and their sender.
|
||||
#[inline]
|
||||
pub fn transactions_with_sender(
|
||||
|
||||
Reference in New Issue
Block a user