Skip to content

Commit 39bfd5a

Browse files
committed
lint
1 parent e608651 commit 39bfd5a

File tree

111 files changed

+197
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+197
-331
lines changed

baseapp/abci_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,6 @@ func TestABCI_GetBlockRetentionHeight(t *testing.T) {
13361336
}
13371337

13381338
for name, tc := range testCases {
1339-
tc := tc
13401339

13411340
tc.bapp.SetParamStore(&paramStore{db: dbm.NewMemDB()})
13421341
_, err = tc.bapp.InitChain(&abci.RequestInitChain{

baseapp/snapshot_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ func TestABCI_OfferSnapshot_Errors(t *testing.T) {
245245
}, abci.ResponseOfferSnapshot_REJECT},
246246
}
247247
for name, tc := range testCases {
248-
tc := tc
249248
t.Run(name, func(t *testing.T) {
250249
resp, err := suite.baseApp.OfferSnapshot(&abci.RequestOfferSnapshot{Snapshot: tc.snapshot})
251250
require.NoError(t, err)

client/cmd_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ func TestSetCmdClientContextHandler(t *testing.T) {
125125
}
126126

127127
for _, tc := range testCases {
128-
tc := tc
129-
130128
t.Run(tc.name, func(t *testing.T) {
131129
cmd := newCmd()
132130
_ = testutil.ApplyMockIODiscardOutErr(cmd)

client/config/config_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func TestConfigCmdEnvFlag(t *testing.T) {
5858
}
5959

6060
for _, tc := range tt {
61-
tc := tc
6261
t.Run(tc.name, func(t *testing.T) {
6362
testCmd := &cobra.Command{
6463
Use: "test",

client/flags/flags_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ func TestParseGasSetting(t *testing.T) {
2222
}
2323

2424
for _, tc := range testCases {
25-
tc := tc
26-
2725
t.Run(tc.name, func(t *testing.T) {
2826
gs, err := flags.ParseGasSetting(tc.input)
2927

client/tx/aux_builder_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ func TestAuxTxBuilder(t *testing.T) {
213213
}
214214

215215
for _, tc := range testcases {
216-
tc := tc
217216
t.Run(tc.name, func(t *testing.T) {
218217
b = tx.NewAuxTxBuilder()
219218
err := tc.malleate()

client/tx/tx_test.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func TestCalculateGas(t *testing.T) {
7474
}
7575

7676
for _, tc := range testCases {
77-
stc := tc
7877
txCfg, _ := newTestTxConfig()
7978
defaultSignMode, err := signing.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode())
8079
require.NoError(t, err)
@@ -83,16 +82,16 @@ func TestCalculateGas(t *testing.T) {
8382
WithChainID("test-chain").
8483
WithTxConfig(txCfg).WithSignMode(defaultSignMode)
8584

86-
t.Run(stc.name, func(t *testing.T) {
85+
t.Run(tc.name, func(t *testing.T) {
8786
mockClientCtx := mockContext{
8887
gasUsed: tc.args.mockGasUsed,
8988
wantErr: tc.args.mockWantErr,
9089
}
91-
simRes, gotAdjusted, err := CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment))
92-
if stc.expPass {
90+
simRes, gotAdjusted, err := CalculateGas(mockClientCtx, txf.WithGasAdjustment(tc.args.adjustment))
91+
if tc.expPass {
9392
require.NoError(t, err)
94-
require.Equal(t, simRes.GasInfo.GasUsed, stc.wantEstimate)
95-
require.Equal(t, gotAdjusted, stc.wantAdjusted)
93+
require.Equal(t, simRes.GasInfo.GasUsed, tc.wantEstimate)
94+
require.Equal(t, gotAdjusted, tc.wantAdjusted)
9695
require.NotNil(t, simRes.Result)
9796
} else {
9897
require.Error(t, err)

codec/amino_codec_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ func TestAminoCodecMarshalJSONIndent(t *testing.T) {
7171
}
7272

7373
for _, tc := range testCases {
74-
tc := tc
75-
7674
t.Run(tc.name, func(t *testing.T) {
7775
cdc := codec.NewAminoCodec(createTestCodec())
7876
bz, err := cdc.MarshalJSONIndent(tc.input, "", " ")

codec/codec_common_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ func testMarshaling(t *testing.T, cdc interface {
121121
}
122122

123123
for _, tc := range testCases {
124-
tc := tc
125124
m1 := mustMarshaler{cdc.Marshal, cdc.MustMarshal, cdc.Unmarshal, cdc.MustUnmarshal}
126125
m2 := mustMarshaler{cdc.MarshalLengthPrefixed, cdc.MustMarshalLengthPrefixed, cdc.UnmarshalLengthPrefixed, cdc.MustUnmarshalLengthPrefixed}
127126
m3 := mustMarshaler{

crypto/keyring/keyring_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,6 @@ func TestRenameKey(t *testing.T) {
20022002
}
20032003

20042004
for _, tc := range testCases {
2005-
tc := tc
20062005
kr := newKeyring(t, "testKeyring")
20072006
t.Run(tc.name, func(t *testing.T) {
20082007
tc.run(kr)

crypto/types/compact_bit_array_test.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func TestBitArrayEqual(t *testing.T) {
5858
{name: "different should not be equal", b1: big1, b2: big2, eq: false},
5959
}
6060
for _, tc := range cases {
61-
tc := tc
6261
t.Run(tc.name, func(t *testing.T) {
6362
eq := tc.b1.Equal(tc.b2)
6463
require.Equal(t, tc.eq, eq)
@@ -102,7 +101,7 @@ func TestJSONMarshalUnmarshal(t *testing.T) {
102101
}
103102

104103
for _, tc := range testCases {
105-
tc := tc
104+
106105
t.Run(tc.bA.String(), func(t *testing.T) {
107106
bz, err := json.Marshal(tc.bA)
108107
require.NoError(t, err)
@@ -162,7 +161,7 @@ func TestCompactMarshalUnmarshal(t *testing.T) {
162161
}
163162

164163
for _, tc := range testCases {
165-
tc := tc
164+
166165
t.Run(tc.bA.String(), func(t *testing.T) {
167166
bz := tc.bA.CompactMarshal()
168167

@@ -209,7 +208,7 @@ func TestCompactBitArrayNumOfTrueBitsBefore(t *testing.T) {
209208
{`"______________xx"`, []int{14, 15}, []int{0, 1}},
210209
}
211210
for tcIndex, tc := range testCases {
212-
tc := tc
211+
213212
tcIndex := tcIndex
214213
t.Run(tc.marshalledBA, func(t *testing.T) {
215214
var bA *CompactBitArray

simapp/genesis_account_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func TestSimGenesisAccountValidate(t *testing.T) {
8181
}
8282

8383
for _, tc := range testCases {
84-
tc := tc
8584
t.Run(tc.name, func(t *testing.T) {
8685
require.Equal(t, tc.wantErr, tc.sga.Validate() != nil)
8786
})

store/iavl/store_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,6 @@ func TestSetInitialVersion(t *testing.T) {
639639
}
640640

641641
for _, tc := range testCases {
642-
tc := tc
643-
644642
t.Run(tc.name, func(t *testing.T) {
645643
db := dbm.NewMemDB()
646644
store := tc.storeFn(db)

store/pruning/manager_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func TestStrategies(t *testing.T) {
7575
}
7676

7777
for name, tc := range testcases {
78-
tc := tc // Local copy to avoid shadowing.
7978
t.Run(name, func(t *testing.T) {
8079
t.Parallel()
8180

store/rootmulti/snapshot_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) {
141141
}},
142142
}
143143
for _, tc := range testcases {
144-
tc := tc
145144
t.Run(fmt.Sprintf("Format %v", tc.format), func(t *testing.T) {
146145
ch := make(chan io.ReadCloser)
147146
go func() {
@@ -176,7 +175,7 @@ func TestMultistoreSnapshot_Errors(t *testing.T) {
176175
"unknown height": {9, nil},
177176
}
178177
for name, tc := range testcases {
179-
tc := tc
178+
180179
t.Run(name, func(t *testing.T) {
181180
err := store.Snapshot(tc.height, nil)
182181
require.Error(t, err)

store/rootmulti/store_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@ func TestMultiStore_Pruning(t *testing.T) {
520520
}
521521

522522
for _, tc := range testCases {
523-
tc := tc
524-
525523
t.Run(tc.name, func(t *testing.T) {
526524
db := dbm.NewMemDB()
527525
ms := newMultiStoreWithMounts(db, tc.po)

store/types/iterator_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func TestPaginatedIterator(t *testing.T) {
8484
reverse: true,
8585
},
8686
} {
87-
tc := tc
8887
t.Run(tc.desc, func(t *testing.T) {
8988
var iter types.Iterator
9089
if tc.reverse {

store/types/store_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func TestStoreUpgrades(t *testing.T) {
5353
}
5454

5555
for name, tc := range cases {
56-
tc := tc
5756
t.Run(name, func(t *testing.T) {
5857
for _, r := range tc.expectAdd {
5958
assert.Equal(t, tc.upgrades.IsAdded(r.key), true)

tests/e2e/auth/suite.go

-5
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ func (s *E2ETestSuite) TestCLIQueryTxCmdByHash() {
340340
}
341341

342342
for _, tc := range testCases {
343-
tc := tc
344343
s.Run(tc.name, func() {
345344
cmd := authcli.QueryTxCmd()
346345
clientCtx := val.ClientCtx
@@ -470,7 +469,6 @@ func (s *E2ETestSuite) TestCLIQueryTxCmdByEvents() {
470469
}
471470

472471
for _, tc := range testCases {
473-
tc := tc
474472
s.Run(tc.name, func() {
475473
cmd := authcli.QueryTxCmd()
476474
clientCtx := val.ClientCtx
@@ -548,7 +546,6 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() {
548546
}
549547

550548
for _, tc := range testCases {
551-
tc := tc
552549
s.Run(tc.name, func() {
553550
cmd := authcli.QueryTxsByEventsCmd()
554551
clientCtx := val.ClientCtx
@@ -1436,7 +1433,6 @@ func (s *E2ETestSuite) TestAuxSigner() {
14361433
}
14371434

14381435
for _, tc := range testCases {
1439-
tc := tc
14401436
s.Run(tc.name, func() {
14411437
_, err := govtestutil.MsgSubmitLegacyProposal(
14421438
val.ClientCtx,
@@ -1658,7 +1654,6 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() {
16581654
}
16591655

16601656
for _, tc := range testCases {
1661-
tc := tc
16621657
s.Run(tc.name, func() {
16631658
res, err := govtestutil.MsgSubmitLegacyProposal(
16641659
val.ClientCtx,

tests/e2e/authz/grpc.go

-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func (s *E2ETestSuite) TestQueryGrantGRPC() {
6363
},
6464
}
6565
for _, tc := range testCases {
66-
tc := tc
6766
s.Run(tc.name, func() {
6867
resp, _ := testutil.GetRequest(tc.url)
6968
require := s.Require()
@@ -150,7 +149,6 @@ func (s *E2ETestSuite) TestQueryGrantsGRPC() {
150149
},
151150
}
152151
for _, tc := range testCases {
153-
tc := tc
154152
s.Run(tc.name, func() {
155153
tc.preRun()
156154
resp, err := testutil.GetRequest(tc.url)

tests/e2e/authz/tx.go

-7
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() {
308308
},
309309
}
310310
for _, tc := range testCases {
311-
tc := tc
312311
s.Run(tc.name, func() {
313312
cmd := cli.NewCmdRevokeAuthorization(addresscodec.NewBech32Codec("cosmos"))
314313
clientCtx := val.ClientCtx
@@ -455,7 +454,6 @@ func (s *E2ETestSuite) TestNewExecGenericAuthorized() {
455454
}
456455

457456
for _, tc := range testCases {
458-
tc := tc
459457
s.Run(tc.name, func() {
460458
cmd := cli.NewCmdExecAuthorization()
461459
clientCtx := val.ClientCtx
@@ -561,7 +559,6 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() {
561559
}
562560

563561
for _, tc := range testCases {
564-
tc := tc
565562
s.Run(tc.name, func() {
566563
cmd := cli.NewCmdExecAuthorization()
567564
clientCtx := val.ClientCtx
@@ -760,7 +757,6 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() {
760757
}
761758

762759
for _, tc := range testCases {
763-
tc := tc
764760
s.Run(tc.name, func() {
765761
cmd := cli.NewCmdExecAuthorization()
766762
clientCtx := val.ClientCtx
@@ -827,7 +823,6 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() {
827823
}
828824

829825
for _, tc := range testCases {
830-
tc := tc
831826
s.Run(tc.name, func() {
832827
cmd := cli.NewCmdExecAuthorization()
833828
clientCtx := val.ClientCtx
@@ -985,7 +980,6 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() {
985980
}
986981

987982
for _, tc := range testCases {
988-
tc := tc
989983
s.Run(tc.name, func() {
990984
cmd := cli.NewCmdExecAuthorization()
991985
clientCtx := val.ClientCtx
@@ -1053,7 +1047,6 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() {
10531047
}
10541048

10551049
for _, tc := range testCases {
1056-
tc := tc
10571050
s.Run(tc.name, func() {
10581051
cmd := cli.NewCmdExecAuthorization()
10591052
clientCtx := val.ClientCtx

tests/e2e/bank/grpc.go

-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() {
8989
}
9090

9191
for _, tc := range testCases {
92-
tc := tc
9392
s.Run(tc.name, func() {
9493
resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers)
9594
s.Require().NoError(err)
@@ -210,7 +209,6 @@ func (s *E2ETestSuite) TestDenomMetadataGRPCHandler() {
210209
}
211210

212211
for _, tc := range testCases {
213-
tc := tc
214212
s.Run(tc.name, func() {
215213
resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers)
216214
s.Require().NoError(err)
@@ -274,7 +272,6 @@ func (s *E2ETestSuite) TestBalancesGRPCHandler() {
274272
}
275273

276274
for _, tc := range testCases {
277-
tc := tc
278275
s.Run(tc.name, func() {
279276
resp, err := testutil.GetRequest(tc.url)
280277
s.Require().NoError(err)

tests/e2e/bank/suite.go

-4
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ func (s *E2ETestSuite) TestNewSendTxCmd() {
234234
}
235235

236236
for _, tc := range testCases {
237-
tc := tc
238-
239237
s.Require().NoError(s.network.WaitForNextBlock())
240238
s.Run(tc.name, func() {
241239
clientCtx := val.ClientCtx
@@ -369,8 +367,6 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() {
369367
}
370368

371369
for _, tc := range testCases {
372-
tc := tc
373-
374370
s.Require().NoError(s.network.WaitForNextBlock())
375371
s.Run(tc.name, func() {
376372
clientCtx := val.ClientCtx

0 commit comments

Comments
 (0)