Skip to content

Conversation

@mattsse
Copy link
Member

@mattsse mattsse commented Nov 1, 2025

Simplifies the convert_receipt_to_rpc function by using the map_logs helper method instead of manually reconstructing the receipt.

Before:

  • Manually iterated through logs with .into_iter().map().collect()
  • Manually reconstructed ReceiptWithBloom and Receipt structs
  • ~24 lines of code

After:

  • Uses receipt.map_logs() helper method
  • Automatically handles the receipt reconstruction
  • ~10 lines of code

The functionality is identical - both convert ReceiptWithBloom<Receipt<alloy_primitives::Log>> to ReceiptWithBloom<Receipt<alloy_rpc_types::Log>> by wrapping each log in the RPC type. The new implementation is cleaner and more maintainable.

Replaced verbose manual receipt conversion logic with map_logs helper method for cleaner and more maintainable code.

The previous implementation manually iterated through logs, created new Vec, and reconstructed the ReceiptWithBloom. The new implementation uses the map_logs helper which does the same thing more concisely.

Co-Authored-By: Claude <noreply@anthropic.com>
@mattsse mattsse added this pull request to the merge queue Nov 1, 2025
Merged via the queue into master with commit 8b78c68 Nov 1, 2025
15 checks passed
@mattsse mattsse deleted the refactor-simplify-receipt-conversion branch November 1, 2025 22:50
@github-project-automation github-project-automation bot moved this to Done in Foundry Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants