mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add clone_transactions convenience fn (#13962)
This commit is contained in:
@ -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())
|
||||
|
||||
Reference in New Issue
Block a user