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

fix: Make RecommendedFillers generic over Network #1458

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

popzxc
Copy link
Contributor

@popzxc popzxc commented Oct 13, 2024

Makes RecommendedFillers generic over Network.

Motivation

Associated type in the trait requires TxFiller, which is generic over Network; it just has Ethereum as default.
So it's impossible to implement custom fillers for a specific network, if they can't be implemented for Ethereum as well.

The solution is a bit awkward since now you can implement RecommendedFillers<NetworkA> and RecommendedFillers<NetworkB> for NetworkA, but the pro is that it's not a breaking change.
The alternative would be to introduce an associated type, but it would be breaking, since associated type defaults are unstable.

Solution

Make RecommendedFillers generic over Network 😅 .

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes DaniPopes merged commit a64e3ac into alloy-rs:main Oct 13, 2024
26 checks passed
@popzxc popzxc deleted the popzxc-recommended-fillers-network branch October 13, 2024 07:30
@klkvr
Copy link
Member

klkvr commented Oct 13, 2024

couldn't we just change the AT bound to TxFiller<Self>?

@popzxc
Copy link
Contributor Author

popzxc commented Oct 14, 2024

@klkvr indeed! Fixed in #1466

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.

3 participants