diff --git a/.golangci.yml b/.golangci.yml index 9fd797fb..6049a572 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,7 +2,6 @@ run: tests: true timeout: 15m sort-results: true - exclude-dir: testing/simapp skip-files: - server/grpc/gogoreflection/fix_registration.go - "fix_registration.go" diff --git a/testing/simapp/sim_test.go b/testing/simapp/sim_test.go index c869b9e2..a543244b 100644 --- a/testing/simapp/sim_test.go +++ b/testing/simapp/sim_test.go @@ -141,7 +141,10 @@ func TestAppImportExport(t *testing.T) { fmt.Printf("importing genesis...\n") - _, newDB, newDir, _, _, err := SetupSimulation("leveldb-app-sim-2", "Simulation-2") + _, newDB, newDir, _, skip, err := SetupSimulation("leveldb-app-sim-2", "Simulation-2") + if skip { + t.Skip("skipping application import/export simulation") + } require.NoError(t, err, "simulation setup failed") defer func() { @@ -246,7 +249,10 @@ func TestAppSimulationAfterImport(t *testing.T) { fmt.Printf("importing genesis...\n") - _, newDB, newDir, _, _, err := SetupSimulation("leveldb-app-sim-2", "Simulation-2") + _, newDB, newDir, _, skip, err := SetupSimulation("leveldb-app-sim-2", "Simulation-2") + if skip { + t.Skip("skipping application import/export simulation") + } require.NoError(t, err, "simulation setup failed") defer func() { diff --git a/testing/simapp/test_helpers.go b/testing/simapp/test_helpers.go index c7038d12..e78a7eba 100644 --- a/testing/simapp/test_helpers.go +++ b/testing/simapp/test_helpers.go @@ -235,9 +235,15 @@ func createIncrementalAccounts(accNum int) []sdk.AccAddress { // start at 100 so we can make up to 999 test addresses with valid test addresses for i := 100; i < (accNum + 100); i++ { numString := strconv.Itoa(i) - buffer.WriteString("A58856F0FD53BF058B4909A21AEC019107BA6") // base address string + _, err := buffer.WriteString("A58856F0FD53BF058B4909A21AEC019107BA6") // base address string + if err != nil { + panic(err) + } - buffer.WriteString(numString) // adding on final two digits to make addresses unique + _, err = buffer.WriteString(numString) // adding on final two digits to make addresses unique + if err != nil { + panic(err) + } res, _ := sdk.AccAddressFromHexUnsafe(buffer.String()) bech := res.String() addr, _ := TestAddr(buffer.String(), bech) @@ -328,6 +334,7 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // CheckBalance checks the balance of an account. func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.Coins) { + t.Helper() ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr))) } @@ -340,6 +347,7 @@ func SignAndDeliver( t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { + t.Helper() tx, err := helpers.GenTx( txCfg, msgs, @@ -406,8 +414,15 @@ func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey { // start at 10 to avoid changing 1 to 01, 2 to 02, etc for i := 100; i < (numPubKeys + 100); i++ { numString := strconv.Itoa(i) - buffer.WriteString("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AF") // base pubkey string - buffer.WriteString(numString) // adding on final two digits to make pubkeys unique + + _, err := buffer.WriteString("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AF") // base pubkey string + if err != nil { + panic(err) + } + _, err = buffer.WriteString(numString) // adding on final two digits to make pubkeys unique + if err != nil { + panic(err) + } publicKeys = append(publicKeys, NewPubKeyFromHex(buffer.String())) buffer.Reset() }