mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add transactions_recovered iter (#13903)
This commit is contained in:
@ -291,9 +291,17 @@ impl<B: Block> RecoveredBlock<B> {
|
|||||||
self.senders.iter().zip(self.block.body().transactions())
|
self.senders.iter().zip(self.block.body().transactions())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over all transactions in the block.
|
/// Returns an iterator over `Recovered<&Transaction>`
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn into_transactions_ecrecovered(
|
pub fn transactions_recovered(
|
||||||
|
&self,
|
||||||
|
) -> impl Iterator<Item = Recovered<&'_ <B::Body as BlockBody>::Transaction>> {
|
||||||
|
self.transactions_with_sender().map(|(sender, tx)| Recovered::new_unchecked(tx, *sender))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Consumes the type and returns an iterator over all [`Recovered`] transactions in the block.
|
||||||
|
#[inline]
|
||||||
|
pub fn into_transactions_recovered(
|
||||||
self,
|
self,
|
||||||
) -> impl Iterator<Item = Recovered<<B::Body as BlockBody>::Transaction>> {
|
) -> impl Iterator<Item = Recovered<<B::Body as BlockBody>::Transaction>> {
|
||||||
self.block
|
self.block
|
||||||
|
|||||||
@ -872,7 +872,7 @@ where
|
|||||||
.block_with_senders_by_id(block_id, TransactionVariant::NoHash)
|
.block_with_senders_by_id(block_id, TransactionVariant::NoHash)
|
||||||
.to_rpc_result()?
|
.to_rpc_result()?
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
Ok(block.into_transactions_ecrecovered().map(|tx| tx.encoded_2718().into()).collect())
|
Ok(block.into_transactions_recovered().map(|tx| tx.encoded_2718().into()).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handler for `debug_getRawReceipts`
|
/// Handler for `debug_getRawReceipts`
|
||||||
|
|||||||
Reference in New Issue
Block a user