-
Notifications
You must be signed in to change notification settings - Fork 36
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): provider
examples
#3
Conversation
Pulled in the latest upstream changes and made a few slight stylistic changes |
let provider_with_signer = ProviderBuilder::<_, Ethereum>::new() | ||
.signer(EthereumSigner::from(signer)) | ||
.network::<Ethereum>() | ||
.provider(RootProvider::new(rpc_client)); |
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.
Ideal UX here is alloy_network::Ethereum::builder().signer(signer).connect(anvil.endpoint())
. We should strive to get to that, incl the gas / nonce filling layer being on by default with the option to turn it off with .manual()
or something. cc @onbjerg @DaniPopes
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.
For now ::<_, Ethereum>
and .network
are not necessary anymore: alloy-rs/alloy#304
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.
lgtm,
needs alloy update and one nit
let rpc_client = RpcClient::new(Http::<Client>::new(anvil.endpoint().parse().unwrap()), false); | ||
let provider_with_signer = ProviderBuilder::<_, Ethereum>::new() | ||
.signer(EthereumSigner::from(signer)) | ||
.network::<Ethereum>() |
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.
this shouldn't be necessary anymore
http
ws
ipc
builder