Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion e2e/e2etests/legacy/test_rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func createAndWaitWithdraws(r *runner.E2ERunner, withdrawType withdrawType, with
g, ctx := errgroup.WithContext(r.Ctx)
for i, tx := range txs {
// capture the loop variables
tx, i := tx, i

// start a goroutine to wait for the withdraw to be mined
g.Go(func() error {
Expand Down
1 change: 0 additions & 1 deletion e2e/e2etests/test_stress_sui_deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func TestStressSuiDeposit(r *runner.E2ERunner, args []string) {
// send the SUI deposit transactions
for i := range numDeposits {
// each goroutine captures its own copy of i
i := i
resp := r.SuiDepositSUI(r.SuiGateway.PackageID(), r.EVMAddress(), math.NewUintFromBigInt(amount))

r.Logger.Print("index %d: started with tx hash: %s", i, resp.Digest)
Expand Down
1 change: 0 additions & 1 deletion e2e/e2etests/test_stress_sui_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestStressSuiWithdraw(r *runner.E2ERunner, args []string) {
revertOptions := gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)}
for i := range numWithdrawals {
// each goroutine captures its own copy of i
i := i
tx := r.SuiWithdraw(signer.Address(), amount, r.SUIZRC20Addr, revertOptions)

// wait for receipt before next withdrawal to avoid race condition
Expand Down
1 change: 0 additions & 1 deletion e2e/utils/zetacore.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func WaitCctxsMinedByInboundHash(
cctxs = make([]*crosschaintypes.CrossChainTx, 0, len(res.CrossChainTxs))
allFound := true
for j, cctx := range res.CrossChainTxs {
cctx := cctx
if !cctx.CctxStatus.Status.IsTerminal() {
// prevent spamming logs
if i%20 == 0 {
Expand Down
1 change: 0 additions & 1 deletion pkg/chains/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ func TestChain_EncodeAddress(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
s, err := tc.chain.EncodeAddress(tc.b)
if tc.wantErr {
Expand Down
2 changes: 0 additions & 2 deletions pkg/os/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestResolveHome(t *testing.T) {
}

for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
pathOut, err := zetaos.ExpandHomeDir(tc.pathIn)
require.NoError(t, err)
Expand Down Expand Up @@ -74,7 +73,6 @@ func TestFileExists(t *testing.T) {
}

for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
exists := zetaos.FileExists(tc.file)
require.Equal(t, tc.expected, exists)
Expand Down
3 changes: 0 additions & 3 deletions x/crosschain/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,18 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
// Get all gas prices
gasPriceList := k.GetAllGasPrice(ctx)
for _, elem := range gasPriceList {
elem := elem
genesis.GasPriceList = append(genesis.GasPriceList, &elem)
}

// Get all last block heights
lastBlockHeightList := k.GetAllLastBlockHeight(ctx)
for _, elem := range lastBlockHeightList {
elem := elem
genesis.LastBlockHeightList = append(genesis.LastBlockHeightList, &elem)
}

// Get all send
sendList := k.GetAllCrossChainTx(ctx)
for _, elem := range sendList {
elem := elem
genesis.CrossChainTxs = append(genesis.CrossChainTxs, &elem)
}

Expand Down
4 changes: 0 additions & 4 deletions x/crosschain/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func Test_CheckAndUpdateCCTXGasPrice(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
// ARRANGE
k, ctx := testkeeper.CrosschainKeeperAllMocks(t)
Expand Down Expand Up @@ -405,7 +404,6 @@ func Test_CheckAndUpdateCCTXGasPriceEVM(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
// ARRANGE
k, ctx := testkeeper.CrosschainKeeperAllMocks(t)
Expand Down Expand Up @@ -572,7 +570,6 @@ func Test_CheckAndUpdateCCTXGasPriceBTC(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
// ARRANGE
k, ctx := testkeeper.CrosschainKeeperAllMocks(t)
Expand Down Expand Up @@ -747,7 +744,6 @@ func Test_IsCCTXGasPriceUpdateSupported(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
isSupported := keeper.IsCCTXGasPriceUpdateSupported(tc.chainID, []chains.Chain{})
require.Equal(t, tc.isSupport, isSupported)
Expand Down
2 changes: 0 additions & 2 deletions x/crosschain/keeper/cctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func TestCCTXs(t *testing.T) {
},
}
for _, tt := range cctxsTest {
tt := tt
t.Run(tt.TestName, func(t *testing.T) {
keeper, ctx, _, zk := keepertest.CrosschainKeeper(t)
keeper.SetZetaAccounting(ctx, types.ZetaAccounting{AbortedZetaAmount: math.ZeroUint()})
Expand Down Expand Up @@ -227,7 +226,6 @@ func TestCCTXQuerySingle(t *testing.T) {
err: status.Error(codes.InvalidArgument, "invalid request"),
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
response, err := keeper.Cctx(wctx, tc.request)
if tc.err != nil {
Expand Down
1 change: 0 additions & 1 deletion x/crosschain/keeper/grpc_query_gas_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestGasPriceQuerySingle(t *testing.T) {
err: fmt.Errorf("strconv.Atoi: parsing \"abc\": invalid syntax"),
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
response, err := k.GasPrice(wctx, tc.request)
if tc.err != nil {
Expand Down
1 change: 0 additions & 1 deletion x/crosschain/keeper/grpc_query_last_block_height_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestLastBlockHeightQuerySingle(t *testing.T) {
err: status.Error(codes.InvalidArgument, "invalid request"),
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
response, err := k.LastBlockHeight(wctx, tc.request)
if tc.err != nil {
Expand Down
1 change: 0 additions & 1 deletion x/crosschain/keeper/msg_server_vote_inbound_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ func TestStatus_UpdateCctxStatus(t *testing.T) {
},
}
for _, test := range tt {
test := test
t.Run(test.Name, func(t *testing.T) {
test.Status.UpdateStatusAndErrorMessages(test.NonErrStatus, types.StatusMessages{StatusMessage: test.Msg})
if test.IsErr {
Expand Down
1 change: 0 additions & 1 deletion x/crosschain/keeper/msg_server_vote_outbound_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func TestKeeper_FundGasStabilityPoolFromRemainingFees(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
k, ctx := keepertest.CrosschainKeeperAllMocks(t)
fungibleMock := keepertest.GetCrosschainFungibleMock(t, k)
Expand Down
1 change: 0 additions & 1 deletion x/crosschain/simulation/decoders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func TestDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]))
})
Expand Down
1 change: 0 additions & 1 deletion x/emissions/simulation/decoders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]))
})
Expand Down
1 change: 0 additions & 1 deletion x/fungible/keeper/evm_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func TestKeeper_CheckPausedZRC20(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
k, ctx, _, _ := keepertest.FungibleKeeper(t)

Expand Down
1 change: 0 additions & 1 deletion x/fungible/simulation/decoders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func TestDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]))
})
Expand Down
1 change: 0 additions & 1 deletion x/fungible/types/message_pause_zrc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func TestMsgPauseZRC20_ValidateBasic(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
err := tc.msg.ValidateBasic()
if tc.wantErr {
Expand Down
1 change: 0 additions & 1 deletion x/fungible/types/message_unpause_zrc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func TestMsgUnpauseZRC20_ValidateBasic(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
err := tc.msg.ValidateBasic()
if tc.wantErr {
Expand Down
1 change: 0 additions & 1 deletion x/observer/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
nodeAccountList := k.GetAllNodeAccount(ctx)
nodeAccounts := make([]*types.NodeAccount, len(nodeAccountList))
for i, elem := range nodeAccountList {
elem := elem
nodeAccounts[i] = &elem
}

Expand Down
1 change: 0 additions & 1 deletion x/observer/keeper/grpc_query_node_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestNodeAccountQuerySingle(t *testing.T) {
err: status.Error(codes.InvalidArgument, "invalid request"),
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
response, err := k.NodeAccount(wctx, tc.request)
if tc.err != nil {
Expand Down
1 change: 0 additions & 1 deletion x/observer/keeper/grpc_query_nonces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func TestChainNoncesQuerySingle(t *testing.T) {
err: status.Error(codes.InvalidArgument, "invalid request"),
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
response, err := k.ChainNonces(wctx, tc.request)
if tc.err != nil {
Expand Down
2 changes: 0 additions & 2 deletions x/observer/keeper/grpc_query_tss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestTSSQuerySingle(t *testing.T) {
response: &types.QueryGetTSSResponse{TSS: tss},
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
if !tc.skipSettingTss {
k.SetTSS(ctx, tss)
Expand Down Expand Up @@ -81,7 +80,6 @@ func TestTSSQueryHistory(t *testing.T) {
err: nil,
},
} {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
tssList := sample.TssList(tc.tssCount)
for _, tss := range tssList {
Expand Down
1 change: 0 additions & 1 deletion x/observer/simulation/decoders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func TestNewDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]))
})
Expand Down
3 changes: 0 additions & 3 deletions x/observer/types/ballot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ func TestBallot_AddVote(t *testing.T) {
},
}
for _, test := range tt {
test := test
t.Run(test.name, func(t *testing.T) {
ballot := Ballot{
Index: "index",
Expand Down Expand Up @@ -396,7 +395,6 @@ func TestBallot_IsFinalizingVote(t *testing.T) {
},
}
for _, test := range tt {
test := test
t.Run(test.name, func(t *testing.T) {

ballot := Ballot{
Expand Down Expand Up @@ -733,7 +731,6 @@ func Test_BuildRewardsDistribution(t *testing.T) {
},
}}
for _, test := range tt {
test := test
t.Run(test.name, func(t *testing.T) {
result := BuildRewardsDistribution(test.ballotList)
require.Equal(t, test.expectedMap, result)
Expand Down