Skip to content

Conversation

@Fibonacci747
Copy link
Contributor

  1. Correct the eth_getBlockByNumber example comment to use a boolean for the second parameter ("false") instead of an object ("{}"), aligning with the JSON-RPC spec and the actual call below.
  2. Handle the error returned by rpc.Dial rather than ignoring it. Without this check, a failed connection would leave client nil and subsequent method calls could panic. The example now reports the dial error and exits early, making it safe and consistent with error handling elsewhere in the codebase.

@Fibonacci747 Fibonacci747 requested a review from fjl as a code owner September 17, 2025 16:12
@fjl
Copy link
Contributor

fjl commented Sep 17, 2025

The example is just meant to illustrate usage of the library, and therefore the error handling can be elided.

@fjl fjl closed this Sep 17, 2025
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