Skip to content
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

feat: Remove duplicated to method in TransactionResponse #1770

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

moricho
Copy link
Contributor

@moricho moricho commented Dec 9, 2024

Motivation

TransactionResponse's base trait alloy_consensus::Transaction already has to method with the exact same default implementation.
It causes the following error when using TransactionResponse along with Transaction, and the result is the same when to() is called with either of the above traits. It would be a bit confusing.

error[E0034]: multiple applicable items in scope
   --> crates/.../...
    |
216 |                 .to()
    |                  ^^ multiple `to` found
    |
    = note: candidate #1 is defined in an impl of the trait `TransactionResponse` for the type `alloy_rpc_types_eth::Transaction<T>`
    = note: candidate #2 is defined in an impl of the trait `TransactionTrait` for the type `alloy_rpc_types_eth::Transaction<T>`
help: disambiguate the method for candidate #1
    |
215 |             && TransactionResponse::to(&tx)
    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
    |
215 |             && TransactionTrait::to(&tx)
    |                ~~~~~~~~~~~~~~~~~~~~~~~~~

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

ty, yep this should be removed

@mattsse mattsse merged commit 53371fa into alloy-rs:main Dec 9, 2024
26 checks passed
@moricho moricho deleted the remove-redundant-to branch December 9, 2024 10:03
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.

2 participants