Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add helper for RecoveredBlock::clone_transactions_recovered #14689

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/primitives-traits/src/block/recovered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ impl<B: Block> RecoveredBlock<B> {
self.senders.iter().zip(self.block.body().transactions())
}

/// Returns an iterator over cloned `Recovered<Transaction>`
#[inline]
pub fn clone_transactions_recovered(
&self,
) -> impl Iterator<Item = Recovered<<B::Body as BlockBody>::Transaction>> + '_ {
self.transactions_with_sender()
.map(|(sender, tx)| Recovered::new_unchecked(tx.clone(), *sender))
}

/// Returns an iterator over `Recovered<&Transaction>`
#[inline]
pub fn transactions_recovered(
Expand Down
Loading