Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau committed Sep 24, 2024
1 parent c30f67e commit 85db26f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ issues:
- text: "// nolint` should be written without leading space as `//nolint"
linters:
- nolintlint
- text: "G115:"
linters:
- gosec
12 changes: 6 additions & 6 deletions app/upgrades/v1.15/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck
ibcconntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibcswitchtypes "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"
Expand Down Expand Up @@ -80,18 +80,18 @@ func createUpgradeHandler(mm *module.Manager, appKeepers *keepers.SecretAppKeepe
case govtypes.ModuleName:
keyTable = govv1.ParamKeyTable() //nolint:staticcheck
case ibcswitchtypes.ModuleName:
keyTable = ibcswitchtypes.ParamKeyTable() //nolint:staticcheck
keyTable = ibcswitchtypes.ParamKeyTable()
case crisistypes.ModuleName:
keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck
case ibcexported.ModuleName:
keyTable = ibcclienttypes.ParamKeyTable() //nolint:staticcheck
keyTable = ibcclienttypes.ParamKeyTable()
keyTable.RegisterParamSet(&ibcconntypes.Params{})
case ibctransfertypes.ModuleName:
keyTable = ibctransfertypes.ParamKeyTable() //nolint:staticcheck
keyTable = ibctransfertypes.ParamKeyTable()
case icacontrollertypes.SubModuleName:
keyTable = icacontrollertypes.ParamKeyTable() //nolint:staticcheck
keyTable = icacontrollertypes.ParamKeyTable()
case icahosttypes.SubModuleName:
keyTable = icahosttypes.ParamKeyTable() //nolint:staticcheck
keyTable = icahosttypes.ParamKeyTable()
default:
continue
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/secretd/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,15 @@ Please report any issues with this command
errDetails := ErrorResponse{}
err := json.Unmarshal(body, &errDetails)
if err != nil {
return fmt.Errorf(fmt.Sprintf("Registration TX was not successful - %s", err))
return fmt.Errorf("registration TX was not successful - %s", err)
}
return fmt.Errorf(fmt.Sprintf("Registration TX was not successful - %s", errDetails.Details))
return fmt.Errorf("registration TX was not successful - %s", errDetails.Details)
}

details := OkayResponse{}
err = json.Unmarshal(body, &details)
if err != nil {
return fmt.Errorf(fmt.Sprintf("Error getting seed from registration service - %s", err))
return fmt.Errorf("error getting seed from registration service - %s", err)
}

seed := details.Details.Value
Expand Down
6 changes: 3 additions & 3 deletions x/compute/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
portkeeper "github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper"
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
wasmTypes "github.com/scrtlabs/SecretNetwork/go-cosmwasm/types"
"golang.org/x/crypto/ripemd160" //nolint:staticcheck
"golang.org/x/crypto/ripemd160" //nolint

"github.com/cosmos/cosmos-sdk/telemetry"

Expand Down Expand Up @@ -1173,8 +1173,8 @@ func contractAddress(codeID, instanceID uint64, creator sdk.AccAddress) sdk.AccA
hashSourceBytes = append(hashSourceBytes, creator...)

sha := sha256.Sum256(hashSourceBytes)
hasherRIPEMD160 := ripemd160.New()
hasherRIPEMD160.Write(sha[:]) // does not error
hasherRIPEMD160 := ripemd160.New() //nolint

Check failure on line 1176 in x/compute/internal/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / lint

directive `//nolint` is unused (nolintlint)
hasherRIPEMD160.Write(sha[:]) // does not error
return sdk.AccAddress(hasherRIPEMD160.Sum(nil))
}

Expand Down
2 changes: 1 addition & 1 deletion x/emergencybutton/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// InitGenesis initializes the x/emergencybutton's module's state from a provided genesis
// state, which includes the parameter for the pauser address and for the switch status.
func (i *Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) {
i.SetParams(ctx, genState.Params)
i.SetParams(ctx, genState.Params) //nolint:errcheck
}

// ExportGenesis returns the x/emergencybutton module's exported genesis.
Expand Down
9 changes: 4 additions & 5 deletions x/emergencybutton/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package keeper

import (
"cosmossdk.io/errors"
storetypes "cosmossdk.io/store/types"
codec "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
//nolint:staticcheck
storetypes "cosmossdk.io/store/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"
Expand Down Expand Up @@ -61,6 +60,6 @@ func (i *Keeper) IsHalted(ctx sdk.Context) bool {
}

// GetAuthority returns the x/emergencybutton module's authority.
func (k Keeper) GetAuthority() string {
return k.authority
func (i Keeper) GetAuthority() string {
return i.authority
}
2 changes: 1 addition & 1 deletion x/emergencybutton/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (i *Keeper) GetSwitchStatus(ctx sdk.Context) (status string) {
func (i *Keeper) SetSwitchStatus(ctx sdk.Context, value string) {
params := i.GetParams(ctx)
params.SwitchStatus = value
i.SetParams(ctx, params)
i.SetParams(ctx, params) //nolint:errcheck
}

// SetParams sets the x/emergencybutton module parameters.
Expand Down
4 changes: 1 addition & 3 deletions x/emergencybutton/migrations/v2/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const (
ModuleName = "emergencybutton"
)

var (
ParamsKey = []byte{0x01}
)
var ParamsKey = []byte{0x01}

// Migrate migrates the x/emergencybutton module state from the consensus version 1 to
// version 2. Specifically, it takes the parameters that are currently stored
Expand Down

0 comments on commit 85db26f

Please sign in to comment.