chore: bump golangci-lint and fix all linting issues (#21761)

This commit is contained in:
Julien Robert
2024-09-16 19:11:19 +00:00
committed by GitHub
parent 52ba264c80
commit cbdfd9bdfa
186 changed files with 114 additions and 455 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ import (
"github.com/cometbft/cometbft/crypto"
secp256k1dcrd "github.com/decred/dcrd/dcrec/secp256k1/v4"
"gitlab.com/yawning/secp256k1-voi/secec"
"golang.org/x/crypto/ripemd160" //nolint: staticcheck // keep around for backwards compatibility
"golang.org/x/crypto/ripemd160" //nolint:staticcheck,gosec // keep around for backwards compatibility
errorsmod "cosmossdk.io/errors"
@@ -173,8 +173,8 @@ func (pubKey *PubKey) Address() crypto.Address {
}
sha := sha256.Sum256(pubKey.Key)
hasherRIPEMD160 := ripemd160.New()
hasherRIPEMD160.Write(sha[:]) // does not error
hasherRIPEMD160 := ripemd160.New() //nolint:gosec // keep around for backwards compatibility
hasherRIPEMD160.Write(sha[:]) // does not error
return crypto.Address(hasherRIPEMD160.Sum(nil))
}
@@ -27,7 +27,6 @@ func Test_genPrivKey(t *testing.T) {
{"valid because 0 < 1 < N", validOne, false},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
if tt.shouldPanic {
require.Panics(t, func() {
-1
View File
@@ -255,7 +255,6 @@ func TestGenPrivKeyFromSecret(t *testing.T) {
{"another seed used in cosmos tests #3", []byte("")},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
gotPrivKey := secp256k1.GenPrivKeyFromSecret(tt.secret)
require.NotNil(t, gotPrivKey)