From 5af53fae93079b582459da647f4045b410020dbe Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 12 Jun 2024 01:10:25 +0900 Subject: [PATCH] Apply copyloopvar --- baseapp/abci_test.go | 2 - baseapp/deliver_tx_test.go | 3 -- client/cmd_test.go | 2 - client/config/config_test.go | 1 - client/flags/flags_test.go | 2 - client/grpc/tmservice/service_test.go | 4 -- client/keys/add_ledger_test.go | 1 - client/keys/add_test.go | 1 - client/keys/codec_test.go | 2 - client/keys/list_test.go | 1 - client/keys/parse_test.go | 1 - client/keys/show_test.go | 2 - client/tx/tx_test.go | 11 +++-- client/utils_test.go | 1 - codec/amino_codec_test.go | 2 - codec/codec_common_test.go | 1 - codec/proto_codec_test.go | 2 - codec/unknownproto/unit_helpers_test.go | 1 - codec/unknownproto/unknown_fields_test.go | 4 -- crypto/hd/hdpath_test.go | 4 -- crypto/keyring/signing_algorithms_test.go | 1 - .../keys/secp256k1/secp256k1_internal_test.go | 1 - crypto/keys/secp256k1/secp256k1_test.go | 1 - crypto/types/compact_bit_array_test.go | 6 --- server/pruning_test.go | 2 - simapp/genesis_account_test.go | 1 - simapp/sim_bench_test.go | 1 - simapp/simd/cmd/genaccounts_test.go | 1 - simapp/simd/cmd/root_test.go | 1 - simapp/utils_test.go | 1 - store/cachekv/search_test.go | 2 - store/iavl/store_test.go | 2 - store/rootmulti/snapshot_test.go | 2 - store/rootmulti/store_test.go | 2 - store/types/gas_test.go | 1 - store/types/iterator_test.go | 1 - store/types/store_test.go | 1 - types/address/store_key_test.go | 1 - types/address_test.go | 2 - types/coin_test.go | 6 --- types/context_test.go | 1 - types/dec_coin_test.go | 7 --- types/decimal_internal_test.go | 1 - types/decimal_test.go | 1 - types/errors/abci_test.go | 1 - types/events_test.go | 1 - types/int_test.go | 1 - types/simulation/account_test.go | 3 -- types/simulation/rand_util_test.go | 3 -- types/uint_test.go | 2 - types/utils_test.go | 2 - x/auth/ante/basic_test.go | 2 - x/auth/client/testutil/suite.go | 7 --- x/auth/client/tx_test.go | 1 - x/auth/legacy/v043/store_test.go | 1 - x/auth/simulation/decoder_test.go | 1 - x/auth/tx/encode_decode_test.go | 3 -- x/auth/tx/service_test.go | 2 - x/auth/types/account_test.go | 3 -- x/auth/types/params_test.go | 1 - x/auth/types/permissions_test.go | 1 - x/auth/vesting/client/testutil/suite.go | 2 - x/auth/vesting/handler_test.go | 2 - x/auth/vesting/types/vesting_account_test.go | 2 - x/authz/client/testutil/grpc.go | 2 - x/authz/client/testutil/query.go | 4 -- x/authz/client/testutil/tx.go | 8 ---- x/authz/keeper/grpc_query_test.go | 4 -- x/authz/simulation/decoder_test.go | 1 - x/bank/client/testutil/grpc.go | 3 -- x/bank/client/testutil/suite.go | 8 ---- x/bank/keeper/genesis_test.go | 1 - x/bank/simulation/genesis_test.go | 2 - x/bank/types/balance_test.go | 2 - x/bank/types/genesis_test.go | 1 - x/bank/types/key_test.go | 1 - x/bank/types/metadata_test.go | 2 - x/bank/types/params_test.go | 1 - x/bankplus/keeper/keeper_test.go | 1 - x/capability/simulation/decoder_test.go | 1 - x/capability/simulation/genesis_test.go | 2 - x/capability/types/genesis_test.go | 1 - x/collection/client/testutil/query.go | 32 -------------- x/collection/client/testutil/tx.go | 44 ------------------- x/collection/msgs_test.go | 1 - x/crisis/client/testsuite/suite.go | 2 - x/crisis/handler_test.go | 1 - x/distribution/client/common/common_test.go | 1 - x/distribution/client/testutil/grpc.go | 8 ---- x/distribution/client/testutil/suite.go | 22 ---------- x/distribution/keeper/allocation_test.go | 4 +- x/distribution/legacy/v043/store_test.go | 1 - x/distribution/simulation/decoder_test.go | 1 - x/distribution/simulation/genesis_test.go | 2 - x/distribution/types/params_internal_test.go | 1 - x/evidence/client/testutil/suite.go | 2 - x/evidence/simulation/decoder_test.go | 1 - x/evidence/types/evidence_test.go | 1 - x/fbridge/types/msgs_test.go | 1 - x/feegrant/client/testutil/suite.go | 14 ------ x/feegrant/grant_test.go | 1 - x/feegrant/keeper/genesis_test.go | 1 - x/feegrant/keeper/keeper_test.go | 2 - x/feegrant/simulation/decoder_test.go | 1 - x/feegrant/types/grant_test.go | 1 - x/foundation/client/testutil/grpc.go | 1 - x/foundation/client/testutil/query.go | 24 ---------- x/foundation/client/testutil/tx.go | 24 ---------- x/foundation/genesis_test.go | 2 - x/foundation/keeper/internal/keeper_test.go | 1 - x/foundation/keeper/internal/proposal.go | 2 - x/foundation/msgs_test.go | 8 ---- x/fswap/client/testutil/grpc.go | 4 -- x/fswap/client/testutil/query.go | 8 ---- x/fswap/client/testutil/tx.go | 6 --- x/fswap/types/msgs_test.go | 1 - x/genutil/client/cli/init_test.go | 1 - x/genutil/client/testutil/migrate.go | 1 - x/genutil/client/testutil/suite.go | 2 - x/genutil/client/testutil/validate_genesis.go | 1 - x/genutil/utils_test.go | 1 - x/gov/client/testutil/grpc.go | 8 ---- x/gov/client/testutil/suite.go | 21 --------- x/gov/client/utils/query_test.go | 2 - x/gov/keeper/querier_test.go | 1 - x/gov/legacy/v043/store_test.go | 1 - x/gov/simulation/decoder_test.go | 1 - x/gov/simulation/genesis_test.go | 2 - x/gov/simulation/operations.go | 1 - x/mint/client/testutil/grpc.go | 1 - x/mint/client/testutil/suite.go | 6 --- x/mint/simulation/decoder_test.go | 1 - x/mint/simulation/genesis_test.go | 2 - x/params/client/testutil/grpc.go | 1 - x/params/client/testutil/suite.go | 2 - x/params/keeper/keeper_test.go | 7 --- x/params/proposal_handler_test.go | 1 - x/params/types/subspace_test.go | 1 - x/simulation/operation.go | 1 - x/slashing/client/testutil/grpc.go | 2 - x/slashing/client/testutil/suite.go | 6 --- x/slashing/legacy/v043/store_test.go | 1 - x/slashing/simulation/decoder_test.go | 1 - x/slashing/simulation/genesis_test.go | 2 - x/staking/client/cli/tx_test.go | 1 - x/staking/client/testutil/grpc.go | 14 ------ x/staking/client/testutil/suite.go | 25 ----------- x/staking/genesis_test.go | 1 - x/staking/legacy/v043/store_test.go | 1 - x/staking/simulation/decoder_test.go | 1 - x/staking/simulation/genesis_test.go | 2 - x/staking/types/authz_test.go | 1 - x/staking/types/msg_test.go | 2 - x/token/client/testutil/query.go | 10 ----- x/token/client/testutil/tx.go | 22 ---------- x/token/msgs_test.go | 2 - x/upgrade/keeper/grpc_query_test.go | 2 - x/upgrade/keeper/keeper_test.go | 2 - x/upgrade/types/plan_test.go | 3 -- x/upgrade/types/proposal_test.go | 2 - x/upgrade/types/storeloader_test.go | 1 - 161 files changed, 7 insertions(+), 569 deletions(-) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 9b3f5cd661..addd1545a0 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -110,8 +110,6 @@ func TestGetBlockRentionHeight(t *testing.T) { } for name, tc := range testCases { - tc := tc - tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) tc.bapp.InitChain(abci.RequestInitChain{ ConsensusParams: &abci.ConsensusParams{ diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 3194728e7d..ce907120ad 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -49,7 +49,6 @@ func TestLoadSnapshotChunk(t *testing.T) { "Zero chunk": {2, 1, 0, false}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { resp := app.LoadSnapshotChunk(abci.RequestLoadSnapshotChunk{ Height: tc.height, @@ -94,7 +93,6 @@ func TestOfferSnapshot_Errors(t *testing.T) { }, abci.ResponseOfferSnapshot_REJECT}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { resp := app.OfferSnapshot(abci.RequestOfferSnapshot{Snapshot: tc.snapshot}) assert.Equal(t, tc.result, resp.Result) @@ -1819,7 +1817,6 @@ func TestSetLoader(t *testing.T) { v := []byte("value") for name, tc := range cases { - tc := tc t.Run(name, func(t *testing.T) { // prepare a db with some data db := dbm.NewMemDB() diff --git a/client/cmd_test.go b/client/cmd_test.go index d3bfcfd9f9..54ec9a41ef 100644 --- a/client/cmd_test.go +++ b/client/cmd_test.go @@ -94,8 +94,6 @@ func TestSetCmdClientContextHandler(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { ctx := context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}) diff --git a/client/config/config_test.go b/client/config/config_test.go index d766a800f1..e7b46274c6 100644 --- a/client/config/config_test.go +++ b/client/config/config_test.go @@ -88,7 +88,6 @@ func TestConfigCmdEnvFlag(t *testing.T) { } for _, tc := range tt { - tc := tc t.Run(tc.name, func(t *testing.T) { clientCtx, cleanup := initClientContext(t, tc.envVar) defer func() { diff --git a/client/flags/flags_test.go b/client/flags/flags_test.go index f86ff64a58..54aa591e0d 100644 --- a/client/flags/flags_test.go +++ b/client/flags/flags_test.go @@ -23,8 +23,6 @@ func TestParseGasSetting(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { gs, err := flags.ParseGasSetting(tc.input) diff --git a/client/grpc/tmservice/service_test.go b/client/grpc/tmservice/service_test.go index ff5d1189c3..c05e86a135 100644 --- a/client/grpc/tmservice/service_test.go +++ b/client/grpc/tmservice/service_test.go @@ -146,7 +146,6 @@ func (s *IntegrationTestSuite) TestLatestValidatorSet_GRPC() { {"with pagination", &tmservice.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 { @@ -177,7 +176,6 @@ func (s *IntegrationTestSuite) TestLatestValidatorSet_GRPCGateway() { {"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=0&pagination.limit=2", vals[0].APIAddress), false, ""}, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { res, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -210,7 +208,6 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPC() { {"with pagination", &tmservice.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 { @@ -239,7 +236,6 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPCGateway() { {"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=0&pagination.limit=2", vals[0].APIAddress, 1), false, ""}, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { res, err := rest.GetRequest(tc.url) s.Require().NoError(err) diff --git a/client/keys/add_ledger_test.go b/client/keys/add_ledger_test.go index 31685d1ee9..2ade0ab508 100644 --- a/client/keys/add_ledger_test.go +++ b/client/keys/add_ledger_test.go @@ -154,7 +154,6 @@ func Test_runAddCmdLedgerDryRun(t *testing.T) { }, } for _, tt := range testData { - tt := tt t.Run(tt.name, func(t *testing.T) { cmd := AddKeyCommand() cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) diff --git a/client/keys/add_test.go b/client/keys/add_test.go index 67233b3263..6aafc1f0ab 100644 --- a/client/keys/add_test.go +++ b/client/keys/add_test.go @@ -307,7 +307,6 @@ func Test_runAddCmdDryRun(t *testing.T) { }, } for _, tt := range testData { - tt := tt t.Run(tt.name, func(t *testing.T) { cmd := AddKeyCommand() cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) diff --git a/client/keys/codec_test.go b/client/keys/codec_test.go index 7d91884a13..eb4a5abc0c 100644 --- a/client/keys/codec_test.go +++ b/client/keys/codec_test.go @@ -56,7 +56,6 @@ func TestMarshalJSON(t *testing.T) { {"empty object", args{data.Keys[3]}, data.JSON[3], false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got, err := keys.MarshalJSON(tt.args.o) require.Equal(t, tt.wantErr, err != nil) @@ -86,7 +85,6 @@ func TestUnmarshalJSON(t *testing.T) { {"empty object", args{data.JSON[3], &data.Answers[3]}, false}, } for idx, tt := range tests { - idx, tt := idx, tt t.Run(tt.name, func(t *testing.T) { err := keys.UnmarshalJSON(tt.args.bz, tt.args.ptr) require.Equal(t, tt.wantErr, err != nil) diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 6a0d4fdf18..9f7184602e 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -47,7 +47,6 @@ func Test_runListCmd(t *testing.T) { {"keybase: w/key", kbHome2, false}, } for _, tt := range testData { - tt := tt t.Run(tt.name, func(t *testing.T) { cmd.SetArgs([]string{ fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), diff --git a/client/keys/parse_test.go b/client/keys/parse_test.go index 5f8fd6022b..fe8c26d099 100644 --- a/client/keys/parse_test.go +++ b/client/keys/parse_test.go @@ -25,7 +25,6 @@ func TestParseKey(t *testing.T) { {"hex", []string{hexstr}, false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.wantErr, doParseKey(ParseKeyStringCommand(), config, tt.args) != nil) }) diff --git a/client/keys/show_test.go b/client/keys/show_test.go index 56394b10bb..05d945bdda 100644 --- a/client/keys/show_test.go +++ b/client/keys/show_test.go @@ -178,7 +178,6 @@ func Test_validateMultisigThreshold(t *testing.T) { {"1-2", args{2, 1}, true}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if err := validateMultisigThreshold(tt.args.k, tt.args.nKeys); (err != nil) != tt.wantErr { t.Errorf("validateMultisigThreshold() error = %v, wantErr %v", err, tt.wantErr) @@ -204,7 +203,6 @@ func Test_getBechKeyOut(t *testing.T) { {"cons", args{sdk.PrefixConsensus}, keyring.MkConsKeyOutput, false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got, err := getBechKeyOut(tt.args.bechPrefix) if tt.wantErr { diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index b9eb969055..cabeab29f2 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -71,23 +71,22 @@ func TestCalculateGas(t *testing.T) { } for _, tc := range testCases { - stc := tc txCfg := NewTestTxConfig() txf := tx.Factory{}. WithChainID("test-chain"). WithTxConfig(txCfg).WithSignMode(txCfg.SignModeHandler().DefaultMode()) - t.Run(stc.name, func(t *testing.T) { + t.Run(tc.name, func(t *testing.T) { mockClientCtx := mockContext{ gasUsed: tc.args.mockGasUsed, wantErr: tc.args.mockWantErr, } - simRes, gotAdjusted, err := tx.CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment)) - if stc.expPass { + simRes, gotAdjusted, err := tx.CalculateGas(mockClientCtx, txf.WithGasAdjustment(tc.args.adjustment)) + if tc.expPass { require.NoError(t, err) - require.Equal(t, simRes.GasInfo.GasUsed, stc.wantEstimate) - require.Equal(t, gotAdjusted, stc.wantAdjusted) + require.Equal(t, simRes.GasInfo.GasUsed, tc.wantEstimate) + require.Equal(t, gotAdjusted, tc.wantAdjusted) require.NotNil(t, simRes.Result) } else { require.Error(t, err) diff --git a/client/utils_test.go b/client/utils_test.go index 840af06fff..a0381f787d 100644 --- a/client/utils_test.go +++ b/client/utils_test.go @@ -70,7 +70,6 @@ func TestPaginate(t *testing.T) { } for i, tc := range testCases { - i, tc := i, tc t.Run(tc.name, func(t *testing.T) { start, end := client.Paginate(tc.numObjs, tc.page, tc.limit, tc.defLimit) require.Equal(t, tc.expectedStart, start, "invalid result; test case #%d", i) diff --git a/codec/amino_codec_test.go b/codec/amino_codec_test.go index 2e305a0686..7ecc75ce51 100644 --- a/codec/amino_codec_test.go +++ b/codec/amino_codec_test.go @@ -74,8 +74,6 @@ func TestAminoCodecMarshalJSONIndent(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { cdc := codec.NewAminoCodec(createTestCodec()) bz, err := cdc.MarshalJSONIndent(tc.input, "", " ") diff --git a/codec/codec_common_test.go b/codec/codec_common_test.go index dc08f0fb24..ec3eefb424 100644 --- a/codec/codec_common_test.go +++ b/codec/codec_common_test.go @@ -119,7 +119,6 @@ func testMarshaling(t *testing.T, cdc codec.Codec) { } for _, tc := range testCases { - tc := tc m1 := mustMarshaler{cdc.Marshal, cdc.MustMarshal, cdc.Unmarshal, cdc.MustUnmarshal} m2 := mustMarshaler{cdc.MarshalLengthPrefixed, cdc.MustMarshalLengthPrefixed, cdc.UnmarshalLengthPrefixed, cdc.MustUnmarshalLengthPrefixed} m3 := mustMarshaler{ diff --git a/codec/proto_codec_test.go b/codec/proto_codec_test.go index 8e653b0d1a..ba26ddfc3e 100644 --- a/codec/proto_codec_test.go +++ b/codec/proto_codec_test.go @@ -58,8 +58,6 @@ func TestProtoCodecUnmarshalLengthPrefixedChecks(t *testing.T) { } for _, falseSize := range falseSizes { - falseSize := falseSize - t.Run(fmt.Sprintf("ByMarshaling falseSize=%d", falseSize), func(t *testing.T) { lpm := &lyingProtoMarshaler{ ProtoMarshaler: &testdata.Cat{Lives: 9, Moniker: "glowing"}, diff --git a/codec/unknownproto/unit_helpers_test.go b/codec/unknownproto/unit_helpers_test.go index 9c408a6d1f..b156422489 100644 --- a/codec/unknownproto/unit_helpers_test.go +++ b/codec/unknownproto/unit_helpers_test.go @@ -22,7 +22,6 @@ func TestWireTypeToString(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(fmt.Sprintf("wireType=%d", tt.typ), func(t *testing.T) { if g, w := wireTypeToString(tt.typ), tt.want; g != w { t.Fatalf("Mismatch:\nGot: %q\nWant: %q\n", g, w) diff --git a/codec/unknownproto/unknown_fields_test.go b/codec/unknownproto/unknown_fields_test.go index 9b14c77287..8f9a9af7f7 100644 --- a/codec/unknownproto/unknown_fields_test.go +++ b/codec/unknownproto/unknown_fields_test.go @@ -223,7 +223,6 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { protoBlob, err := proto.Marshal(tt.in) if err != nil { @@ -280,7 +279,6 @@ func TestRejectUnknownFields_allowUnknownNonCriticals(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { blob, err := proto.Marshal(tt.in) if err != nil { @@ -483,7 +481,6 @@ func TestRejectUnknownFieldsNested(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { protoBlob, err := proto.Marshal(tt.in) if err != nil { @@ -634,7 +631,6 @@ func TestRejectUnknownFieldsFlat(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { blob, err := proto.Marshal(tt.in) if err != nil { diff --git a/crypto/hd/hdpath_test.go b/crypto/hd/hdpath_test.go index 86b0388235..4fcc46220c 100644 --- a/crypto/hd/hdpath_test.go +++ b/crypto/hd/hdpath_test.go @@ -107,9 +107,7 @@ func TestCreateHDPath(t *testing.T) { {"m/44'/114'/1'/1/0", args{114, 1, 1}, hd.BIP44Params{Purpose: 44, CoinType: 114, Account: 1, AddressIndex: 1}}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { - tt := tt require.Equal(t, tt.want, *hd.CreateHDPath(tt.args.coinType, tt.args.account, tt.args.index)) }) } @@ -170,7 +168,6 @@ func TestDeriveHDPathRange(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.path, func(t *testing.T) { master, ch := hd.ComputeMastersFromSeed(seed) _, err := hd.DerivePrivateKeyForPath(master, ch, tt.path) @@ -297,7 +294,6 @@ func TestDerivePrivateKeyForPathDoNotCrash(t *testing.T) { } for _, path := range paths { - path := path t.Run(path, func(t *testing.T) { _, _ = hd.DerivePrivateKeyForPath([32]byte{}, [32]byte{}, path) }) diff --git a/crypto/keyring/signing_algorithms_test.go b/crypto/keyring/signing_algorithms_test.go index 7259e45ce8..e4c549d65a 100644 --- a/crypto/keyring/signing_algorithms_test.go +++ b/crypto/keyring/signing_algorithms_test.go @@ -35,7 +35,6 @@ func TestNewSigningAlgoByString(t *testing.T) { list := SigningAlgoList{hd.Secp256k1} for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { algorithm, err := NewSigningAlgoFromString(tt.algoStr, list) if tt.isSupported { diff --git a/crypto/keys/secp256k1/secp256k1_internal_test.go b/crypto/keys/secp256k1/secp256k1_internal_test.go index 539420d00e..b2360d7552 100644 --- a/crypto/keys/secp256k1/secp256k1_internal_test.go +++ b/crypto/keys/secp256k1/secp256k1_internal_test.go @@ -27,7 +27,6 @@ func Test_genPrivKey(t *testing.T) { {"valid because 0 < 1 < N", validOne, false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if tt.shouldPanic { require.Panics(t, func() { diff --git a/crypto/keys/secp256k1/secp256k1_test.go b/crypto/keys/secp256k1/secp256k1_test.go index 86b1b2f5e8..2face47179 100644 --- a/crypto/keys/secp256k1/secp256k1_test.go +++ b/crypto/keys/secp256k1/secp256k1_test.go @@ -255,7 +255,6 @@ func TestGenPrivKeyFromSecret(t *testing.T) { {"another seed used in cosmos tests #3", []byte("")}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { gotPrivKey := secp256k1.GenPrivKeyFromSecret(tt.secret) require.NotNil(t, gotPrivKey) diff --git a/crypto/types/compact_bit_array_test.go b/crypto/types/compact_bit_array_test.go index e3a84832a9..8a0a8f93bc 100644 --- a/crypto/types/compact_bit_array_test.go +++ b/crypto/types/compact_bit_array_test.go @@ -57,7 +57,6 @@ func TestBitArrayEqual(t *testing.T) { {name: "different should not be equal", b1: big1, b2: big2, eq: false}, } for _, tc := range cases { - tc := tc t.Run(tc.name, func(t *testing.T) { eq := tc.b1.Equal(tc.b2) require.Equal(t, tc.eq, eq) @@ -101,7 +100,6 @@ func TestJSONMarshalUnmarshal(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.bA.String(), func(t *testing.T) { bz, err := json.Marshal(tc.bA) require.NoError(t, err) @@ -161,7 +159,6 @@ func TestCompactMarshalUnmarshal(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.bA.String(), func(t *testing.T) { bz := tc.bA.CompactMarshal() @@ -207,8 +204,6 @@ func TestCompactBitArrayNumOfTrueBitsBefore(t *testing.T) { {`"______________xx"`, []int{14, 15}, []int{0, 1}}, } for tcIndex, tc := range testCases { - tc := tc - tcIndex := tcIndex t.Run(tc.marshalledBA, func(t *testing.T) { var bA *CompactBitArray err := json.Unmarshal([]byte(tc.marshalledBA), &bA) @@ -281,7 +276,6 @@ func TestNewCompactBitArrayCrashWithLimits(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(fmt.Sprintf("%d", tt.in), func(t *testing.T) { got := NewCompactBitArray(tt.in) if g := got != nil; g != tt.mustPass { diff --git a/server/pruning_test.go b/server/pruning_test.go index 9c462379ad..adf098face 100644 --- a/server/pruning_test.go +++ b/server/pruning_test.go @@ -54,8 +54,6 @@ func TestGetPruningOptionsFromFlags(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(j *testing.T) { viper.Reset() viper.SetDefault(FlagPruning, types.PruningOptionDefault) diff --git a/simapp/genesis_account_test.go b/simapp/genesis_account_test.go index 1100e49459..7d9f82af1d 100644 --- a/simapp/genesis_account_test.go +++ b/simapp/genesis_account_test.go @@ -80,7 +80,6 @@ func TestSimGenesisAccountValidate(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { require.Equal(t, tc.wantErr, tc.sga.Validate() != nil) }) diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index 7f8451637f..f4666c8876 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -117,7 +117,6 @@ func BenchmarkInvariants(b *testing.B) { // NOTE: We use the crisis keeper as it has all the invariants registered with // their respective metadata which makes it useful for testing/benchmarking. for _, cr := range app.CrisisKeeper.Routes() { - cr := cr b.Run(fmt.Sprintf("%s/%s", cr.ModuleName, cr.Route), func(b *testing.B) { if res, stop := cr.Invar(ctx); stop { b.Fatalf( diff --git a/simapp/simd/cmd/genaccounts_test.go b/simapp/simd/cmd/genaccounts_test.go index 154a4e0abe..0d14c40ce6 100644 --- a/simapp/simd/cmd/genaccounts_test.go +++ b/simapp/simd/cmd/genaccounts_test.go @@ -65,7 +65,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() diff --git a/simapp/simd/cmd/root_test.go b/simapp/simd/cmd/root_test.go index d45a66e6cb..7575084313 100644 --- a/simapp/simd/cmd/root_test.go +++ b/simapp/simd/cmd/root_test.go @@ -75,7 +75,6 @@ func TestAppExport(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { exported, err := a.appExport(logger, db, nil, tc.height, false, []string{}, ctx.Viper) if tc.expectErr { diff --git a/simapp/utils_test.go b/simapp/utils_test.go index c63716dfa1..f1e3f32cfa 100644 --- a/simapp/utils_test.go +++ b/simapp/utils_test.go @@ -69,7 +69,6 @@ func TestGetSimulationLog(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.store, func(t *testing.T) { require.Equal(t, tt.expectedLog, GetSimulationLog(tt.store, decoders, tt.kvPairs, tt.kvPairs), tt.store) }) diff --git a/store/cachekv/search_test.go b/store/cachekv/search_test.go index 41321c076e..aedc066903 100644 --- a/store/cachekv/search_test.go +++ b/store/cachekv/search_test.go @@ -60,7 +60,6 @@ func TestFindStartIndex(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { body := tt.sortedL got := findStartIndex(body, tt.query) @@ -129,7 +128,6 @@ func TestFindEndIndex(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { body := tt.sortedL got := findEndIndex(body, tt.query) diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index fcdcbc50da..bd23462e78 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -656,8 +656,6 @@ func TestSetInitialVersion(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { db := dbm.NewMemDB() store := tc.storeFn(db) diff --git a/store/rootmulti/snapshot_test.go b/store/rootmulti/snapshot_test.go index 14d0374fee..29b07f4c74 100644 --- a/store/rootmulti/snapshot_test.go +++ b/store/rootmulti/snapshot_test.go @@ -142,7 +142,6 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { }}, } for _, tc := range testcases { - tc := tc t.Run(fmt.Sprintf("Format %v", tc.format), func(t *testing.T) { ch := make(chan io.ReadCloser) go func() { @@ -177,7 +176,6 @@ func TestMultistoreSnapshot_Errors(t *testing.T) { "unknown height": {9, nil}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { err := store.Snapshot(tc.height, nil) require.Error(t, err) diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 944075c803..39714a49a4 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -506,8 +506,6 @@ func TestMultiStore_Pruning(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { db := dbm.NewMemDB() ms := newMultiStoreWithMounts(db, tc.po) diff --git a/store/types/gas_test.go b/store/types/gas_test.go index 8a02df4cfa..80ca8adf9e 100644 --- a/store/types/gas_test.go +++ b/store/types/gas_test.go @@ -44,7 +44,6 @@ func TestGasMeter(t *testing.T) { used := uint64(0) for unum, usage := range tc.usage { - usage := usage used += usage require.NotPanics(t, func() { meter.ConsumeGas(usage, "") }, "Not exceeded limit but panicked. tc #%d, usage #%d", tcnum, unum) require.Equal(t, used, meter.GasConsumed(), "Gas consumption not match. tc #%d, usage #%d", tcnum, unum) diff --git a/store/types/iterator_test.go b/store/types/iterator_test.go index 9e3be06fe3..65e70306d8 100644 --- a/store/types/iterator_test.go +++ b/store/types/iterator_test.go @@ -83,7 +83,6 @@ func TestPaginatedIterator(t *testing.T) { reverse: true, }, } { - tc := tc t.Run(tc.desc, func(t *testing.T) { var iter types.Iterator if tc.reverse { diff --git a/store/types/store_test.go b/store/types/store_test.go index 8dac7f5394..ff9765dbe8 100644 --- a/store/types/store_test.go +++ b/store/types/store_test.go @@ -47,7 +47,6 @@ func TestStoreUpgrades(t *testing.T) { } for name, tc := range cases { - tc := tc t.Run(name, func(t *testing.T) { for _, d := range tc.expectDelete { assert.Equal(t, tc.upgrades.IsDeleted(d.key), d.delete) diff --git a/types/address/store_key_test.go b/types/address/store_key_test.go index ca3b4d8ec2..6f04121baf 100644 --- a/types/address/store_key_test.go +++ b/types/address/store_key_test.go @@ -32,7 +32,6 @@ func (suite *StoreKeySuite) TestLengthPrefix() { } for _, tt := range tests { - tt := tt suite.Run(tt.name, func() { storeKey, err := address.LengthPrefix(tt.addr) if tt.expErr { diff --git a/types/address_test.go b/types/address_test.go index 61bf36318e..cbd09dbfa6 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -392,7 +392,6 @@ func (s *addressTestSuite) TestBech32ifyAddressBytes() { {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { - tt := tt s.T().Run(tt.name, func(t *testing.T) { got, err := types.Bech32ifyAddressBytes(tt.args.prefix, tt.args.bs) if (err != nil) != tt.wantErr { @@ -425,7 +424,6 @@ func (s *addressTestSuite) TestMustBech32ifyAddressBytes() { {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { - tt := tt s.T().Run(tt.name, func(t *testing.T) { if tt.wantPanic { require.Panics(t, func() { types.MustBech32ifyAddressBytes(tt.args.prefix, tt.args.bs) }) diff --git a/types/coin_test.go b/types/coin_test.go index 4af7a46e00..d64a51131c 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -135,7 +135,6 @@ func (s *coinTestSuite) TestAddCoin() { } for tcIndex, tc := range cases { - tc := tc if tc.shouldPanic { s.Require().Panics(func() { tc.inputOne.Add(tc.inputTwo) }) } else { @@ -175,7 +174,6 @@ func (s *coinTestSuite) TestSubCoin() { } for tcIndex, tc := range cases { - tc := tc if tc.shouldPanic { s.Require().Panics(func() { tc.inputOne.Sub(tc.inputTwo) }) } else { @@ -230,7 +228,6 @@ func (s *coinTestSuite) TestIsGTECoin() { } for tcIndex, tc := range cases { - tc := tc if tc.panics { s.Require().Panics(func() { tc.inputOne.IsGTE(tc.inputTwo) }) } else { @@ -256,7 +253,6 @@ func (s *coinTestSuite) TestIsLTCoin() { } for tcIndex, tc := range cases { - tc := tc if tc.panics { s.Require().Panics(func() { tc.inputOne.IsLT(tc.inputTwo) }) } else { @@ -485,7 +481,6 @@ func (s *coinTestSuite) TestSubCoins() { assert := s.Assert() for i, tc := range testCases { - tc := tc if tc.shouldPanic { assert.Panics(func() { tc.inputOne.Sub(tc.inputTwo) }) } else { @@ -1065,7 +1060,6 @@ func (s *coinTestSuite) TestCoinValidate() { } for _, tc := range testCases { - tc := tc t := s.T() t.Run(tc.name, func(t *testing.T) { err := tc.coin.Validate() diff --git a/types/context_test.go b/types/context_test.go index 5688cfe61f..4530cf92eb 100644 --- a/types/context_test.go +++ b/types/context_test.go @@ -191,7 +191,6 @@ func (s *contextTestSuite) TestContextHeaderClone() { } for name, tc := range cases { - tc := tc s.T().Run(name, func(t *testing.T) { ctx := types.NewContext(nil, tc.h, false, nil) s.Require().Equal(tc.h.Height, ctx.BlockHeight()) diff --git a/types/dec_coin_test.go b/types/dec_coin_test.go index 71673f9815..bb9addef5e 100644 --- a/types/dec_coin_test.go +++ b/types/dec_coin_test.go @@ -187,7 +187,6 @@ func (s *decCoinTestSuite) TestIsValid() { } for _, tc := range tests { - tc := tc if tc.expectPass { s.Require().True(tc.coin.IsValid(), tc.msg) } else { @@ -222,7 +221,6 @@ func (s *decCoinTestSuite) TestSubDecCoin() { decCoin := sdk.NewDecCoin("mytoken", sdk.NewInt(10)) for _, tc := range tests { - tc := tc if tc.expectPass { equal := tc.coin.Sub(decCoin) s.Require().Equal(equal, decCoin, tc.msg) @@ -258,7 +256,6 @@ func (s *decCoinTestSuite) TestSubDecCoins() { decCoins := sdk.NewDecCoinsFromCoins(sdk.NewCoin("btc", sdk.NewInt(10)), sdk.NewCoin("eth", sdk.NewInt(15)), sdk.NewCoin("mytoken", sdk.NewInt(5))) for _, tc := range tests { - tc := tc if tc.expectPass { equal := tc.coins.Sub(decCoins) s.Require().Equal(equal, decCoins, tc.msg) @@ -500,7 +497,6 @@ func (s *decCoinTestSuite) TestDecCoinsQuoDecTruncate() { } for i, tc := range testCases { - tc := tc if tc.panics { s.Require().Panics(func() { tc.coins.QuoDecTruncate(tc.input) }) } else { @@ -537,7 +533,6 @@ func (s *decCoinTestSuite) TestNewDecCoinsWithIsValid() { } for _, tc := range tests { - tc := tc if tc.expectPass { s.Require().True(tc.coin.IsValid(), tc.msg) } else { @@ -564,7 +559,6 @@ func (s *decCoinTestSuite) TestNewDecCoinsWithZeroCoins() { } for _, tc := range tests { - tc := tc s.Require().Equal(sdk.NewDecCoinsFromCoins(tc.coins...).Len(), tc.expectLength) } } @@ -596,7 +590,6 @@ func (s *decCoinTestSuite) TestDecCoins_AddDecCoinWithIsValid() { } for _, tc := range tests { - tc := tc if tc.expectPass { s.Require().True(tc.coin.IsValid(), tc.msg) } else { diff --git a/types/decimal_internal_test.go b/types/decimal_internal_test.go index 9aa31affe1..23805998b1 100644 --- a/types/decimal_internal_test.go +++ b/types/decimal_internal_test.go @@ -67,7 +67,6 @@ func (s *decimalInternalTestSuite) TestDecMarshalJSON() { {"12340Int", NewDec(12340), "\"12340.000000000000000000\"", false}, } for _, tt := range tests { - tt := tt s.T().Run(tt.name, func(t *testing.T) { got, err := tt.d.MarshalJSON() if (err != nil) != tt.wantErr { diff --git a/types/decimal_test.go b/types/decimal_test.go index 6c1e50ab4d..8c49a3c066 100644 --- a/types/decimal_test.go +++ b/types/decimal_test.go @@ -236,7 +236,6 @@ func (s *decimalTestSuite) TestArithmetic() { } for tcIndex, tc := range tests { - tc := tc resAdd := tc.d1.Add(tc.d2) resSub := tc.d1.Sub(tc.d2) resMul := tc.d1.Mul(tc.d2) diff --git a/types/errors/abci_test.go b/types/errors/abci_test.go index 13e7c8455c..c886e3917c 100644 --- a/types/errors/abci_test.go +++ b/types/errors/abci_test.go @@ -181,7 +181,6 @@ func (s *abciTestSuite) TestABCIInfoSerializeErr() { }, } for msg, spec := range specs { - spec := spec _, _, log := ABCIInfo(spec.src, spec.debug) s.Require().Equal(spec.exp, log, msg) } diff --git a/types/events_test.go b/types/events_test.go index 45513e6fd9..334846981e 100644 --- a/types/events_test.go +++ b/types/events_test.go @@ -247,7 +247,6 @@ func (s *eventsTestSuite) TestMarkEventsToIndex() { } for name, tc := range testCases { - tc := tc s.T().Run(name, func(_ *testing.T) { s.Require().Equal(tc.expected, sdk.MarkEventsToIndex(tc.events, tc.indexSet)) }) diff --git a/types/int_test.go b/types/int_test.go index bdf7a62eca..59513f258c 100644 --- a/types/int_test.go +++ b/types/int_test.go @@ -404,7 +404,6 @@ func TestRoundTripMarshalToInt(t *testing.T) { } for _, value := range values { - value := value t.Run(fmt.Sprintf("%d", value), func(t *testing.T) { t.Parallel() diff --git a/types/simulation/account_test.go b/types/simulation/account_test.go index 210a8b9c8b..fa3229ca14 100644 --- a/types/simulation/account_test.go +++ b/types/simulation/account_test.go @@ -24,7 +24,6 @@ func TestRandomAccounts(t *testing.T) { {"100-accounts", 100, 100}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got := simulation.RandomAccounts(r, tt.n) require.Equal(t, tt.want, len(got)) @@ -65,8 +64,6 @@ func TestRandomFees(t *testing.T) { {"0 coins", sdk.NewCoins(sdk.NewInt64Coin("aaa", 10), sdk.NewInt64Coin("bbb", 5)), false, false}, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { got, err := simulation.RandomFees(r, sdk.Context{}, tt.spendableCoins) if (err != nil) != tt.wantErr { diff --git a/types/simulation/rand_util_test.go b/types/simulation/rand_util_test.go index d46f481fda..860bfb172f 100644 --- a/types/simulation/rand_util_test.go +++ b/types/simulation/rand_util_test.go @@ -23,7 +23,6 @@ func TestRandSubsetCoins(t *testing.T) { {"seed=99", rand.New(rand.NewSource(99)), mustParseCoins("100stake,2testtoken")}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got := simulation.RandSubsetCoins(tt.r, tt.coins) gotStringRep := got.String() @@ -46,8 +45,6 @@ func TestRandStringOfLength(t *testing.T) { {"1_000_000-size", 1_000_000, 1_000_000}, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { got := simulation.RandStringOfLength(r, tt.n) require.Equal(t, tt.want, len(got)) diff --git a/types/uint_test.go b/types/uint_test.go index 796dd2b428..dd46e16ae9 100644 --- a/types/uint_test.go +++ b/types/uint_test.go @@ -216,7 +216,6 @@ func (s *uintTestSuite) TestSafeSub() { } for i, tc := range testCases { - tc := tc if tc.panic { s.Require().Panics(func() { tc.x.Sub(tc.y) }) continue @@ -304,7 +303,6 @@ func TestRoundTripMarshalToUint(t *testing.T) { } for _, value := range values { - value := value t.Run(fmt.Sprintf("%d", value), func(t *testing.T) { t.Parallel() diff --git a/types/utils_test.go b/types/utils_test.go index 253db8e696..391dc4eb71 100644 --- a/types/utils_test.go +++ b/types/utils_test.go @@ -54,7 +54,6 @@ func (s *utilsTestSuite) TestSortJSON() { } for tcIndex, tc := range cases { - tc := tc got, err := sdk.SortJSON([]byte(tc.unsortedJSON)) if tc.wantErr { s.Require().NotNil(err, "tc #%d", tcIndex) @@ -79,7 +78,6 @@ func (s *utilsTestSuite) TestTimeFormatAndParse() { {"2011-01-10T23:10:05.758230235Z", "2011-01-10T23:10:05.758230235", true}, } for _, tc := range cases { - tc := tc timeFromRFC, err := time.Parse(time.RFC3339Nano, tc.RFC3339NanoStr) s.Require().Nil(err) timeFromSDKFormat, err := time.Parse(sdk.SortableTimeFormat, tc.SDKSortableTimeStr) diff --git a/x/auth/ante/basic_test.go b/x/auth/ante/basic_test.go index 995b3efe9b..5ac84f506a 100644 --- a/x/auth/ante/basic_test.go +++ b/x/auth/ante/basic_test.go @@ -198,8 +198,6 @@ func (suite *AnteTestSuite) TestTxHeightTimeoutDecorator() { } for _, tc := range testCases { - tc := tc - suite.Run(tc.name, func() { suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 41a3a599fa..cfb94c0075 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -331,7 +331,6 @@ func (s *IntegrationTestSuite) TestCLIQueryTxCmdByHash() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := authcli.QueryTxCmd() clientCtx := val.ClientCtx @@ -447,7 +446,6 @@ func (s *IntegrationTestSuite) TestCLIQueryTxCmdByEvents() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := authcli.QueryTxCmd() clientCtx := val.ClientCtx @@ -526,7 +524,6 @@ func (s *IntegrationTestSuite) TestCLIQueryTxsCmdByEvents() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := authcli.QueryTxsByEventsCmd() clientCtx := val.ClientCtx @@ -1166,7 +1163,6 @@ func (s *IntegrationTestSuite) TestGetAccountCmd() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { clientCtx := val.ClientCtx @@ -1205,7 +1201,6 @@ func (s *IntegrationTestSuite) TestGetAccountsCmd() { } for name, tc := range testCases { - tc := tc s.Run(name, func() { cmd := authcli.GetAccountsCmd() clientCtx := val.ClientCtx @@ -1245,7 +1240,6 @@ func (s *IntegrationTestSuite) TestQueryModuleAccountByNameCmd() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { clientCtx := val.ClientCtx @@ -1335,7 +1329,6 @@ func (s *IntegrationTestSuite) TestQueryParamsCmd() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := authcli.QueryParamsCmd() clientCtx := val.ClientCtx diff --git a/x/auth/client/tx_test.go b/x/auth/client/tx_test.go index de086fe19b..b5ce931db6 100644 --- a/x/auth/client/tx_test.go +++ b/x/auth/client/tx_test.go @@ -123,7 +123,6 @@ func TestBatchScanner_Scan(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { scanner, i := authclient.NewBatchScanner(clientCtx.TxConfig, strings.NewReader(tt.batch)), 0 for scanner.Scan() { diff --git a/x/auth/legacy/v043/store_test.go b/x/auth/legacy/v043/store_test.go index 2d72024791..1ed227a9d7 100644 --- a/x/auth/legacy/v043/store_test.go +++ b/x/auth/legacy/v043/store_test.go @@ -537,7 +537,6 @@ func TestMigrateVestingAccounts(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{ diff --git a/x/auth/simulation/decoder_test.go b/x/auth/simulation/decoder_test.go index d4a5bc353a..7b8bcee89c 100644 --- a/x/auth/simulation/decoder_test.go +++ b/x/auth/simulation/decoder_test.go @@ -57,7 +57,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/auth/tx/encode_decode_test.go b/x/auth/tx/encode_decode_test.go index 9c546cdb5e..4eab9a3fed 100644 --- a/x/auth/tx/encode_decode_test.go +++ b/x/auth/tx/encode_decode_test.go @@ -101,7 +101,6 @@ func TestUnknownFields(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { bodyBz, err := tt.body.Marshal() require.NoError(t, err) @@ -244,7 +243,6 @@ func TestRejectNonADR027(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { _, err = decoder(tt.txBz) if tt.shouldErr { @@ -282,7 +280,6 @@ func TestVarintMinLength(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(fmt.Sprintf("test %d", tt.n), func(t *testing.T) { l1 := varintMinLength(tt.n) buf := make([]byte, binary.MaxVarintLen64) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index 8089f74fee..0b65b2d2cd 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -135,7 +135,6 @@ func (s *IntegrationTestSuite) 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). @@ -457,7 +456,6 @@ func (s *IntegrationTestSuite) 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). diff --git a/x/auth/types/account_test.go b/x/auth/types/account_test.go index a90a633051..8f4b1cc9af 100644 --- a/x/auth/types/account_test.go +++ b/x/auth/types/account_test.go @@ -104,8 +104,6 @@ func TestGenesisAccountValidate(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.expErr, tt.acc.Validate() != nil) }) @@ -170,7 +168,6 @@ func TestValidate(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { err := tt.acc.Validate() require.Equal(t, tt.expErr, err) diff --git a/x/auth/types/params_test.go b/x/auth/types/params_test.go index b4bbce8ba0..aeb5c48d6a 100644 --- a/x/auth/types/params_test.go +++ b/x/auth/types/params_test.go @@ -37,7 +37,6 @@ func TestParams_Validate(t *testing.T) { types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1), fmt.Errorf("invalid tx size cost per byte: 0")}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { got := tt.params.Validate() if tt.wantErr == nil { diff --git a/x/auth/types/permissions_test.go b/x/auth/types/permissions_test.go index de5c256457..78133007da 100644 --- a/x/auth/types/permissions_test.go +++ b/x/auth/types/permissions_test.go @@ -41,7 +41,6 @@ func TestValidatePermissions(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc t.Run(tc.name, func(t *testing.T) { err := validatePermissions(tc.permissions...) if tc.expectPass { diff --git a/x/auth/vesting/client/testutil/suite.go b/x/auth/vesting/client/testutil/suite.go index 7f8be8d668..a486b5ee84 100644 --- a/x/auth/vesting/client/testutil/suite.go +++ b/x/auth/vesting/client/testutil/suite.go @@ -112,8 +112,6 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { clientCtx := val.ClientCtx diff --git a/x/auth/vesting/handler_test.go b/x/auth/vesting/handler_test.go index 9bd3c2ca6b..ceaa19e6e9 100644 --- a/x/auth/vesting/handler_test.go +++ b/x/auth/vesting/handler_test.go @@ -62,8 +62,6 @@ func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() { } for _, tc := range testCases { - tc := tc - suite.Run(tc.name, func() { res, err := suite.handler(ctx, tc.msg) if tc.expectErr { diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 26cbbcdeb7..40e48bbf4c 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -728,8 +728,6 @@ func TestGenesisAccountValidate(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.expErr, tt.acc.Validate() != nil) }) diff --git a/x/authz/client/testutil/grpc.go b/x/authz/client/testutil/grpc.go index 7b5bbb6adf..43cbca59cd 100644 --- a/x/authz/client/testutil/grpc.go +++ b/x/authz/client/testutil/grpc.go @@ -60,7 +60,6 @@ func (s *IntegrationTestSuite) TestQueryGrantGRPC() { }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, _ := rest.GetRequest(tc.url) require := s.Require() @@ -146,7 +145,6 @@ func (s *IntegrationTestSuite) TestQueryGrantsGRPC() { }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { tc.preRun() resp, _ := rest.GetRequest(tc.url) diff --git a/x/authz/client/testutil/query.go b/x/authz/client/testutil/query.go index 07ffb10315..698c832d6d 100644 --- a/x/authz/client/testutil/query.go +++ b/x/authz/client/testutil/query.go @@ -73,8 +73,6 @@ func (s *IntegrationTestSuite) TestQueryAuthorizations() { }, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryGrants() clientCtx := val.ClientCtx @@ -165,8 +163,6 @@ func (s *IntegrationTestSuite) TestQueryAuthorization() { }, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryGrants() clientCtx := val.ClientCtx diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index fdf3d150b4..831e26e6d8 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -311,7 +311,6 @@ func (s *IntegrationTestSuite) TestCLITxGrantAuthorization() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { clientCtx := val.ClientCtx out, err := ExecGrant( @@ -464,7 +463,6 @@ func (s *IntegrationTestSuite) TestCmdRevokeAuthorizations() { }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdRevokeAuthorization() clientCtx := val.ClientCtx @@ -606,7 +604,6 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx @@ -691,7 +688,6 @@ func (s *IntegrationTestSuite) TestNewExecGrantAuthorized() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx @@ -787,7 +783,6 @@ func (s *IntegrationTestSuite) TestExecDelegateAuthorization() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx @@ -864,7 +859,6 @@ func (s *IntegrationTestSuite) TestExecDelegateAuthorization() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx @@ -1008,7 +1002,6 @@ func (s *IntegrationTestSuite) TestExecUndelegateAuthorization() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx @@ -1087,7 +1080,6 @@ func (s *IntegrationTestSuite) TestExecUndelegateAuthorization() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdExecAuthorization() clientCtx := val.ClientCtx diff --git a/x/authz/keeper/grpc_query_test.go b/x/authz/keeper/grpc_query_test.go index efc5b1226a..a65c48e83b 100644 --- a/x/authz/keeper/grpc_query_test.go +++ b/x/authz/keeper/grpc_query_test.go @@ -228,8 +228,6 @@ func (suite *TestSuite) TestGRPCQueryGranterGrants() { } for _, tc := range testCases { - tc := tc - suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { tc.preRun() result, err := queryClient.GranterGrants(gocontext.Background(), &tc.request) @@ -315,8 +313,6 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { } for _, tc := range testCases { - tc := tc - suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { tc.preRun() result, err := queryClient.GranteeGrants(gocontext.Background(), &tc.request) diff --git a/x/authz/simulation/decoder_test.go b/x/authz/simulation/decoder_test.go index fc43ef917d..244a9722c4 100644 --- a/x/authz/simulation/decoder_test.go +++ b/x/authz/simulation/decoder_test.go @@ -41,7 +41,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { if tt.expectErr { require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) diff --git a/x/bank/client/testutil/grpc.go b/x/bank/client/testutil/grpc.go index 3d9651eff9..d3b418dc27 100644 --- a/x/bank/client/testutil/grpc.go +++ b/x/bank/client/testutil/grpc.go @@ -88,7 +88,6 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) @@ -209,7 +208,6 @@ func (s *IntegrationTestSuite) TestDenomMetadataGRPCHandler() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) @@ -273,7 +271,6 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) diff --git a/x/bank/client/testutil/suite.go b/x/bank/client/testutil/suite.go index 6358107cdf..abab55d41c 100644 --- a/x/bank/client/testutil/suite.go +++ b/x/bank/client/testutil/suite.go @@ -145,8 +145,6 @@ func (s *IntegrationTestSuite) TestGetBalancesCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetBalancesCmd() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) @@ -225,8 +223,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTotalSupply() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryTotalSupply() clientCtx := val.ClientCtx @@ -367,8 +363,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryDenomsMetadata() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdDenomsMetadata() clientCtx := val.ClientCtx @@ -475,8 +469,6 @@ func (s *IntegrationTestSuite) TestNewSendTxCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { clientCtx := val.ClientCtx diff --git a/x/bank/keeper/genesis_test.go b/x/bank/keeper/genesis_test.go index 4c5c6ea86b..36aee9a1a9 100644 --- a/x/bank/keeper/genesis_test.go +++ b/x/bank/keeper/genesis_test.go @@ -99,7 +99,6 @@ func (suite *IntegrationTestSuite) TestTotalSupply() { } for _, tc := range testcases { - tc := tc suite.Run(tc.name, func() { if tc.expPanic { suite.PanicsWithError(tc.expPanicMsg, func() { suite.app.BankKeeper.InitGenesis(suite.ctx, tc.genesis) }) diff --git a/x/bank/simulation/genesis_test.go b/x/bank/simulation/genesis_test.go index 40d9afe119..efbdf4cf42 100644 --- a/x/bank/simulation/genesis_test.go +++ b/x/bank/simulation/genesis_test.go @@ -70,8 +70,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/bank/types/balance_test.go b/x/bank/types/balance_test.go index b18a0f7b13..7080371306 100644 --- a/x/bank/types/balance_test.go +++ b/x/bank/types/balance_test.go @@ -102,7 +102,6 @@ func TestBalanceValidate(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { err := tc.balance.Validate() @@ -126,7 +125,6 @@ func TestBalance_GetAddress(t *testing.T) { {"valid address", "link1vy0ga0klndqy92ceqehfkvgmn4t94ete4mhemy", false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { b := bank.Balance{Address: tt.Address} if tt.wantPanic { diff --git a/x/bank/types/genesis_test.go b/x/bank/types/genesis_test.go index d5588245b2..637306464a 100644 --- a/x/bank/types/genesis_test.go +++ b/x/bank/types/genesis_test.go @@ -143,7 +143,6 @@ func TestGenesisStateValidate(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { err := tc.genesisState.Validate() diff --git a/x/bank/types/key_test.go b/x/bank/types/key_test.go index 54a2ee64a9..193001f4f5 100644 --- a/x/bank/types/key_test.go +++ b/x/bank/types/key_test.go @@ -39,7 +39,6 @@ func TestAddressFromBalancesStore(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() addr, err := types.AddressFromBalancesStore(tc.key) diff --git a/x/bank/types/metadata_test.go b/x/bank/types/metadata_test.go index 1201e0473b..d895a0226d 100644 --- a/x/bank/types/metadata_test.go +++ b/x/bank/types/metadata_test.go @@ -216,7 +216,6 @@ func TestMetadataValidate(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { err := tc.metadata.Validate() @@ -258,7 +257,6 @@ func TestMarshalJSONMetaData(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { bz, err := cdc.MarshalJSON(tc.input) require.NoError(t, err) diff --git a/x/bank/types/params_test.go b/x/bank/types/params_test.go index 0962d125c1..1ca04f6474 100644 --- a/x/bank/types/params_test.go +++ b/x/bank/types/params_test.go @@ -29,7 +29,6 @@ func Test_validateSendEnabledParam(t *testing.T) { {"invalid denom send disabled", args{*NewSendEnabled("0FOO", false)}, true}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.wantErr, validateSendEnabled(tt.args.i) != nil) }) diff --git a/x/bankplus/keeper/keeper_test.go b/x/bankplus/keeper/keeper_test.go index 3486106a61..37f271d7c7 100644 --- a/x/bankplus/keeper/keeper_test.go +++ b/x/bankplus/keeper/keeper_test.go @@ -294,7 +294,6 @@ func (suite *IntegrationTestSuite) TestInputOutputCoins() { } for name, tc := range tcs { - tc := tc suite.T().Run(name, func(t *testing.T) { if tc.err != nil { suite.EqualError(targetKeeper(tc.deactMultiSend).InputOutputCoins(ctx, input, output), tc.err.Error()) diff --git a/x/capability/simulation/decoder_test.go b/x/capability/simulation/decoder_test.go index d12e8b5044..ce87e508e6 100644 --- a/x/capability/simulation/decoder_test.go +++ b/x/capability/simulation/decoder_test.go @@ -47,7 +47,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/capability/simulation/genesis_test.go b/x/capability/simulation/genesis_test.go index ab49833f1d..46b2687b50 100644 --- a/x/capability/simulation/genesis_test.go +++ b/x/capability/simulation/genesis_test.go @@ -66,8 +66,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/capability/types/genesis_test.go b/x/capability/types/genesis_test.go index 5208a2b590..41525fb827 100644 --- a/x/capability/types/genesis_test.go +++ b/x/capability/types/genesis_test.go @@ -112,7 +112,6 @@ func TestValidateGenesis(t *testing.T) { } for _, tc := range testCases { - tc := tc genState := DefaultGenesis() tc.malleate(genState) err := genState.Validate() diff --git a/x/collection/client/testutil/query.go b/x/collection/client/testutil/query.go index 0ca3c830b0..4c01a95320 100644 --- a/x/collection/client/testutil/query.go +++ b/x/collection/client/testutil/query.go @@ -65,8 +65,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdBalance() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdBalances() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -141,8 +139,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdFTSupply() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdFTSupply() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -217,8 +213,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdFTMinted() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdFTMinted() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -293,8 +287,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdFTBurnt() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdFTBurnt() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -368,8 +360,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdNFTSupply() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdNFTSupply() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -443,8 +433,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdNFTMinted() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdNFTMinted() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -518,8 +506,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdNFTBurnt() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdNFTBurnt() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -573,8 +559,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdContract() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdContract() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -643,8 +627,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdTokenType() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdTokenType() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -719,8 +701,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdToken() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdToken() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -793,8 +773,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdRoot() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdRoot() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -865,8 +843,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdParent() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdParent() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -941,8 +917,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdChildren() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdChildren() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1020,8 +994,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdGranteeGrants() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdGranteeGrants() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1082,8 +1054,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdIsOperatorFor() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdIsOperatorFor() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1142,8 +1112,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdHoldersByOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdHoldersByOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/collection/client/testutil/tx.go b/x/collection/client/testutil/tx.go index a0aee34cde..b7c18d0e0a 100644 --- a/x/collection/client/testutil/tx.go +++ b/x/collection/client/testutil/tx.go @@ -71,8 +71,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdSendFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdSendFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -155,8 +153,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorSendFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorSendFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -234,8 +230,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdSendNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdSendNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -318,8 +312,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorSendNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorSendNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -374,8 +366,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdCreateContract() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdCreateContract() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -441,8 +431,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdIssueFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdIssueFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -502,8 +490,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdIssueNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdIssueNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -575,8 +561,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdMintFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdMintFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -645,8 +629,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdMintNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdMintNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -711,8 +693,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdBurnFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdBurnFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -781,8 +761,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorBurnFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorBurnFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -847,8 +825,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdBurnNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdBurnNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -917,8 +893,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorOperatorBurnNFT() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorBurnNFT() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -994,8 +968,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdModify() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdModify() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1065,8 +1037,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdAttach() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdAttach() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1131,8 +1101,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdDetach() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdDetach() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1206,8 +1174,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorAttach() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorAttach() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1276,8 +1242,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorDetach() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorDetach() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1336,8 +1300,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdGrantPermission() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdGrantPermission() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1393,8 +1355,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdRevokePermission() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdRevokePermission() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1450,8 +1410,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdAuthorizeOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdAuthorizeOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -1507,8 +1465,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdRevokeOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdRevokeOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/collection/msgs_test.go b/x/collection/msgs_test.go index 04de79a91c..3a094d899d 100644 --- a/x/collection/msgs_test.go +++ b/x/collection/msgs_test.go @@ -2067,7 +2067,6 @@ func TestAminoJSON(t *testing.T) { } for name, tc := range testCase { - tc := tc t.Run(name, func(t *testing.T) { tx.Msgs = []sdk.Msg{tc.msg} require.Equal(t, collection.RouterKey, tc.msg.Route()) diff --git a/x/crisis/client/testsuite/suite.go b/x/crisis/client/testsuite/suite.go index 8ac29d8ad3..75c06177c4 100644 --- a/x/crisis/client/testsuite/suite.go +++ b/x/crisis/client/testsuite/suite.go @@ -83,8 +83,6 @@ func (s *IntegrationTestSuite) TestNewMsgVerifyInvariantTxCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewMsgVerifyInvariantTxCmd() clientCtx := val.ClientCtx diff --git a/x/crisis/handler_test.go b/x/crisis/handler_test.go index c174ce536c..dc646d5338 100644 --- a/x/crisis/handler_test.go +++ b/x/crisis/handler_test.go @@ -58,7 +58,6 @@ func TestHandleMsgVerifyInvariant(t *testing.T) { } for _, tc := range cases { - tc := tc t.Run(tc.name, func(t *testing.T) { h := crisis.NewHandler(app.CrisisKeeper) diff --git a/x/distribution/client/common/common_test.go b/x/distribution/client/common/common_test.go index f81db2b6d4..168cb16fd5 100644 --- a/x/distribution/client/common/common_test.go +++ b/x/distribution/client/common/common_test.go @@ -30,7 +30,6 @@ func TestQueryDelegationRewardsAddrValidation(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { _, _, err := QueryDelegationRewards(clientCtx, tt.args.delAddr, tt.args.valAddr) require.True(t, err != nil, tt.wantErr) diff --git a/x/distribution/client/testutil/grpc.go b/x/distribution/client/testutil/grpc.go index 76fc652c15..ceaf4627a1 100644 --- a/x/distribution/client/testutil/grpc.go +++ b/x/distribution/client/testutil/grpc.go @@ -56,7 +56,6 @@ func (s *GRPCQueryTestSuite) TestQueryParamsGRPC() { } for _, tc := range testCases { - tc := tc resp, err := rest.GetRequest(tc.url) s.Run(tc.name, func() { s.Require().NoError(err) @@ -106,7 +105,6 @@ func (s *GRPCQueryTestSuite) TestQueryOutstandingRewardsGRPC() { } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { if tc.expErr { @@ -160,7 +158,6 @@ func (s *GRPCQueryTestSuite) TestQueryValidatorCommissionGRPC() { } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { if tc.expErr { @@ -218,7 +215,6 @@ func (s *GRPCQueryTestSuite) TestQuerySlashesGRPC() { } for _, tc := range testCases { - tc := tc resp, err := rest.GetRequest(tc.url) s.Run(tc.name, func() { @@ -294,7 +290,6 @@ func (s *GRPCQueryTestSuite) TestQueryDelegatorRewardsGRPC() { } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { @@ -346,7 +341,6 @@ func (s *GRPCQueryTestSuite) TestQueryDelegatorValidatorsGRPC() { } for _, tc := range testCases { - tc := tc resp, err := rest.GetRequest(tc.url) s.Run(tc.name, func() { @@ -398,7 +392,6 @@ func (s *GRPCQueryTestSuite) TestQueryWithdrawAddressGRPC() { } for _, tc := range testCases { - tc := tc resp, err := rest.GetRequest(tc.url) s.Run(tc.name, func() { @@ -443,7 +436,6 @@ func (s *GRPCQueryTestSuite) TestQueryValidatorCommunityPoolGRPC() { } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { diff --git a/x/distribution/client/testutil/suite.go b/x/distribution/client/testutil/suite.go index 4f9513580a..1e10b432be 100644 --- a/x/distribution/client/testutil/suite.go +++ b/x/distribution/client/testutil/suite.go @@ -86,8 +86,6 @@ withdraw_addr_enabled: true`, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryParams() clientCtx := val.ClientCtx @@ -145,8 +143,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorOutstandingRewards() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidatorOutstandingRewards() clientCtx := val.ClientCtx @@ -208,8 +204,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorCommission() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidatorCommission() clientCtx := val.ClientCtx @@ -287,8 +281,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorSlashes() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidatorSlashes() clientCtx := val.ClientCtx @@ -388,8 +380,6 @@ total: } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryDelegatorRewards() clientCtx := val.ClientCtx @@ -431,8 +421,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryCommunityPool() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryCommunityPool() clientCtx := val.ClientCtx @@ -492,8 +480,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { clientCtx := val.ClientCtx @@ -544,8 +530,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewWithdrawAllRewardsCmd() clientCtx := val.ClientCtx @@ -599,8 +583,6 @@ func (s *IntegrationTestSuite) TestNewSetWithdrawAddrCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewSetWithdrawAddrCmd() clientCtx := val.ClientCtx @@ -654,8 +636,6 @@ func (s *IntegrationTestSuite) TestNewFundCommunityPoolCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewFundCommunityPoolCmd() clientCtx := val.ClientCtx @@ -727,8 +707,6 @@ func (s *IntegrationTestSuite) TestGetCmdSubmitProposal() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdSubmitProposal() clientCtx := val.ClientCtx diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 62bc93f4bf..28c8e7869c 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -142,7 +142,7 @@ func TestAllocateTokensTruncation(t *testing.T) { Address: valConsPk2.Address(), Power: 10, } - abciValС := abci.Validator{ + abciValC := abci.Validator{ Address: valConsPk3.Address(), Power: 10, } @@ -177,7 +177,7 @@ func TestAllocateTokensTruncation(t *testing.T) { SignedLastBlock: true, }, { - Validator: abciValС, + Validator: abciValC, SignedLastBlock: true, }, } diff --git a/x/distribution/legacy/v043/store_test.go b/x/distribution/legacy/v043/store_test.go index fff87528a9..4c8ff1d522 100644 --- a/x/distribution/legacy/v043/store_test.go +++ b/x/distribution/legacy/v043/store_test.go @@ -88,7 +88,6 @@ func TestStoreMigration(t *testing.T) { // Make sure the new keys are set and old keys are deleted. for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { if !bytes.Equal(tc.oldKey, tc.newKey) { require.Nil(t, store.Get(tc.oldKey)) diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index f37bb4fab8..841aaf5f17 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -66,7 +66,6 @@ func TestDecodeDistributionStore(t *testing.T) { {"other", ""}, } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/distribution/simulation/genesis_test.go b/x/distribution/simulation/genesis_test.go index 8db6652da6..1724ef5fa9 100644 --- a/x/distribution/simulation/genesis_test.go +++ b/x/distribution/simulation/genesis_test.go @@ -76,8 +76,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/distribution/types/params_internal_test.go b/x/distribution/types/params_internal_test.go index 234a79fbd1..152845f00c 100644 --- a/x/distribution/types/params_internal_test.go +++ b/x/distribution/types/params_internal_test.go @@ -24,7 +24,6 @@ func Test_validateAuxFuncs(t *testing.T) { {"two dec", args{sdk.NewDec(2)}, true}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.wantErr, validateCommunityTax(tt.args.i) != nil) require.Equal(t, tt.wantErr, validateBaseProposerReward(tt.args.i) != nil) diff --git a/x/evidence/client/testutil/suite.go b/x/evidence/client/testutil/suite.go index 3fdba740e9..80e2ce89b4 100644 --- a/x/evidence/client/testutil/suite.go +++ b/x/evidence/client/testutil/suite.go @@ -56,8 +56,6 @@ func (s *IntegrationTestSuite) TestGetQueryCmd() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.GetQueryCmd() clientCtx := val.ClientCtx diff --git a/x/evidence/simulation/decoder_test.go b/x/evidence/simulation/decoder_test.go index 3e18656b6c..eeca030223 100644 --- a/x/evidence/simulation/decoder_test.go +++ b/x/evidence/simulation/decoder_test.go @@ -52,7 +52,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/evidence/types/evidence_test.go b/x/evidence/types/evidence_test.go index 696600d0ad..c7a0be8e53 100644 --- a/x/evidence/types/evidence_test.go +++ b/x/evidence/types/evidence_test.go @@ -52,7 +52,6 @@ func TestEquivocationValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { require.Equal(t, tc.expectErr, tc.e.ValidateBasic() != nil) }) diff --git a/x/fbridge/types/msgs_test.go b/x/fbridge/types/msgs_test.go index 87166e0ad4..b339c7d592 100644 --- a/x/fbridge/types/msgs_test.go +++ b/x/fbridge/types/msgs_test.go @@ -137,7 +137,6 @@ func TestAminoJSON(t *testing.T) { } for name, tc := range testCase { - tc := tc t.Run(name, func(t *testing.T) { tx.Msgs = []sdk.Msg{tc.msg} require.Equal(t, fbridgetypes.RouterKey, tc.msg.Route()) diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index cac943e7b7..3e75a99d2d 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -168,8 +168,6 @@ func (s *IntegrationTestSuite) TestCmdGetFeeGrant() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryFeeGrant() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -234,8 +232,6 @@ func (s *IntegrationTestSuite) TestCmdGetFeeGrantsByGrantee() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryFeeGrantsByGrantee() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -290,8 +286,6 @@ func (s *IntegrationTestSuite) TestCmdGetFeeGrantsByGranter() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryFeeGrantsByGranter() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -583,8 +577,6 @@ func (s *IntegrationTestSuite) TestNewCmdFeeGrant() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewCmdFeeGrant() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -690,8 +682,6 @@ func (s *IntegrationTestSuite) TestNewCmdRevokeFeegrant() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewCmdRevokeFeegrant() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -829,8 +819,6 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewCmdFeeGrant() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -924,8 +912,6 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { } for _, tc := range cases { - tc := tc - s.Run(tc.name, func() { out, err := tc.malleate() s.Require().NoError(err) diff --git a/x/feegrant/grant_test.go b/x/feegrant/grant_test.go index 2368c77d3d..af0f1873c9 100644 --- a/x/feegrant/grant_test.go +++ b/x/feegrant/grant_test.go @@ -73,7 +73,6 @@ func TestGrant(t *testing.T) { } for name, tc := range cases { - tc := tc t.Run(name, func(t *testing.T) { grant, err := feegrant.NewGrant(tc.granter, tc.grantee, &feegrant.BasicAllowance{ SpendLimit: tc.limit, diff --git a/x/feegrant/keeper/genesis_test.go b/x/feegrant/keeper/genesis_test.go index ea2731cb4b..9f659bf30c 100644 --- a/x/feegrant/keeper/genesis_test.go +++ b/x/feegrant/keeper/genesis_test.go @@ -100,7 +100,6 @@ func (suite *GenesisTestSuite) TestInitGenesis() { } for _, tc := range testCases { - tc := tc suite.Run(tc.name, func() { err := suite.keeper.InitGenesis(suite.ctx, &feegrant.GenesisState{Allowances: tc.feeAllowances}) suite.Require().Error(err) diff --git a/x/feegrant/keeper/keeper_test.go b/x/feegrant/keeper/keeper_test.go index 5851f8e978..b6f843a6c7 100644 --- a/x/feegrant/keeper/keeper_test.go +++ b/x/feegrant/keeper/keeper_test.go @@ -120,7 +120,6 @@ func (suite *KeeperTestSuite) TestKeeperCrud() { } for name, tc := range cases { - tc := tc suite.Run(name, func() { allow, _ := suite.keeper.GetAllowance(suite.sdkCtx, tc.granter, tc.grantee) @@ -196,7 +195,6 @@ func (suite *KeeperTestSuite) TestUseGrantedFee() { } for name, tc := range cases { - tc := tc suite.Run(name, func() { err := suite.keeper.GrantAllowance(suite.sdkCtx, suite.addrs[0], suite.addrs[1], future) suite.Require().NoError(err) diff --git a/x/feegrant/simulation/decoder_test.go b/x/feegrant/simulation/decoder_test.go index 989387f831..c13e75111f 100644 --- a/x/feegrant/simulation/decoder_test.go +++ b/x/feegrant/simulation/decoder_test.go @@ -49,7 +49,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/feegrant/types/grant_test.go b/x/feegrant/types/grant_test.go index 687fe37351..2831eb09ec 100644 --- a/x/feegrant/types/grant_test.go +++ b/x/feegrant/types/grant_test.go @@ -71,7 +71,6 @@ func TestGrant(t *testing.T) { } for name, tc := range cases { - tc := tc t.Run(name, func(t *testing.T) { grant, err := feegrant.NewGrant(tc.granter, tc.grantee, &feegrant.BasicAllowance{ SpendLimit: tc.limit, diff --git a/x/foundation/client/testutil/grpc.go b/x/foundation/client/testutil/grpc.go index 7f16e5675f..b0103983ef 100644 --- a/x/foundation/client/testutil/grpc.go +++ b/x/foundation/client/testutil/grpc.go @@ -34,7 +34,6 @@ func (s *IntegrationTestSuite) TestGRPCParams() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) diff --git a/x/foundation/client/testutil/query.go b/x/foundation/client/testutil/query.go index a7d16e38d2..0703d382ee 100644 --- a/x/foundation/client/testutil/query.go +++ b/x/foundation/client/testutil/query.go @@ -44,8 +44,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdParams() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdParams() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -86,8 +84,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdTreasury() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdTreasury() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -127,8 +123,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdFoundationInfo() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdFoundationInfo() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -184,8 +178,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdMember() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdMember() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -226,8 +218,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdMembers() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdMembers() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -276,8 +266,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdProposal() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdProposal() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -317,8 +305,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdProposals() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdProposals() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -377,8 +363,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdVote() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdVote() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -427,8 +411,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdVotes() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdVotes() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -477,8 +459,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdTallyResult() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdTallyResult() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -521,8 +501,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdCensorships() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdCensorships() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -586,8 +564,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdGrants() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdGrants() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/foundation/client/testutil/tx.go b/x/foundation/client/testutil/tx.go index ccc283cb8c..b73acc158e 100644 --- a/x/foundation/client/testutil/tx.go +++ b/x/foundation/client/testutil/tx.go @@ -44,8 +44,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdFundTreasury() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdFundTreasury() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -92,8 +90,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdWithdrawFromTreasury() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdWithdrawFromTreasury() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -138,8 +134,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdUpdateMembers() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdUpdateMembers() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -198,8 +192,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdUpdateDecisionPolicy() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdUpdateDecisionPolicy() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -249,8 +241,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdSubmitProposal() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdSubmitProposal() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -299,8 +289,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdWithdrawProposal() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdWithdrawProposal() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -353,8 +341,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdVote() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdVote() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -402,8 +388,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdExec() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdExec() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -466,8 +450,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdUpdateCensorship() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdUpdateCensorship() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -512,8 +494,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdLeaveFoundation() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdLeaveFoundation() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -565,8 +545,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdGrant() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdGrant() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -612,8 +590,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdRevoke() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdRevoke() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/foundation/genesis_test.go b/x/foundation/genesis_test.go index ba0807f6b6..6da5692ffa 100644 --- a/x/foundation/genesis_test.go +++ b/x/foundation/genesis_test.go @@ -407,8 +407,6 @@ func TestValidateGenesis(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { var unmarshalled foundation.GenesisState err := cdc.UnmarshalJSON(tc.raw, &unmarshalled) diff --git a/x/foundation/keeper/internal/keeper_test.go b/x/foundation/keeper/internal/keeper_test.go index 1b81a82a20..de255389b1 100644 --- a/x/foundation/keeper/internal/keeper_test.go +++ b/x/foundation/keeper/internal/keeper_test.go @@ -278,7 +278,6 @@ func TestNewKeeper(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { newKeeper := func() keeper.Keeper { app := simapp.Setup(false) diff --git a/x/foundation/keeper/internal/proposal.go b/x/foundation/keeper/internal/proposal.go index 2003e83f07..0495f45769 100644 --- a/x/foundation/keeper/internal/proposal.go +++ b/x/foundation/keeper/internal/proposal.go @@ -180,8 +180,6 @@ func (k Keeper) UpdateTallyOfVPEndProposals(ctx sdk.Context) { }) for _, proposal := range proposals { - proposal := proposal - if proposal.Status == foundation.PROPOSAL_STATUS_ABORTED || proposal.Status == foundation.PROPOSAL_STATUS_WITHDRAWN { k.pruneProposal(ctx, proposal) continue diff --git a/x/foundation/msgs_test.go b/x/foundation/msgs_test.go index ff79d17620..4480243dfc 100644 --- a/x/foundation/msgs_test.go +++ b/x/foundation/msgs_test.go @@ -713,8 +713,6 @@ func TestAminoJSON(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { require.Equal(t, tc.expected, string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tc.msg}, "memo"))) }) @@ -778,8 +776,6 @@ func TestMsgSubmitProposalAminoJSON(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { proposalMsg := &foundation.MsgSubmitProposal{ Proposers: []string{proposer.String()}, @@ -824,8 +820,6 @@ func TestMsgUpdateDecisionPolicyAminoJson(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { policyMsg := &foundation.MsgUpdateDecisionPolicy{ Authority: authority.String(), @@ -867,8 +861,6 @@ func TestMsgGrantAminoJson(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { grantMsg := &foundation.MsgGrant{ Authority: operator.String(), diff --git a/x/fswap/client/testutil/grpc.go b/x/fswap/client/testutil/grpc.go index 74e81b200a..1443f03401 100644 --- a/x/fswap/client/testutil/grpc.go +++ b/x/fswap/client/testutil/grpc.go @@ -52,7 +52,6 @@ func (s *IntegrationTestSuite) TestGRPCQuerySwap() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -91,7 +90,6 @@ func (s *IntegrationTestSuite) TestGRPCQuerySwaps() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -148,7 +146,6 @@ func (s *IntegrationTestSuite) TestGRPCQuerySwapped() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, map[string]string{ grpctypes.GRPCBlockHeightHeader: "1", @@ -206,7 +203,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryTotalSwappableAmount() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, map[string]string{ grpctypes.GRPCBlockHeightHeader: "1", diff --git a/x/fswap/client/testutil/query.go b/x/fswap/client/testutil/query.go index 4e4004f8b5..ff124613f4 100644 --- a/x/fswap/client/testutil/query.go +++ b/x/fswap/client/testutil/query.go @@ -55,8 +55,6 @@ func (s *IntegrationTestSuite) TestCmdQuerySwapped() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdQuerySwapped() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -117,8 +115,6 @@ func (s *IntegrationTestSuite) TestCmdQueryTotalSwappableAmount() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdQueryTotalSwappableAmount() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -179,8 +175,6 @@ func (s *IntegrationTestSuite) TestCmdQuerySwap() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdQuerySwap() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -227,8 +221,6 @@ func (s *IntegrationTestSuite) TestCmdQuerySwaps() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdQuerySwaps() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) diff --git a/x/fswap/client/testutil/tx.go b/x/fswap/client/testutil/tx.go index 31fd363446..73628fa037 100644 --- a/x/fswap/client/testutil/tx.go +++ b/x/fswap/client/testutil/tx.go @@ -74,8 +74,6 @@ func (s *IntegrationTestSuite) TestCmdTxMsgSwap() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdTxMsgSwap() bz, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, append(tc.args, commonArgs...)) @@ -141,8 +139,6 @@ func (s *IntegrationTestSuite) TestCmdTxMsgSwapAll() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdTxMsgSwapAll() bz, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, append(tc.args, commonArgs...)) @@ -279,8 +275,6 @@ func (s *IntegrationTestSuite) TestMsgSetSwap() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.CmdMsgSetSwap() bz, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/fswap/types/msgs_test.go b/x/fswap/types/msgs_test.go index e3dd86b7dd..2a6da1dfde 100644 --- a/x/fswap/types/msgs_test.go +++ b/x/fswap/types/msgs_test.go @@ -76,7 +76,6 @@ func TestAminoJSON(t *testing.T) { } for name, tc := range testCase { - tc := tc t.Run(name, func(t *testing.T) { tx.Msgs = []sdk.Msg{tc.msg} require.Equal(t, fswaptypes.RouterKey, tc.msg.Route()) diff --git a/x/genutil/client/cli/init_test.go b/x/genutil/client/cli/init_test.go index 5cc05093a1..91059db031 100644 --- a/x/genutil/client/cli/init_test.go +++ b/x/genutil/client/cli/init_test.go @@ -53,7 +53,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() diff --git a/x/genutil/client/testutil/migrate.go b/x/genutil/client/testutil/migrate.go index 62a035ca54..9c84cf12c4 100644 --- a/x/genutil/client/testutil/migrate.go +++ b/x/genutil/client/testutil/migrate.go @@ -37,7 +37,6 @@ func (s *IntegrationTestSuite) TestMigrateGenesis() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) jsonOutput, err := clitestutil.ExecTestCLICmd(val0.ClientCtx, cli.MigrateGenesisCmd(), []string{tc.target, genesisFile.Name()}) diff --git a/x/genutil/client/testutil/suite.go b/x/genutil/client/testutil/suite.go index 051820015d..14f668b105 100644 --- a/x/genutil/client/testutil/suite.go +++ b/x/genutil/client/testutil/suite.go @@ -96,8 +96,6 @@ func (s *IntegrationTestSuite) TestGenTxCmd() { } for _, tc := range tests { - tc := tc - dir := s.T().TempDir() genTxFile := filepath.Join(dir, "myTx") tc.args = append(tc.args, fmt.Sprintf("--%s=%s", flags.FlagOutputDocument, genTxFile)) diff --git a/x/genutil/client/testutil/validate_genesis.go b/x/genutil/client/testutil/validate_genesis.go index 32181a95db..73cedc9753 100644 --- a/x/genutil/client/testutil/validate_genesis.go +++ b/x/genutil/client/testutil/validate_genesis.go @@ -87,7 +87,6 @@ func (s *IntegrationTestSuite) TestValidateGenesis() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) _, err := clitestutil.ExecTestCLICmd(val0.ClientCtx, cli.ValidateGenesisCmd(nil), []string{genesisFile.Name()}) diff --git a/x/genutil/utils_test.go b/x/genutil/utils_test.go index b406ed3e98..198bf70386 100644 --- a/x/genutil/utils_test.go +++ b/x/genutil/utils_test.go @@ -49,7 +49,6 @@ func TestInitializeNodeValidatorFilesFromMnemonic(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { _, _, err := InitializeNodeValidatorFilesFromMnemonic(cfg, tt.mnemonic) diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index e97273afdf..e421b48126 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -38,7 +38,6 @@ func (s *IntegrationTestSuite) TestGetProposalGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -92,7 +91,6 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) @@ -159,7 +157,6 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -203,7 +200,6 @@ func (s *IntegrationTestSuite) TestGetProposalVotesGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -252,7 +248,6 @@ func (s *IntegrationTestSuite) TestGetProposalDepositGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -291,7 +286,6 @@ func (s *IntegrationTestSuite) TestGetProposalDepositsGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -336,7 +330,6 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -399,7 +392,6 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index b9be407318..0ff0055da4 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -108,8 +108,6 @@ voting_params: } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryParams() clientCtx := val.ClientCtx @@ -156,8 +154,6 @@ func (s *IntegrationTestSuite) TestCmdParam() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryParam() clientCtx := val.ClientCtx @@ -198,8 +194,6 @@ func (s *IntegrationTestSuite) TestCmdProposer() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryProposer() clientCtx := val.ClientCtx @@ -253,8 +247,6 @@ func (s *IntegrationTestSuite) TestCmdTally() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryTally() clientCtx := val.ClientCtx @@ -344,8 +336,6 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewCmdSubmitProposal() clientCtx := val.ClientCtx @@ -392,8 +382,6 @@ func (s *IntegrationTestSuite) TestCmdGetProposal() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryProposal() clientCtx := val.ClientCtx @@ -445,8 +433,6 @@ func (s *IntegrationTestSuite) TestCmdGetProposals() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryProposals() clientCtx := val.ClientCtx @@ -491,7 +477,6 @@ func (s *IntegrationTestSuite) TestCmdQueryDeposits() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryDeposits() clientCtx := val.ClientCtx @@ -547,7 +532,6 @@ func (s *IntegrationTestSuite) TestCmdQueryDeposit() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryDeposit() clientCtx := val.ClientCtx @@ -625,7 +609,6 @@ func (s *IntegrationTestSuite) TestNewCmdDeposit() { } for _, tc := range testCases { - tc := tc var resp sdk.TxResponse s.Run(tc.name, func() { @@ -676,7 +659,6 @@ func (s *IntegrationTestSuite) TestCmdQueryVotes() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryVotes() clientCtx := val.ClientCtx @@ -751,7 +733,6 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryVote() clientCtx := val.ClientCtx @@ -816,7 +797,6 @@ func (s *IntegrationTestSuite) TestNewCmdVote() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdVote() clientCtx := val.ClientCtx @@ -900,7 +880,6 @@ func (s *IntegrationTestSuite) TestNewCmdWeightedVote() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.NewCmdWeightedVote() clientCtx := val.ClientCtx diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 8510ee48de..09f8d582e6 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -160,8 +160,6 @@ func TestGetPaginatedVotes(t *testing.T) { }, }, } { - tc := tc - t.Run(tc.description, func(t *testing.T) { marshaled := make([]tmtypes.Tx, len(tc.msgs)) cli := TxSearchMock{txs: marshaled, txConfig: encCfg.TxConfig} diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 3debd3da85..befef0d18f 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -380,7 +380,6 @@ func TestPaginatedVotesQuery(t *testing.T) { page: -1, }, } { - tc := tc t.Run(tc.description, func(t *testing.T) { votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal.ProposalId, tc.page, tc.limit) require.Equal(t, len(tc.votes), len(votes)) diff --git a/x/gov/legacy/v043/store_test.go b/x/gov/legacy/v043/store_test.go index 6f7f0c9876..a9bbe4368c 100644 --- a/x/gov/legacy/v043/store_test.go +++ b/x/gov/legacy/v043/store_test.go @@ -80,7 +80,6 @@ func TestMigrateStore(t *testing.T) { // Make sure the new keys are set and old keys are deleted. for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { if !bytes.Equal(tc.oldKey, tc.newKey) { require.Nil(t, store.Get(tc.oldKey)) diff --git a/x/gov/simulation/decoder_test.go b/x/gov/simulation/decoder_test.go index 049e0f4a6f..2629b5409b 100644 --- a/x/gov/simulation/decoder_test.go +++ b/x/gov/simulation/decoder_test.go @@ -81,7 +81,6 @@ func TestDecodeStore(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if tt.wantPanic { require.Panics(t, func() { dec(tt.kvA, tt.kvB) }, tt.name) diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 2e0fc7217f..5602c79b5f 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -79,8 +79,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 6ba9e985f3..bde953d6f2 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -58,7 +58,6 @@ func WeightedOperations( var wProposalOps simulation.WeightedOperations for _, wContent := range wContents { - wContent := wContent // pin variable var weight int appParams.GetOrGenerate(cdc, wContent.AppParamsKey(), &weight, nil, func(_ *rand.Rand) { weight = wContent.DefaultWeight() }) diff --git a/x/mint/client/testutil/grpc.go b/x/mint/client/testutil/grpc.go index aa3cf59c51..52ead8c536 100644 --- a/x/mint/client/testutil/grpc.go +++ b/x/mint/client/testutil/grpc.go @@ -53,7 +53,6 @@ func (s *IntegrationTestSuite) TestQueryGRPC() { }, } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { s.Require().NoError(err) diff --git a/x/mint/client/testutil/suite.go b/x/mint/client/testutil/suite.go index a8a78637dd..9e7b6c21bb 100644 --- a/x/mint/client/testutil/suite.go +++ b/x/mint/client/testutil/suite.go @@ -81,8 +81,6 @@ mint_denom: stake`, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryParams() clientCtx := val.ClientCtx @@ -115,8 +113,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryInflation() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryInflation() clientCtx := val.ClientCtx @@ -149,8 +145,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryAnnualProvisions() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryAnnualProvisions() clientCtx := val.ClientCtx diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go index 8fb33000db..790313a374 100644 --- a/x/mint/simulation/decoder_test.go +++ b/x/mint/simulation/decoder_test.go @@ -34,7 +34,6 @@ func TestDecodeStore(t *testing.T) { } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index 621426ad80..84101358c4 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -79,8 +79,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/params/client/testutil/grpc.go b/x/params/client/testutil/grpc.go index 64cde94976..9f00b3921c 100644 --- a/x/params/client/testutil/grpc.go +++ b/x/params/client/testutil/grpc.go @@ -80,7 +80,6 @@ func (s *IntegrationTestSuite) TestQueryParamsGRPC() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) diff --git a/x/params/client/testutil/suite.go b/x/params/client/testutil/suite.go index 74953d16b2..45558544f5 100644 --- a/x/params/client/testutil/suite.go +++ b/x/params/client/testutil/suite.go @@ -66,8 +66,6 @@ value: "100"`, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewQuerySubspaceParamsCmd() clientCtx := val.ClientCtx diff --git a/x/params/keeper/keeper_test.go b/x/params/keeper/keeper_test.go index c4ae41351f..6285d5fb1a 100644 --- a/x/params/keeper/keeper_test.go +++ b/x/params/keeper/keeper_test.go @@ -83,13 +83,11 @@ func TestKeeper(t *testing.T) { // Set params for i, kv := range kvs { - kv := kv require.NotPanics(t, func() { space.Set(ctx, []byte(kv.key), kv.param) }, "space.Set panics, tc #%d", i) } // Test space.Get for i, kv := range kvs { - i, kv := i, kv var param int64 require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }, "space.Get panics, tc #%d", i) require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i) @@ -116,20 +114,17 @@ func TestKeeper(t *testing.T) { // Test invalid space.Get for i, kv := range kvs { - kv := kv var param bool require.Panics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }, "invalid space.Get not panics, tc #%d", i) } // Test invalid space.Set for i, kv := range kvs { - kv := kv require.Panics(t, func() { space.Set(ctx, []byte(kv.key), true) }, "invalid space.Set not panics, tc #%d", i) } // Test GetSubspace for i, kv := range kvs { - i, kv := i, kv var gparam, param int64 gspace, ok := keeper.GetSubspace("test") require.True(t, ok, "cannot retrieve subspace, tc #%d", i) @@ -191,13 +186,11 @@ func TestSubspace(t *testing.T) { // Test space.Set for i, kv := range kvs { - i, kv := i, kv require.NotPanics(t, func() { space.Set(ctx, []byte(kv.key), kv.param) }, "space.Set panics, tc #%d", i) } // Test space.Get, space.GetIfExists for i, kv := range kvs { - i, kv := i, kv require.NotPanics(t, func() { space.GetIfExists(ctx, []byte("invalid"), kv.ptr) }, "space.GetIfExists panics when no value exists, tc #%d", i) require.Equal(t, kv.zero, indirect(kv.ptr), "space.GetIfExists unmarshalls when no value exists, tc #%d", i) require.Panics(t, func() { space.Get(ctx, []byte("invalid"), kv.ptr) }, "invalid space.Get not panics when no value exists, tc #%d", i) diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 81f42547e2..9162fea2f3 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -77,7 +77,6 @@ func (suite *HandlerTestSuite) TestProposalHandler() { } for _, tc := range testCases { - tc := tc suite.Run(tc.name, func() { err := suite.govHandler(suite.ctx, tc.proposal) if tc.expErr { diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index 1882f47b58..887246afa3 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -184,7 +184,6 @@ func (suite *SubspaceTestSuite) TestSetParamSet() { } for _, tc := range testCases { - tc := tc suite.Run(tc.name, func() { suite.Require().Panics(func() { suite.ss.SetParamSet(suite.ctx, tc.ps) diff --git a/x/simulation/operation.go b/x/simulation/operation.go index 82547c3891..433518f3dd 100644 --- a/x/simulation/operation.go +++ b/x/simulation/operation.go @@ -79,7 +79,6 @@ func queueOperations(queuedOps OperationQueue, queuedTimeOps, futureOps []simula } for _, futureOp := range futureOps { - futureOp := futureOp if futureOp.BlockHeight != 0 { if val, ok := queuedOps[futureOp.BlockHeight]; ok { queuedOps[futureOp.BlockHeight] = append(val, futureOp.Op) diff --git a/x/slashing/client/testutil/grpc.go b/x/slashing/client/testutil/grpc.go index a56583e355..245b4023b8 100644 --- a/x/slashing/client/testutil/grpc.go +++ b/x/slashing/client/testutil/grpc.go @@ -83,8 +83,6 @@ func (s *IntegrationTestSuite) TestGRPCQueries() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) diff --git a/x/slashing/client/testutil/suite.go b/x/slashing/client/testutil/suite.go index 718e84e5a7..885ee616ad 100644 --- a/x/slashing/client/testutil/suite.go +++ b/x/slashing/client/testutil/suite.go @@ -85,8 +85,6 @@ tombstoned: false`, sdk.ConsAddress(val.PubKey.Address())), } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQuerySigningInfo() clientCtx := val.ClientCtx @@ -127,8 +125,6 @@ slash_fraction_downtime: "0.010000000000000000"`, } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryParams() clientCtx := val.ClientCtx @@ -162,8 +158,6 @@ func (s *IntegrationTestSuite) TestNewUnjailTxCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewUnjailTxCmd() clientCtx := val.ClientCtx diff --git a/x/slashing/legacy/v043/store_test.go b/x/slashing/legacy/v043/store_test.go index 69df9372c1..318bc16bd5 100644 --- a/x/slashing/legacy/v043/store_test.go +++ b/x/slashing/legacy/v043/store_test.go @@ -57,7 +57,6 @@ func TestStoreMigration(t *testing.T) { // Make sure the new keys are set and old keys are deleted. for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { if !bytes.Equal(tc.oldKey, tc.newKey) { require.Nil(t, store.Get(tc.oldKey)) diff --git a/x/slashing/simulation/decoder_test.go b/x/slashing/simulation/decoder_test.go index 9d5794a590..892fda56d8 100644 --- a/x/slashing/simulation/decoder_test.go +++ b/x/slashing/simulation/decoder_test.go @@ -53,7 +53,6 @@ func TestDecodeStore(t *testing.T) { {"other", "", true}, } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { if tt.panics { require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) diff --git a/x/slashing/simulation/genesis_test.go b/x/slashing/simulation/genesis_test.go index e63bc3c14c..c5d3615b94 100644 --- a/x/slashing/simulation/genesis_test.go +++ b/x/slashing/simulation/genesis_test.go @@ -78,8 +78,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index e326e4490b..9153d126d5 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -85,7 +85,6 @@ func TestPrepareConfigForTxCreateValidator(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { fs, _ := CreateValidatorMsgFlagSet(ip) fs.String(flags.FlagName, "", "name of private key with which to sign the gentx") diff --git a/x/staking/client/testutil/grpc.go b/x/staking/client/testutil/grpc.go index 690443ffa7..03062377c8 100644 --- a/x/staking/client/testutil/grpc.go +++ b/x/staking/client/testutil/grpc.go @@ -43,7 +43,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryValidatorsHandler() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -91,7 +90,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryValidator() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -156,7 +154,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryValidatorDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) @@ -200,7 +197,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryValidatorUnbondingDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -279,7 +275,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegation() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -333,7 +328,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryUnbondingDelegation() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -418,7 +412,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegatorDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) @@ -466,7 +459,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegatorUnbondingDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -528,7 +520,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryRedelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -577,7 +568,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegatorValidators() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -634,7 +624,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegatorValidator() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -680,7 +669,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryHistoricalInfo() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) @@ -720,7 +708,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() { } for _, tc := range testCases { - tc := tc resp, err := rest.GetRequest(tc.url) s.Run(tc.name, func() { s.Require().NoError(err) @@ -758,7 +745,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryPool() { } for _, tc := range testCases { - tc := tc resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Run(tc.name, func() { s.Require().NoError(err) diff --git a/x/staking/client/testutil/suite.go b/x/staking/client/testutil/suite.go index 3109c95bf9..353a55dd30 100644 --- a/x/staking/client/testutil/suite.go +++ b/x/staking/client/testutil/suite.go @@ -189,8 +189,6 @@ func (s *IntegrationTestSuite) TestNewCreateValidatorCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewCreateValidatorCmd() clientCtx := val.ClientCtx @@ -244,7 +242,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidator() { }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidator() clientCtx := val.ClientCtx @@ -285,8 +282,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidators() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidators() clientCtx := val.ClientCtx @@ -351,7 +346,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryDelegation() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryDelegation() clientCtx := val.ClientCtx @@ -407,7 +401,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryDelegations() clientCtx := val.ClientCtx @@ -463,7 +456,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryDelegations() clientCtx := val.ClientCtx @@ -507,7 +499,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryUnbondingDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryUnbondingDelegations() clientCtx := val.ClientCtx @@ -566,7 +557,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryUnbondingDelegation() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryUnbondingDelegation() clientCtx := val.ClientCtx @@ -615,7 +605,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorUnbondingDelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidatorUnbondingDelegations() clientCtx := val.ClientCtx @@ -664,7 +653,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryRedelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryRedelegations() clientCtx := val.ClientCtx @@ -740,7 +728,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryRedelegation() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryRedelegation() clientCtx := val.ClientCtx @@ -792,7 +779,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorRedelegations() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryValidatorRedelegations() clientCtx := val.ClientCtx @@ -843,7 +829,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryHistoricalInfo() { } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryHistoricalInfo() clientCtx := val.ClientCtx @@ -885,7 +870,6 @@ unbonding_time: 1814400s`, }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryParams() clientCtx := val.ClientCtx @@ -922,7 +906,6 @@ not_bonded_tokens: "0"`, cli.DefaultTokens.Mul(sdk.NewInt(2)).String()), }, } for _, tc := range testCases { - tc := tc s.Run(tc.name, func() { cmd := cli.GetCmdQueryPool() clientCtx := val.ClientCtx @@ -1029,8 +1012,6 @@ func (s *IntegrationTestSuite) TestNewEditValidatorCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewEditValidatorCmd() clientCtx := val.ClientCtx @@ -1111,8 +1092,6 @@ func (s *IntegrationTestSuite) TestNewDelegateCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewDelegateCmd() clientCtx := val.ClientCtx @@ -1197,8 +1176,6 @@ func (s *IntegrationTestSuite) TestNewRedelegateCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewRedelegateCmd() clientCtx := val.ClientCtx @@ -1264,8 +1241,6 @@ func (s *IntegrationTestSuite) TestNewUnbondCmd() { } for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { cmd := cli.NewUnbondCmd() clientCtx := val.ClientCtx diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index c61257a448..afcf3db100 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -230,7 +230,6 @@ func TestValidateGenesis(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { genesisState := types.DefaultGenesisState() tt.mutate(genesisState) diff --git a/x/staking/legacy/v043/store_test.go b/x/staking/legacy/v043/store_test.go index cbc917103d..bad5fba9ba 100644 --- a/x/staking/legacy/v043/store_test.go +++ b/x/staking/legacy/v043/store_test.go @@ -127,7 +127,6 @@ func TestStoreMigration(t *testing.T) { // Make sure the new keys are set and old keys are deleted. for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { if !bytes.Equal(tc.oldKey, tc.newKey) { require.Nil(t, store.Get(tc.oldKey)) diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index cc4a936deb..bc486e7c88 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -57,7 +57,6 @@ func TestDecodeStore(t *testing.T) { {"other", ""}, } for i, tt := range tests { - i, tt := i, tt t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index 40ea16a9a2..c80a3a8a9d 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -101,8 +101,6 @@ func TestRandomizedGenState1(t *testing.T) { } for _, tt := range tests { - tt := tt - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) } } diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index a722adf6f6..1063dce831 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -267,7 +267,6 @@ func TestAuthzAuthorizations(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.msg, func(t *testing.T) { delAuth, err := stakingtypes.NewStakeAuthorization(tc.allowed, tc.denied, tc.msgType, tc.limit) require.NoError(t, err) diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index 328c0b4102..9929819d6b 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -105,8 +105,6 @@ func TestMsgEditValidator(t *testing.T) { } for _, tc := range tests { - tc := tc - description := types.NewDescription(tc.moniker, tc.identity, tc.website, tc.securityContact, tc.details) newRate := sdk.ZeroDec() diff --git a/x/token/client/testutil/query.go b/x/token/client/testutil/query.go index e8ba981d8a..df87b16d6b 100644 --- a/x/token/client/testutil/query.go +++ b/x/token/client/testutil/query.go @@ -62,8 +62,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdBalance() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdBalance() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -117,8 +115,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdToken() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdContract() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -192,8 +188,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdGranteeGrants() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdGranteeGrants() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -254,8 +248,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdIsOperatorFor() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdIsOperatorFor() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -314,8 +306,6 @@ func (s *IntegrationTestSuite) TestNewQueryCmdHoldersByOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewQueryCmdHoldersByOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/token/client/testutil/tx.go b/x/token/client/testutil/tx.go index e3e6746321..662606d97a 100644 --- a/x/token/client/testutil/tx.go +++ b/x/token/client/testutil/tx.go @@ -62,8 +62,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdSend() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdSend() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -136,8 +134,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorSend() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorSend() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -194,8 +190,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdAuthorizeOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdAuthorizeOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -252,8 +246,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdRevokeOperator() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdRevokeOperator() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -318,8 +310,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdIssue() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdIssue() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -379,8 +369,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdGrantPermission() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdGrantPermission() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -437,8 +425,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdRevokePermission() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdRevokePermission() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -498,8 +484,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdMint() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdMint() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -556,8 +540,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdBurn() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdBurn() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -617,8 +599,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdOperatorBurn() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdOperatorBurn() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) @@ -678,8 +658,6 @@ func (s *IntegrationTestSuite) TestNewTxCmdModify() { } for name, tc := range testCases { - tc := tc - s.Run(name, func() { cmd := cli.NewTxCmdModify() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) diff --git a/x/token/msgs_test.go b/x/token/msgs_test.go index 9fe3dd4549..2a4ba5aeab 100644 --- a/x/token/msgs_test.go +++ b/x/token/msgs_test.go @@ -1026,8 +1026,6 @@ func TestAminoJSON(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { tx.Msgs = []sdk.Msg{tc.msg} require.Equal(t, token.RouterKey, tc.msg.Route()) diff --git a/x/upgrade/keeper/grpc_query_test.go b/x/upgrade/keeper/grpc_query_test.go index 5c3c500f07..56a7087ca5 100644 --- a/x/upgrade/keeper/grpc_query_test.go +++ b/x/upgrade/keeper/grpc_query_test.go @@ -174,8 +174,6 @@ func (suite *UpgradeTestSuite) TestModuleVersions() { mv := suite.app.UpgradeKeeper.GetModuleVersions(suite.ctx) for _, tc := range testCases { - tc := tc - suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { suite.SetupTest() // reset diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index 6558b0a893..56b97db97d 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -131,8 +131,6 @@ func (s *KeeperTestSuite) TestScheduleUpgrade() { } for _, tc := range cases { - tc := tc - s.Run(tc.name, func() { // reset suite s.SetupTest() diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index 484a7ac5b0..37727ab45d 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -44,7 +44,6 @@ func TestPlanString(t *testing.T) { } for name, tc := range cases { - tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { s := tc.p.String() require.Equal(t, tc.expect, s) @@ -90,7 +89,6 @@ func TestPlanValid(t *testing.T) { } for name, tc := range cases { - tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { err := tc.p.ValidateBasic() if tc.valid { @@ -139,7 +137,6 @@ func TestShouldExecute(t *testing.T) { } for name, tc := range cases { - tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { ctx := sdk.NewContext(nil, tmproto.Header{Height: tc.ctxHeight, Time: tc.ctxTime}, false, log.NewNopLogger()) should := tc.p.ShouldExecute(ctx) diff --git a/x/upgrade/types/proposal_test.go b/x/upgrade/types/proposal_test.go index 6a576265c9..174a427200 100644 --- a/x/upgrade/types/proposal_test.go +++ b/x/upgrade/types/proposal_test.go @@ -49,7 +49,6 @@ func TestContentAccessors(t *testing.T) { types.RegisterLegacyAminoCodec(cdc) for name, tc := range cases { - tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { assert.Equal(t, tc.title, tc.p.GetTitle()) assert.Equal(t, tc.desc, tc.p.GetDescription()) @@ -72,7 +71,6 @@ func TestContentAccessors(t *testing.T) { assert.Equal(t, "upgrade", unwrap.Prop.ProposalRoute()) assert.Equal(t, tc.str, unwrap.Prop.String()) }) - } } diff --git a/x/upgrade/types/storeloader_test.go b/x/upgrade/types/storeloader_test.go index 50d9dcf066..6bb64d7e3b 100644 --- a/x/upgrade/types/storeloader_test.go +++ b/x/upgrade/types/storeloader_test.go @@ -110,7 +110,6 @@ func TestSetLoader(t *testing.T) { v := []byte("value") for name, tc := range cases { - tc := tc t.Run(name, func(t *testing.T) { // prepare a db with some data db := dbm.NewMemDB()