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

[Bug] alloy-transport readme incorrectly describes instantiating the RpcClient #775

Closed
0xkr8os opened this issue May 23, 2024 · 0 comments · Fixed by #782
Closed

[Bug] alloy-transport readme incorrectly describes instantiating the RpcClient #775

0xkr8os opened this issue May 23, 2024 · 0 comments · Fixed by #782
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@0xkr8os
Copy link
Contributor

0xkr8os commented May 23, 2024

Component

transports

What version of Alloy are you on?

0.1.0

Operating System

macOS (Apple Silicon)

Describe the bug

The readme for the alloy-transport crate incorrectly describes the how to instantiate the RpcClient.
let client: RpcClient<reqwest::Http> = "https://mainnet.infura.io/v3/...".parse().unwrap();

The reqwest module does contain an Http struct nor does the RpcClient<_> struct implement the FromStr trait that would enable the url string parsing.

I was able to instantiate the RpcClient using let rpc_client: RpcClient<Http<Client>> = ClientBuilder::default().http("http:://localhost:8545".parse().unwrap());

It would also make sense to include the updated readme documentation for the alloy-rpc-client crate instread of the alloy-transport given the transport is at a lower level.

@0xkr8os 0xkr8os added the bug Something isn't working label May 23, 2024
@prestwich prestwich added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants