chore: bump golangci-lint and fix all linting issues (#21761)
This commit is contained in:
@@ -357,7 +357,6 @@ func (s *E2ETestSuite) TestCLIQueryTxCmdByHash() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxCmd()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -490,7 +489,6 @@ func (s *E2ETestSuite) TestCLIQueryTxCmdByEvents() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxCmd()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -570,7 +568,6 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxsByEventsCmd()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -1503,7 +1500,6 @@ func (s *E2ETestSuite) TestAuxSigner() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
_, err := govtestutil.MsgSubmitLegacyProposal(
|
||||
val.GetClientCtx(),
|
||||
@@ -1730,7 +1726,6 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := govtestutil.MsgSubmitLegacyProposal(
|
||||
val.GetClientCtx(),
|
||||
|
||||
@@ -63,7 +63,6 @@ func (s *E2ETestSuite) TestQueryGrantGRPC() {
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
resp, _ := testutil.GetRequest(tc.url)
|
||||
require := s.Require()
|
||||
@@ -151,7 +150,6 @@ func (s *E2ETestSuite) TestQueryGrantsGRPC() {
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
tc.preRun()
|
||||
resp, err := testutil.GetRequest(tc.url)
|
||||
|
||||
@@ -305,7 +305,6 @@ func (s *E2ETestSuite) TestNewExecGenericAuthorized() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -415,7 +414,6 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -619,7 +617,6 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -686,7 +683,6 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -841,7 +837,6 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -909,7 +904,6 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdExecAuthorization()
|
||||
clientCtx := val.GetClientCtx()
|
||||
|
||||
@@ -154,7 +154,6 @@ func (s *E2ETestSuite) TestLatestValidatorSet_GRPC() {
|
||||
{"with pagination", &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
grpcRes, err := s.queryClient.GetLatestValidatorSet(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
@@ -185,7 +184,6 @@ func (s *E2ETestSuite) TestLatestValidatorSet_GRPCGateway() {
|
||||
{"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=0&pagination.limit=2", vals[0].GetAPIAddress()), false, ""},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := testutil.GetRequest(tc.url)
|
||||
s.Require().NoError(err)
|
||||
@@ -218,7 +216,6 @@ func (s *E2ETestSuite) TestValidatorSetByHeight_GRPC() {
|
||||
{"with pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
grpcRes, err := s.queryClient.GetValidatorSetByHeight(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
@@ -247,7 +244,6 @@ func (s *E2ETestSuite) TestValidatorSetByHeight_GRPCGateway() {
|
||||
{"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=0&pagination.limit=2", vals[0].GetAPIAddress(), 1), false, ""},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := testutil.GetRequest(tc.url)
|
||||
s.Require().NoError(err)
|
||||
@@ -326,8 +322,6 @@ func (s *E2ETestSuite) TestABCIQuery() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
res, err := s.queryClient.ABCIQuery(context.Background(), tc.req)
|
||||
if tc.expectErr {
|
||||
|
||||
@@ -64,7 +64,7 @@ func (s *GRPCQueryTestSuite) TestQueryParamsGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequest(tc.url)
|
||||
s.Run(tc.name, func() {
|
||||
s.Require().NoError(err)
|
||||
@@ -99,7 +99,7 @@ func (s *GRPCQueryTestSuite) TestQueryValidatorDistributionInfoGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequest(tc.url)
|
||||
s.Run(tc.name, func() {
|
||||
if tc.expErr {
|
||||
@@ -152,7 +152,7 @@ func (s *GRPCQueryTestSuite) TestQueryOutstandingRewardsGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequestWithHeaders(tc.url, tc.headers)
|
||||
s.Run(tc.name, func() {
|
||||
if tc.expErr {
|
||||
@@ -206,7 +206,7 @@ func (s *GRPCQueryTestSuite) TestQueryValidatorCommissionGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequestWithHeaders(tc.url, tc.headers)
|
||||
s.Run(tc.name, func() {
|
||||
if tc.expErr {
|
||||
@@ -264,7 +264,7 @@ func (s *GRPCQueryTestSuite) TestQuerySlashesGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequest(tc.url)
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
@@ -340,7 +340,7 @@ func (s *GRPCQueryTestSuite) TestQueryDelegatorRewardsGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequestWithHeaders(tc.url, tc.headers)
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
@@ -392,7 +392,7 @@ func (s *GRPCQueryTestSuite) TestQueryDelegatorValidatorsGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequest(tc.url)
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
@@ -444,7 +444,7 @@ func (s *GRPCQueryTestSuite) TestQueryWithdrawAddressGRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
resp, err := sdktestutil.GetRequest(tc.url)
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
|
||||
@@ -164,8 +164,6 @@ func (s *E2ETestSuite) TestNewCmdSubmitProposal() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdSubmitProposal()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -260,8 +258,6 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdSubmitLegacyProposal()
|
||||
clientCtx := val.GetClientCtx()
|
||||
@@ -357,7 +353,6 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdWeightedVote()
|
||||
clientCtx := val.GetClientCtx()
|
||||
|
||||
@@ -175,7 +175,6 @@ func (s *E2ETestSuite) TestSimulateTx_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
// Broadcast the tx via gRPC via the validator's clientCtx (which goes
|
||||
// through Tendermint).
|
||||
@@ -506,7 +505,6 @@ func (s *E2ETestSuite) TestBroadcastTx_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
// Broadcast the tx via gRPC via the validator's clientCtx (which goes
|
||||
// through Tendermint).
|
||||
@@ -772,7 +770,6 @@ func (s *E2ETestSuite) TestTxEncode_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := s.queryClient.TxEncode(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
@@ -852,7 +849,6 @@ func (s *E2ETestSuite) TestTxDecode_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := s.queryClient.TxDecode(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
@@ -963,7 +959,6 @@ func (s *E2ETestSuite) TestTxEncodeAmino_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := s.queryClient.TxEncodeAmino(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
@@ -1049,7 +1044,6 @@ func (s *E2ETestSuite) TestTxDecodeAmino_GRPC() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := s.queryClient.TxDecodeAmino(context.Background(), tc.req)
|
||||
if tc.expErr {
|
||||
|
||||
@@ -274,7 +274,6 @@ func (s *CLITestSuite) TestCLIQueryTxCmdByHash() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxCmd()
|
||||
cmd.SetArgs(tc.args)
|
||||
@@ -340,7 +339,6 @@ func (s *CLITestSuite) TestCLIQueryTxCmdByEvents() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxCmd()
|
||||
cmd.SetArgs(tc.args)
|
||||
@@ -383,7 +381,6 @@ func (s *CLITestSuite) TestCLIQueryTxsCmdByEvents() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := authcli.QueryTxsByEventsCmd()
|
||||
|
||||
@@ -1019,7 +1016,6 @@ func (s *CLITestSuite) TestAuxSigner() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
_, err := govtestutil.MsgSubmitLegacyProposal(
|
||||
s.clientCtx,
|
||||
@@ -1238,7 +1234,6 @@ func (s *CLITestSuite) TestAuxToFeeWithTips() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
res, err := govtestutil.MsgSubmitLegacyProposal(
|
||||
s.clientCtx,
|
||||
|
||||
@@ -250,7 +250,6 @@ func TestAsyncExec(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.req,
|
||||
|
||||
@@ -111,8 +111,6 @@ func (s *CLITestSuite) TestTxWithdrawAllRewardsCmd() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewWithdrawAllRewardsCmd()
|
||||
|
||||
|
||||
@@ -331,7 +331,6 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) {
|
||||
height := f.app.LastBlockHeight()
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
@@ -469,7 +468,6 @@ func TestMsgSetWithdrawAddress(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
tc.preRun()
|
||||
res, err := f.app.RunMsg(
|
||||
@@ -566,7 +564,6 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
@@ -600,7 +597,6 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) {
|
||||
}, remainder.Commission)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,7 +662,6 @@ func TestMsgFundCommunityPool(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
@@ -808,7 +803,6 @@ func TestMsgUpdateParams(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
@@ -891,7 +885,6 @@ func TestMsgCommunityPoolSpend(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
@@ -992,7 +985,6 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
|
||||
@@ -72,7 +72,6 @@ func TestAddGenesisAccountCmd(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
logger := log.NewNopLogger()
|
||||
@@ -217,7 +216,6 @@ func TestBulkAddGenesisAccountCmd(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
logger := log.NewNopLogger()
|
||||
|
||||
@@ -61,7 +61,6 @@ func TestInitCmd(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
logger := log.NewNopLogger()
|
||||
|
||||
@@ -163,8 +163,6 @@ func TestCancelUnbondingDelegation(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
_, err := msgServer.CancelUnbondingDelegation(ctx, &tc.req)
|
||||
if tc.exceptErr {
|
||||
|
||||
Reference in New Issue
Block a user