From dfc27db85b4fd6f1360840b347de6939e57f67bb Mon Sep 17 00:00:00 2001 From: Miguel Filipe Date: Tue, 4 Jun 2024 18:42:04 +0100 Subject: [PATCH] Apply suggestions from Vegards' code review Co-authored-by: Vegard Stikbakke --- client/jsonrpc/client.go | 4 ++-- client/jsonrpc/opstack.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/client/jsonrpc/client.go b/client/jsonrpc/client.go index 9192319..5ba249e 100644 --- a/client/jsonrpc/client.go +++ b/client/jsonrpc/client.go @@ -20,7 +20,7 @@ type BlockchainClient interface { // SendBlocks sends blocks from startBlockNumber to endBlockNumber to outChan, inclusive. // If endBlockNumber is -1, it sends blocks from startBlockNumber to the tip of the chain - // it will run continueously until the context is cancelled + // it will run continuously until the context is cancelled SendBlocks(ctx context.Context, outChan chan models.RPCBlock, startBlockNumber, endBlockNumber int64) error Close() error @@ -78,7 +78,7 @@ func (c *rpcClient) LatestBlockNumber() (int64, error) { return hexutils.IntFromHex(resp.Result) } -// getResponseBody sends a request to the OpStack server and returns the response body +// getResponseBody sends a request to the server and returns the response body func (c *rpcClient) getResponseBody( ctx context.Context, method string, params interface{}, output *bytes.Buffer, ) error { diff --git a/client/jsonrpc/opstack.go b/client/jsonrpc/opstack.go index 92eae22..9e9087d 100644 --- a/client/jsonrpc/opstack.go +++ b/client/jsonrpc/opstack.go @@ -47,7 +47,6 @@ func (c *OpStackClient) BlockByNumber(ctx context.Context, blockNumber int64) (m group, ctx := errgroup.WithContext(ctx) results := make([]*bytes.Buffer, len(methods)) for i, method := range methods { - results[i] = c.bufPool.Get().(*bytes.Buffer) defer c.bufPool.Put(results[i])