feat(consensus): add EthereumReceipt::map_logs#3710
Merged
mattsse merged 3 commits intoalloy-rs:mainfrom Feb 17, 2026
Merged
Conversation
mattsse
requested changes
Feb 17, 2026
Member
mattsse
left a comment
There was a problem hiding this comment.
lets add map fns to EthereumReceipt instead
basically like
alloy/crates/consensus/src/receipt/receipts.rs
Lines 35 to 41 in 54b1f66
crates/rpc-types-eth/src/log.rs
Outdated
Comment on lines
155
to
168
| /// Converts an [`EthereumReceipt`] with consensus [`alloy_primitives::Log`]s into one with | ||
| /// RPC [`Log`]s by enriching each log with block/transaction metadata. | ||
| /// | ||
| /// Uses [`Log::collect_for_receipt`] to populate RPC-specific fields such as block hash, block | ||
| /// number, transaction hash, transaction index, and log index. | ||
| pub fn into_rpc_receipt<T>( | ||
| receipt: EthereumReceipt<T>, | ||
| next_log_index: usize, | ||
| meta: TransactionMeta, | ||
| ) -> EthereumReceipt<T, Log> { | ||
| let EthereumReceipt { tx_type, success, cumulative_gas_used, logs } = receipt; | ||
| let logs = Log::collect_for_receipt(next_log_index, meta, logs); | ||
| EthereumReceipt { tx_type, success, cumulative_gas_used, logs } | ||
| } |
Member
There was a problem hiding this comment.
wait, isnt this just map receipt?
I actually dont like a standalone fn for this if this can also be solved with a simple map
mattsse
approved these changes
Feb 17, 2026
EthereumReceipt::map_logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
pub fn map_logsonimpl<T, L> EthereumReceipt<T, L>, following the same pattern asReceipt::map_logs.