Skip to content

Commit

Permalink
chore_: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
osmaczko committed Oct 22, 2024
1 parent 8699c3d commit adcd51b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
14 changes: 11 additions & 3 deletions account/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"path/filepath"
"testing"

"go.uber.org/zap"

"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/keystore"
"github.com/status-im/status-go/eth-node/types"
Expand All @@ -21,7 +23,9 @@ const testPassword = "test-password"
const newTestPassword = "new-test-password"

func TestVerifyAccountPassword(t *testing.T) {
accManager := NewGethManager()
logger, err := zap.NewDevelopment()
require.NoError(t, err)
accManager := NewGethManager(logger)
keyStoreDir := t.TempDir()
emptyKeyStoreDir := t.TempDir()

Expand Down Expand Up @@ -103,7 +107,9 @@ func TestVerifyAccountPasswordWithAccountBeforeEIP55(t *testing.T) {
err := utils.ImportTestAccount(keyStoreDir, "test-account3-before-eip55.pk")
require.NoError(t, err)

accManager := NewGethManager()
logger, err := zap.NewDevelopment()
require.NoError(t, err)
accManager := NewGethManager(logger)

address := types.HexToAddress(utils.TestConfig.Account3.WalletAddress)
_, err = accManager.VerifyAccountPassword(keyStoreDir, address.Hex(), utils.TestConfig.Account3.Password)
Expand Down Expand Up @@ -133,7 +139,9 @@ type testAccount struct {
// SetupTest is used here for reinitializing the mock before every
// test function to avoid faulty execution.
func (s *ManagerTestSuite) SetupTest() {
s.accManager = NewGethManager()
logger, err := zap.NewDevelopment()
s.Require().NoError(err)
s.accManager = NewGethManager(logger)

keyStoreDir := s.T().TempDir()
s.Require().NoError(s.accManager.InitKeystore(keyStoreDir))
Expand Down
4 changes: 3 additions & 1 deletion metrics/node/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"errors"
"strings"

"go.uber.org/zap"

"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"

Expand Down Expand Up @@ -71,7 +73,7 @@ func calculatePeerCounts(server *p2p.Server) {
for _, p := range peers {
labels, err := labelsFromNodeName(p.Fullname())
if err != nil {
logger.Warn("failed parsing peer name", "error", err, "name", p.Name())
logger.Warn("failed parsing peer name", zap.String("name", p.Name()), zap.Error(err))

Check warning on line 76 in metrics/node/metrics.go

View check run for this annotation

Codecov / codecov/patch

metrics/node/metrics.go#L76

Added line #L76 was not covered by tests
continue
}
nodePeersGauge.With(labels).Inc()
Expand Down
2 changes: 1 addition & 1 deletion services/wallet/collectibles/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (s *Service) sendResponseEvent(requestID *int32, eventType walletevent.Even
}

logutils.ZapLogger().Debug("wallet.api.collectibles.Service RESPONSE",
zap.Int32("requestID", *requestID),
zap.Any("requestID", requestID),
zap.String("eventType", string(eventType)),
zap.Int("payload.len", len(payload)),
zap.Error(err),
Expand Down
5 changes: 4 additions & 1 deletion services/web3provider/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"go.uber.org/zap"

"github.com/status-im/status-go/account"
"github.com/status-im/status-go/appdatabase"
Expand Down Expand Up @@ -54,7 +55,9 @@ func setupTestAPI(t *testing.T) (*API, func()) {
utils.Init()
require.NoError(t, utils.ImportTestAccount(keyStoreDir, utils.GetAccount1PKFile()))

accManager := account.NewGethManager()
logger, err := zap.NewDevelopment()
require.NoError(t, err)
accManager := account.NewGethManager(logger)

nodeConfig := &params.NodeConfig{
KeyStoreDir: keyStoreDir,
Expand Down
3 changes: 2 additions & 1 deletion wakuv2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ import (
"sync"
"time"

"go.uber.org/zap"

"github.com/waku-org/go-waku/waku/v2/payload"
"github.com/waku-org/go-waku/waku/v2/protocol/pb"
"go.uber.org/zap"

"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/wakuv2/common"
Expand Down
3 changes: 2 additions & 1 deletion wakuv2/common/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"sync/atomic"
"time"

"go.uber.org/zap"

"github.com/waku-org/go-waku/waku/v2/payload"
"github.com/waku-org/go-waku/waku/v2/protocol"
"go.uber.org/zap"

"github.com/status-im/status-go/logutils"

Expand Down

0 comments on commit adcd51b

Please sign in to comment.