diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d146728e..71d924cc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -106,7 +106,7 @@ jobs: uses: golangci/golangci-lint-action@v3 if: steps.changed-go-files.outputs.any_changed == 'true' with: - version: v1.49 + version: v1.53 - name: Lint go code (gofumpt) if: steps.changed-go-files.outputs.any_changed == 'true' diff --git a/app/app.go b/app/app.go index 9a1f3c6d..0a6dcc2f 100644 --- a/app/app.go +++ b/app/app.go @@ -996,7 +996,7 @@ func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { // RegisterAPIRoutes registers all application module routes with the provided // API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (app *App) RegisterAPIRoutes(apiSvr *api.Server, _ config.APIConfig) { clientCtx := apiSvr.ClientCtx // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) diff --git a/x/logic/client/cli/query.go b/x/logic/client/cli/query.go index 20fe934e..39d2deb1 100644 --- a/x/logic/client/cli/query.go +++ b/x/logic/client/cli/query.go @@ -11,7 +11,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module. -func GetQueryCmd(queryRoute string) *cobra.Command { +func GetQueryCmd(_ string) *cobra.Command { // Group logic queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/logic/fs/wasm.go b/x/logic/fs/wasm.go index c140515a..5baee37a 100644 --- a/x/logic/fs/wasm.go +++ b/x/logic/fs/wasm.go @@ -59,7 +59,7 @@ func (w WasmHandler) Open(ctx context.Context, uri *url.URL) (fs.File, error) { } query := uri.Query().Get(queryKey) - var base64Decode = true + base64Decode := true if uri.Query().Has(base64DecodeKey) { if base64Decode, err = strconv.ParseBool(uri.Query().Get(base64DecodeKey)); err != nil { return nil, fmt.Errorf("failed convert 'base64Decode' query value to boolean: %w", err) @@ -87,5 +87,4 @@ func (w WasmHandler) Open(ctx context.Context, uri *url.URL) (fs.File, error) { } return NewVirtualFile(data, uri, sdkCtx.BlockTime()), nil - } diff --git a/x/logic/migrations/v2/migrations.go b/x/logic/migrations/v2/migrations.go index 914f4d10..a8af8f50 100644 --- a/x/logic/migrations/v2/migrations.go +++ b/x/logic/migrations/v2/migrations.go @@ -8,7 +8,7 @@ import ( "github.com/okp4/okp4d/x/logic/types" ) -func MigrateStore(ctx sdk.Context, legacySubspace exported.Subspace, cdc codec.BinaryCodec) error { +func MigrateStore(ctx sdk.Context, legacySubspace exported.Subspace, _ codec.BinaryCodec) error { logger := ctx.Logger(). With("module", "logic"). With("migration", "v2") diff --git a/x/logic/module.go b/x/logic/module.go index 202eb31e..df621251 100644 --- a/x/logic/module.go +++ b/x/logic/module.go @@ -63,7 +63,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var genState types.GenesisState if err := cdc.UnmarshalJSON(bz, &genState); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) diff --git a/x/logic/types/codec.go b/x/logic/types/codec.go index 850f60b7..438ec550 100644 --- a/x/logic/types/codec.go +++ b/x/logic/types/codec.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterCodec(cdc *codec.LegacyAmino) { +func RegisterCodec(_ *codec.LegacyAmino) { } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { diff --git a/x/logic/types/msg.go b/x/logic/types/msg.go index 1e67aff1..34ceeb1d 100644 --- a/x/logic/types/msg.go +++ b/x/logic/types/msg.go @@ -20,11 +20,7 @@ func (m *MsgUpdateParams) ValidateBasic() error { return errorsmod.Wrap(err, "invalid authority address") } - if err := m.Params.Validate(); err != nil { - return err - } - - return nil + return m.Params.Validate() } // GetSignBytes implements the LegacyMsg interface. diff --git a/x/logic/types/params.go b/x/logic/types/params.go index 274017a3..c3124cfd 100644 --- a/x/logic/types/params.go +++ b/x/logic/types/params.go @@ -41,11 +41,7 @@ func (p Params) Validate() error { if err := validateInterpreter(p.Interpreter); err != nil { return err } - if err := validateLimits(p.Limits); err != nil { - return err - } - - return nil + return validateLimits(p.Limits) } // String implements the Stringer interface. diff --git a/x/mint/module.go b/x/mint/module.go index eafd2a3f..e7a66002 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -43,7 +43,7 @@ func (AppModuleBasic) Name() string { } // RegisterLegacyAminoCodec registers the mint module's types on the given LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} +func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} // RegisterInterfaces registers the module's interface types. func (b AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { @@ -57,7 +57,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the mint module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var data types.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) @@ -165,7 +165,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // ProposalMsgs returns msgs used for governance proposals for simulations. -func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { +func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { return simulation.ProposalMsgs() } diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go index 0cd6d47c..4c389910 100644 --- a/x/mint/simulation/genesis.go +++ b/x/mint/simulation/genesis.go @@ -25,7 +25,7 @@ func GenInflation(r *rand.Rand) sdk.Dec { } // GenAnnualReductionFactor randomized AnnualReductionFactor. -func GenAnnualReductionFactorMax(r *rand.Rand) sdk.Dec { +func GenAnnualReductionFactorMax(_ *rand.Rand) sdk.Dec { return sdk.NewDecWithPrec(20, 2) } diff --git a/x/mint/types/msg.go b/x/mint/types/msg.go index 1e67aff1..34ceeb1d 100644 --- a/x/mint/types/msg.go +++ b/x/mint/types/msg.go @@ -20,11 +20,7 @@ func (m *MsgUpdateParams) ValidateBasic() error { return errorsmod.Wrap(err, "invalid authority address") } - if err := m.Params.Validate(); err != nil { - return err - } - - return nil + return m.Params.Validate() } // GetSignBytes implements the LegacyMsg interface. diff --git a/x/mint/types/params.go b/x/mint/types/params.go index a68365c1..85b9a5ee 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -44,11 +44,8 @@ func (p Params) Validate() error { if err := validateAnnualReductionFactor(p.AnnualReductionFactor); err != nil { return err } - if err := validateBlocksPerYear(p.BlocksPerYear); err != nil { - return err - } - return nil + return validateBlocksPerYear(p.BlocksPerYear) } // String implements the Stringer interface. @@ -66,11 +63,8 @@ func validateMintDenom(i interface{}) error { if strings.TrimSpace(v) == "" { return errors.New("mint denom cannot be blank") } - if err := sdk.ValidateDenom(v); err != nil { - return err - } - return nil + return sdk.ValidateDenom(v) } func validateAnnualReductionFactor(i interface{}) error { diff --git a/x/vesting/module.go b/x/vesting/module.go index 8e9f7f42..dcb55bf7 100644 --- a/x/vesting/module.go +++ b/x/vesting/module.go @@ -51,7 +51,7 @@ func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation. Currently, this is a no-op. -func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error { return nil } diff --git a/x/vesting/types/vesting_account.go b/x/vesting/types/vesting_account.go index b07f0186..25bd4b11 100644 --- a/x/vesting/types/vesting_account.go +++ b/x/vesting/types/vesting_account.go @@ -572,7 +572,7 @@ func (plva PermanentLockedAccount) LockedCoins(_ time.Time) sdk.Coins { // TrackDelegation tracks a desired delegation amount by setting the appropriate // values for the amount of delegated vesting, delegated free, and reducing the // overall amount of base coins. -func (plva *PermanentLockedAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins) { +func (plva *PermanentLockedAccount) TrackDelegation(_ time.Time, balance, amount sdk.Coins) { plva.BaseVestingAccount.TrackDelegation(balance, plva.OriginalVesting, amount) }