chore: enable errcheck linter (#16406)

This commit is contained in:
ruthishvitwit
2023-07-12 08:58:27 +00:00
committed by GitHub
parent c5df6a355a
commit fd7e549a3c
140 changed files with 1019 additions and 617 deletions
+10 -2
View File
@@ -102,7 +102,10 @@ func NewIntegrationApp(
}
}
bApp.Commit()
_, err := bApp.Commit()
if err != nil {
panic(err)
}
ctx := sdkCtx.WithBlockHeader(cmtproto.Header{ChainID: appName}).WithIsCheckTx(true)
@@ -129,7 +132,12 @@ func (app *App) RunMsg(msg sdk.Msg, option ...Option) (*codectypes.Any, error) {
}
if cfg.AutomaticCommit {
defer app.Commit()
defer func() {
_, err := app.Commit()
if err != nil {
panic(err)
}
}()
}
if cfg.AutomaticFinalizeBlock {
+1 -1
View File
@@ -744,7 +744,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err
// blocks has been reached.
func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error {
for i := 0; i < blocks; i++ {
n.WaitForNextBlock()
_ = n.WaitForNextBlock()
err := retryFunc()
if err == nil {
return nil
+3 -1
View File
@@ -118,6 +118,8 @@ func initTestStores(t *testing.T) (storetypes.KVStore, storetypes.KVStore) {
key2 := storetypes.NewKVStoreKey("store2")
require.NotPanics(t, func() { ms.MountStoreWithDB(key1, storetypes.StoreTypeIAVL, db) })
require.NotPanics(t, func() { ms.MountStoreWithDB(key2, storetypes.StoreTypeIAVL, db) })
require.NotPanics(t, func() { ms.LoadLatestVersion() })
require.NotPanics(t, func() {
_ = ms.LoadLatestVersion()
})
return ms.GetKVStore(key1), ms.GetKVStore(key2)
}
+2 -2
View File
@@ -141,8 +141,8 @@ func SignCheckDeliver(
require.False(t, finalizeSuccess)
}
app.Commit()
_, err = app.Commit()
require.NoError(t, err)
gInfo := sdk.GasInfo{GasWanted: uint64(txResult.GasWanted), GasUsed: uint64(txResult.GasUsed)}
txRes := sdk.Result{Data: txResult.Data, Log: txResult.Log, Events: txResult.Events}
if finalizeSuccess {