Skip to content

Commit

Permalink
fix: rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
polsar88 committed Aug 17, 2024
1 parent 90b15e0 commit 3bc2508
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions internal/client/ethereum_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type EthClient interface {
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
PeerCount(ctx context.Context) (uint64, error)
SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
HealthCheck(ctx context.Context, method string) (time.Duration, error)
Latency(ctx context.Context, method string) (time.Duration, error)
}

func (c *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
Expand All @@ -51,13 +51,13 @@ func (c *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, erro
return (*ethclient.Client)(c).SyncProgress(ctx)
}

// HealthCheck calls the specified RPC method using the given context and returns the duration
// of the call, as well as the error if one occurred. No arguments are passed to the RPC method.
// Latency calls the specified RPC method using the given context and returns the duration of the call,
// as well as the error if one occurred. No arguments are passed to the RPC method.
//
// TODO(polsar): If the method expects one or more arguments, it will return an error that will
// be passed to the caller. We should detect this type of error and not return it, since the call
// has otherwise succeeded, which is the only thing the caller cares about.
func (c *Client) HealthCheck(ctx context.Context, method string) (time.Duration, error) {
// TODO(polsar): If the method expects one or more arguments, it will return an error that will be passed
// to the caller. We should detect this type of error and not return it, since the call has otherwise succeeded,
// which is the only thing the caller cares about.
func (c *Client) Latency(ctx context.Context, method string) (time.Duration, error) {
start := time.Now()
err := (*ethclient.Client)(c).Client().CallContext(ctx, nil, method)

Expand Down
22 changes: 11 additions & 11 deletions internal/mocks/EthClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3bc2508

Please sign in to comment.