Skip to content

Commit

Permalink
feat: add clone_transactions convenience fn
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 24, 2025
1 parent ee7820f commit db3676b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/primitives-traits/src/block/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ pub trait BlockBody:
self.transactions().iter()
}

/// Clones the transactions in the block.
///
/// This is a convenience function for `transactions().to_vec()`
fn clone_transactions(&self) -> Vec<Self::Transaction> {
self.transactions().to_vec()
}

/// Returns an iterator over all transaction hashes in the block body.
fn transaction_hashes_iter(&self) -> impl Iterator<Item = &B256> + '_ {
self.transactions_iter().map(|tx| tx.tx_hash())
Expand Down

0 comments on commit db3676b

Please sign in to comment.