Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Oct 22, 2024
1 parent c317bbf commit ab8dda8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
5 changes: 5 additions & 0 deletions contrib/rpcimportable/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
)

// go-ethereum fork must be used as it removes incompatible pebbledb version
replace (
github.com/ethereum/go-ethereum => github.com/zeta-chain/go-ethereum v1.13.16-0.20241022183758-422c6ef93ccc
)

// uncomment this for local development/testing/debugging
// replace github.com/zeta-chain/node => ../..
6 changes: 3 additions & 3 deletions pkg/proofs/ethereum/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ func NewTrie(list types.DerivableList) Trie {
// #nosec G115 iterator
indexBuf = rlp.AppendUint64(indexBuf[:0], uint64(i))
value := encodeForDerive(list, i, valueBuf)
hasher.Update(indexBuf, value)
_ = hasher.Update(indexBuf, value)
}
if list.Len() > 0 {
indexBuf = rlp.AppendUint64(indexBuf[:0], 0)
value := encodeForDerive(list, 0, valueBuf)
hasher.Update(indexBuf, value)
_ = hasher.Update(indexBuf, value)
}
for i := 0x80; i < list.Len(); i++ {
// #nosec G115 iterator
indexBuf = rlp.AppendUint64(indexBuf[:0], uint64(i))
value := encodeForDerive(list, i, valueBuf)
hasher.Update(indexBuf, value)
_ = hasher.Update(indexBuf, value)

Check warning on line 173 in pkg/proofs/ethereum/proof.go

View check run for this annotation

Codecov / codecov/patch

pkg/proofs/ethereum/proof.go#L173

Added line #L173 was not covered by tests
}
return Trie{hasher}
}
2 changes: 1 addition & 1 deletion rpc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/signer/core/apitypes"
ethermint "github.com/zeta-chain/ethermint/types"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"

"github.com/ethereum/go-ethereum/common/math"
rpctypes "github.com/zeta-chain/node/rpc/types"
"github.com/zeta-chain/node/server/config"
)
Expand Down
2 changes: 1 addition & 1 deletion rpc/backend/chain_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common/hexutil"
ethmath "github.com/ethereum/go-ethereum/common/math"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
Expand All @@ -33,7 +34,6 @@ import (
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
feemarkettypes "github.com/zeta-chain/ethermint/x/feemarket/types"

ethmath "github.com/ethereum/go-ethereum/common/math"
rpctypes "github.com/zeta-chain/node/rpc/types"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/namespaces/ethereum/eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"github.com/cometbft/cometbft/libs/log"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
ethmath "github.com/ethereum/go-ethereum/common/math"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
ethermint "github.com/zeta-chain/ethermint/types"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"

ethmath "github.com/ethereum/go-ethereum/common/math"
"github.com/zeta-chain/node/rpc/backend"
rpctypes "github.com/zeta-chain/node/rpc/types"
)
Expand Down
7 changes: 3 additions & 4 deletions server/json_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
"net/http"
"time"

"golang.org/x/exp/slog"

tmlog "github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
Expand All @@ -31,6 +29,7 @@ import (
"github.com/gorilla/mux"
"github.com/rs/cors"
ethermint "github.com/zeta-chain/ethermint/types"
"golang.org/x/exp/slog"

"github.com/zeta-chain/node/rpc"
"github.com/zeta-chain/node/server/config"
Expand All @@ -45,7 +44,7 @@ func (g *gethLogsToTm) Enabled(_ context.Context, _ slog.Level) bool {
return true
}

func (g *gethLogsToTm) Handle(ctx context.Context, record slog.Record) error {
func (g *gethLogsToTm) Handle(_ context.Context, record slog.Record) error {
attrs := g.attrs
record.Attrs(func(attr slog.Attr) bool {
attrs = append(attrs, attr)
Expand All @@ -71,7 +70,7 @@ func (g *gethLogsToTm) WithAttrs(attrs []slog.Attr) slog.Handler {
}
}

func (g *gethLogsToTm) WithGroup(name string) slog.Handler {
func (g *gethLogsToTm) WithGroup(_ string) slog.Handler {
return g
}

Expand Down

0 comments on commit ab8dda8

Please sign in to comment.