feat: add transactions_iter helper (#13910)

This commit is contained in:
Matthias Seitz
2025-01-22 00:37:51 +01:00
committed by GitHub
parent 6d2648dc1b
commit 901240877a
7 changed files with 23 additions and 22 deletions

View File

@ -1065,7 +1065,7 @@ impl<N: ProviderNodeTypes> ReceiptProvider for ConsistentProvider<N> {
);
if let Some(tx_index) =
block.body().transactions().iter().position(|tx| tx.trie_hash() == hash)
block.body().transactions_iter().position(|tx| tx.trie_hash() == hash)
{
// safe to use tx_index for receipts due to 1:1 correspondence
return Ok(receipts.get(tx_index).cloned());

View File

@ -2836,7 +2836,7 @@ impl<TX: DbTxMut + DbTx + 'static, N: NodeTypesForProvider + 'static> BlockWrite
let tx_count = block.body().transaction_count() as u64;
// Ensures we have all the senders for the block's transactions.
for (transaction, sender) in block.body().transactions().iter().zip(block.senders_iter()) {
for (transaction, sender) in block.body().transactions_iter().zip(block.senders_iter()) {
let hash = transaction.tx_hash();
if self.prune_modes.sender_recovery.as_ref().is_none_or(|m| !m.is_full()) {