-
Notifications
You must be signed in to change notification settings - Fork 252
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(provider): expose ProviderBuilder
via fn builder()
#858
Conversation
@@ -36,6 +37,12 @@ impl<T: fmt::Debug, N> fmt::Debug for RootProvider<T, N> { | |||
} | |||
} | |||
|
|||
/// Helper function to directly access [`ProviderBuilder`] with minimal | |||
/// generics. | |||
pub fn builder<N: Network>() -> ProviderBuilder<Identity, Identity, N> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be ethereum network like in ProviderBuilder::new
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would create cyclic deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How? It's right there in the imports in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, I read that as it should be "in ethereum network", as in the network crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be ethereum network like in
ProviderBuilder::new
?
Cannot set defaults in a free function.
pending @mattsse or @prestwich |
…#858) * feat(provider): expose `ProviderBuilder` via `fn builder()` * feat(provider): free builder<N>() fn * nit * AnyNetwork test for builder fn
Motivation
Closes #450
Solution
Add
fn builder() -> ProviderBuilder
in theProvider
trait.@prestwich @mattsse ptal
PR Checklist