refactor: remove defer in loop (#20223)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Tuan Tran
2024-05-29 09:10:24 +00:00
committed by GitHub
co-authored by coderabbitai[bot]
parent e4ec753268
commit 2b34f69e87
6 changed files with 71 additions and 44 deletions
@@ -207,7 +207,6 @@ func (s *CLITestSuite) TestCLISignBatchTotalFees() {
sdk.NewCoins(sendTokens), clitestutil.TestTxConfig{GenOnly: true})
s.Require().NoError(err)
txFile := testutil.WriteToNewTempFile(s.T(), tx.String()+"\n")
defer txFile.Close()
txFiles[i] = txFile.Name()
unsignedTx, err := txCfg.TxJSONDecoder()(tx.Bytes())
@@ -215,6 +214,8 @@ func (s *CLITestSuite) TestCLISignBatchTotalFees() {
txBuilder, err := txCfg.WrapTxBuilder(unsignedTx)
s.Require().NoError(err)
expectedBatchedTotalFee += txBuilder.GetTx().GetFee().AmountOf(tc.denom).Int64()
err = txFile.Close()
s.NoError(err)
}
// Test batch sign