diff --git a/.golangci.yml b/.golangci.yml index a9c0517397e9d..9b6e8ad4719c6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,6 +24,7 @@ linters: - staticcheck - stylecheck - typecheck + - thelper - unconvert - unparam - unused diff --git a/app/app.go b/app/app.go index f08859b12ffa5..6a8650bebae04 100644 --- a/app/app.go +++ b/app/app.go @@ -414,10 +414,10 @@ func RegisterSwaggerAPI(rtr *mux.Router) { rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer)) } -func (app *GaiaApp) OnTxSucceeded(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) { +func (app *GaiaApp) OnTxSucceeded(_ sdk.Context, _, _ string, _ []byte, _ []byte) { } -func (app *GaiaApp) OnTxFailed(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) { +func (app *GaiaApp) OnTxFailed(_ sdk.Context, _, _ string, _ []byte, _ []byte) { } // TestingApp functions @@ -436,6 +436,6 @@ func (app *GaiaApp) GetTxConfig() client.TxConfig { type EmptyAppOptions struct{} // Get implements AppOptions -func (ao EmptyAppOptions) Get(o string) interface{} { +func (ao EmptyAppOptions) Get(_ string) interface{} { return nil } diff --git a/app/app_test.go b/app/app_test.go index f5b29d8f52626..3f3e6b6ae3335 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -14,7 +14,7 @@ import ( type EmptyAppOptions struct{} -func (ao EmptyAppOptions) Get(o string) interface{} { +func (ao EmptyAppOptions) Get(_ string) interface{} { return nil } diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index a0a61634ae288..ccf03d641b6b2 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -64,7 +64,7 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) { type EmptyAppOptions struct{} -func (EmptyAppOptions) Get(o string) interface{} { return nil } +func (EmptyAppOptions) Get(_ string) interface{} { return nil } func Setup(t *testing.T) *gaiaapp.GaiaApp { t.Helper() @@ -148,6 +148,7 @@ func genesisStateWithValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) gaiaapp.GenesisState { + t.Helper() // set genesis accounts authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index c68799b56ea47..3ba7db9affdde 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -15,7 +15,7 @@ import ( func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, - keepers *keepers.AppKeepers, + _ *keepers.AppKeepers, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { vm[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion() diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 3ae7b17bec15f..44a20a120aca6 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -10,7 +10,7 @@ import ( func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, - keepers *keepers.AppKeepers, + _ *keepers.AppKeepers, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Starting module migrations...") diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index bde6e10975320..02f90ce538afb 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -107,6 +107,7 @@ func TestInitExportGenesis(t *testing.T) { } func setupTestStore(t *testing.T) (sdk.Context, simappparams.EncodingConfig, paramstypes.Subspace) { + t.Helper() db := dbm.NewMemDB() ms := store.NewCommitMultiStore(db) encCfg := simapp.MakeTestEncodingConfig() diff --git a/x/globalfee/module.go b/x/globalfee/module.go index 2549e8403ce55..d2cf91c0f41eb 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -39,7 +39,7 @@ func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { }) } -func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { +func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { var data types.GenesisState err := marshaler.UnmarshalJSON(message, &data) if err != nil { @@ -51,10 +51,10 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client return nil } -func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { } -func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) { +func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { } func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { @@ -73,7 +73,7 @@ func (a AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } -func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { +func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { } type AppModule struct { @@ -103,7 +103,7 @@ func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) jso return marshaler.MustMarshalJSON(&genState) } -func (a AppModule) RegisterInvariants(registry sdk.InvariantRegistry) { +func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { } func (a AppModule) Route() sdk.Route { @@ -114,7 +114,7 @@ func (a AppModule) QuerierRoute() string { return types.QuerierRoute } -func (a AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { +func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { return nil } @@ -122,10 +122,10 @@ func (a AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace)) } -func (a AppModule) BeginBlock(context sdk.Context, block abci.RequestBeginBlock) { +func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { } -func (a AppModule) EndBlock(context sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate { +func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return nil }