feat: add clone_transactions convenience fn (#13962)

This commit is contained in:
Matthias Seitz
2025-01-24 15:02:50 +01:00
committed by GitHub
parent 7e9d6ae454
commit 621b30f037

View File

@ -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())