mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: implement transaction fetcher, w/o redundant tx hash request (#5058)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -39,6 +39,13 @@ pub struct PooledTransactions(
|
||||
pub Vec<PooledTransactionsElement>,
|
||||
);
|
||||
|
||||
impl PooledTransactions {
|
||||
/// Returns an iterator over the transaction hashes in this response.
|
||||
pub fn hashes(&self) -> impl Iterator<Item = &B256> + '_ {
|
||||
self.0.iter().map(|tx| tx.hash())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec<TransactionSigned>> for PooledTransactions {
|
||||
fn from(txs: Vec<TransactionSigned>) -> Self {
|
||||
PooledTransactions(txs.into_iter().map(Into::into).collect())
|
||||
|
||||
Reference in New Issue
Block a user