Skip to content

feat(core): add From for Transaction -> GenericTransaction #3227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfroment
Copy link

@sfroment sfroment commented Jun 19, 2025

Motivation

Adding an easy way to get a GenericTransaction from any Transaction

Description
Adding the 2 missing From and one for the enum

Closes #issue_number

BTW I don't know which scope I shall use

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 14:23
@sfroment sfroment requested a review from a team as a code owner June 19, 2025 14:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces conversion implementations to create a GenericTransaction from various Transaction types and adds initial unit tests for two of those conversions.

  • Implemented From<LegacyTransaction> and From<EIP2930Transaction> for GenericTransaction.
  • Added a blanket From<Transaction> implementation covering all enum variants.
  • Added unit tests for LegacyTransaction and EIP2930Transaction conversions.
Comments suppressed due to low confidence (1)

crates/common/types/transaction.rs:2971

  • Only LegacyTransaction and EIP2930Transaction conversions are tested. Add tests for EIP1559Transaction, EIP4844Transaction, EIP7702Transaction, and PrivilegedL2Transaction conversions to ensure full coverage.
    fn test_legacy_transaction_into_generic() {

@sfroment sfroment changed the title feat(levm): add From for Transaction -> GenericTransaction feat(core): add From for Transaction -> GenericTransaction Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant