Commit 139b8aa9 authored by protolambda's avatar protolambda Committed by GitHub

op-proposer,op-service: fix lint and update docs (#3318)

parent 9153532b
...@@ -327,6 +327,7 @@ func waitMined( ...@@ -327,6 +327,7 @@ func waitMined(
// CalcGasFeeCap deterministically computes the recommended gas fee cap given // CalcGasFeeCap deterministically computes the recommended gas fee cap given
// the base fee and gasTipCap. The resulting gasFeeCap is equal to: // the base fee and gasTipCap. The resulting gasFeeCap is equal to:
//
// gasTipCap + 2*baseFee. // gasTipCap + 2*baseFee.
func CalcGasFeeCap(baseFee, gasTipCap *big.Int) *big.Int { func CalcGasFeeCap(baseFee, gasTipCap *big.Int) *big.Int {
return new(big.Int).Add( return new(big.Int).Add(
......
...@@ -2,7 +2,7 @@ package rpc ...@@ -2,7 +2,7 @@ package rpc
import ( import (
"fmt" "fmt"
"io/ioutil" "io"
"math/rand" "math/rand"
"net/http" "net/http"
"testing" "testing"
...@@ -41,7 +41,8 @@ func TestBaseServer(t *testing.T) { ...@@ -41,7 +41,8 @@ func TestBaseServer(t *testing.T) {
t.Run("supports GET /healthz", func(t *testing.T) { t.Run("supports GET /healthz", func(t *testing.T) {
res, err := http.Get(fmt.Sprintf("http://%s/healthz", server.endpoint)) res, err := http.Get(fmt.Sprintf("http://%s/healthz", server.endpoint))
require.NoError(t, err) require.NoError(t, err)
body, err := ioutil.ReadAll(res.Body) defer res.Body.Close()
body, err := io.ReadAll(res.Body)
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, fmt.Sprintf("{\"version\":\"%s\"}\n", appVersion), string(body)) require.EqualValues(t, fmt.Sprintf("{\"version\":\"%s\"}\n", appVersion), string(body))
}) })
......
...@@ -64,5 +64,5 @@ Justification for linting rules: ...@@ -64,5 +64,5 @@ Justification for linting rules:
# Install linter globally (should not affect go.mod) # Install linter globally (should not affect go.mod)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0
# run linter, add --fix option to fix problems (where supported) # run linter, add --fix option to fix problems (where supported)
golangci-lint run -E asciicheck,goimports,misspell golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment