chore: fix all linting (#24101)

This commit is contained in:
Alex | Interchain Labs
2025-03-21 15:04:36 -07:00
committed by GitHub
parent b7fb7f4858
commit 7fd79df4e1
329 changed files with 1282 additions and 1251 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ func (s *System) RunWithInputC(ctx context.Context, in io.Reader, args ...string
rootCmd.SetIn(in)
var res RunResult
rootCmd.SetOutput(&res.Stdout)
rootCmd.SetOut(&res.Stdout)
rootCmd.SetErr(&res.Stderr)
rootCmd.SetArgs(args)
@@ -78,7 +78,7 @@ func (s *System) MustRun(t TestingT, args ...string) RunResult {
}
// MustRunC calls s.RunWithInput, but also calls t.FailNow if RunResult.Err is not nil.
func (s *System) MustRunC(t TestingT, ctx context.Context, args ...string) RunResult { //nolint:revive // As a variation of MustRun, t is more important than ctx.
func (s *System) MustRunC(t TestingT, ctx context.Context, args ...string) RunResult {
t.Helper()
return s.MustRunWithInputC(t, ctx, bytes.NewReader(nil), args...)
@@ -92,7 +92,7 @@ func (s *System) MustRunWithInput(t TestingT, in io.Reader, args ...string) RunR
}
// MustRunWithInputC calls s.RunWithInputC, but also calls t.FailNow if RunResult.Err is not nil.
func (s *System) MustRunWithInputC(t TestingT, ctx context.Context, in io.Reader, args ...string) RunResult { //nolint:revive // As a variation of MustRun, t is more important than ctx.
func (s *System) MustRunWithInputC(t TestingT, ctx context.Context, in io.Reader, args ...string) RunResult {
t.Helper()
res := s.RunWithInputC(ctx, in, args...)
+5 -2
View File
@@ -103,7 +103,10 @@ func NewIntegrationApp(
}
}
bApp.Commit()
_, err := bApp.Commit()
if err != nil {
panic(fmt.Errorf("failed to commit application: %w", err))
}
ctx := sdkCtx.WithBlockHeader(cmtproto.Header{ChainID: appName}).WithIsCheckTx(true)
@@ -130,7 +133,7 @@ func (app *App) RunMsg(msg sdk.Msg, option ...Option) (*codectypes.Any, error) {
}
if cfg.AutomaticCommit {
defer app.Commit()
defer app.Commit() //nolint:errcheck // not needed in testing
}
if cfg.AutomaticFinalizeBlock {
+3 -2
View File
@@ -47,7 +47,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)
})
@@ -110,6 +109,8 @@ func checkDiffResults(t *testing.T, store1, store2 storetypes.KVStore, noDiff bo
}
func initTestStores(t *testing.T) (storetypes.KVStore, storetypes.KVStore) {
t.Helper()
db := dbm.NewMemDB()
ms := rootmulti.NewStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics())
@@ -117,6 +118,6 @@ 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)
}
+4 -1
View File
@@ -96,6 +96,8 @@ func SignCheckDeliver(
t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header types.Header, msgs []sdk.Msg,
chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {
t.Helper()
tx, err := GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),
txCfg,
@@ -140,7 +142,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}