From 7882187d6b2c36b84a104b0e64469af3d8742948 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 19 Jul 2024 18:37:26 +0900 Subject: [PATCH] test: fix lint --- app/rapidgen.go | 13 +++++++++---- app/upgrades.go | 2 +- rpc/websockets.go | 2 +- server/start.go | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/rapidgen.go b/app/rapidgen.go index 39d4518c52..3223f57a87 100644 --- a/app/rapidgen.go +++ b/app/rapidgen.go @@ -129,11 +129,13 @@ var ( GenType(&disttypes.MsgWithdrawDelegatorReward{}, &distapi.MsgWithdrawDelegatorReward{}, GenOpts), GenType(&disttypes.MsgWithdrawValidatorCommission{}, &distapi.MsgWithdrawValidatorCommission{}, GenOpts), GenType(&disttypes.MsgSetWithdrawAddress{}, &distapi.MsgSetWithdrawAddress{}, GenOpts), - GenType(&disttypes.MsgFundCommunityPool{}, &distapi.MsgFundCommunityPool{}, GenOpts), // nolint:staticcheck // testing legacy code path GenType(&disttypes.MsgUpdateParams{}, &distapi.MsgUpdateParams{}, GenOpts.WithDisallowNil()), - GenType(&disttypes.MsgCommunityPoolSpend{}, &distapi.MsgCommunityPoolSpend{}, GenOpts), // nolint:staticcheck // testing legacy code path GenType(&disttypes.MsgDepositValidatorRewardsPool{}, &distapi.MsgDepositValidatorRewardsPool{}, GenOpts), + // distribution - testing legacy code path + GenType(&disttypes.MsgFundCommunityPool{}, &distapi.MsgFundCommunityPool{}, GenOpts), //nolint:staticcheck + GenType(&disttypes.MsgCommunityPoolSpend{}, &distapi.MsgCommunityPoolSpend{}, GenOpts), //nolint:staticcheck + // evidence GenType(&evidencetypes.MsgSubmitEvidence{}, &evidenceapi.MsgSubmitEvidence{}, GenOpts.WithAnyTypes(&evidenceapi.Equivocation{}). @@ -274,10 +276,13 @@ var ( GenType(&stakingtypes.StakeAuthorization{}, &stakingapi.StakeAuthorization{}, GenOpts), - GenType(&upgradetypes.CancelSoftwareUpgradeProposal{}, &upgradeapi.CancelSoftwareUpgradeProposal{}, GenOpts), // nolint:staticcheck // testing legacy code path - GenType(&upgradetypes.SoftwareUpgradeProposal{}, &upgradeapi.SoftwareUpgradeProposal{}, GenOpts.WithDisallowNil()), // nolint:staticcheck // testing legacy code path + // upgrade GenType(&upgradetypes.Plan{}, &upgradeapi.Plan{}, GenOpts.WithDisallowNil()), + // upgrade - testing legacy code path + GenType(&upgradetypes.CancelSoftwareUpgradeProposal{}, &upgradeapi.CancelSoftwareUpgradeProposal{}, GenOpts), //nolint:staticcheck + GenType(&upgradetypes.SoftwareUpgradeProposal{}, &upgradeapi.SoftwareUpgradeProposal{}, GenOpts.WithDisallowNil()), //nolint:staticcheck + GenType(&vestingtypes.BaseVestingAccount{}, &vestingapi.BaseVestingAccount{}, GenOpts.WithDisallowNil()), GenType(&vestingtypes.ContinuousVestingAccount{}, &vestingapi.ContinuousVestingAccount{}, GenOpts.WithDisallowNil()), GenType(&vestingtypes.DelayedVestingAccount{}, &vestingapi.DelayedVestingAccount{}, GenOpts.WithDisallowNil()), diff --git a/app/upgrades.go b/app/upgrades.go index df2307ad41..95f6ddec2c 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -91,7 +91,7 @@ func (app *EthermintApp) RegisterUpgradeHandlers( baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) app.UpgradeKeeper.SetUpgradeHandler( planName, - func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) if fromVM, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM); err != nil { diff --git a/rpc/websockets.go b/rpc/websockets.go index a2cbab6a7a..b1c3f1d4f3 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -126,7 +126,7 @@ func (s *websocketsServer) Start() { func (s *websocketsServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { upgrader := websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { + CheckOrigin: func(_ *http.Request) bool { return true }, } diff --git a/server/start.go b/server/start.go index f8354e0ebf..b4806253a4 100644 --- a/server/start.go +++ b/server/start.go @@ -226,7 +226,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") // support old flags name for backwards compatibility - cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + cmd.Flags().SetNormalizeFunc(func(_ *pflag.FlagSet, name string) pflag.NormalizedName { if name == "with-tendermint" { name = srvflags.WithComet }