Skip to content

Commit

Permalink
chore: downgrade to tendermint v0.34.x (cosmos#12958)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Aug 20, 2022
1 parent c1c6b77 commit a601167
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
11 changes: 6 additions & 5 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package simapp

import (
"encoding/json"
"os"
"testing"

"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -38,7 +39,7 @@ import (

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
db := dbm.NewMemDB()
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewSimappWithCustomOptions(t, false, SetupOptions{
Logger: logger,
DB: db,
Expand All @@ -55,7 +56,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {

app.Commit()

logger2, _ := log.NewDefaultLogger("plain", "info", false)
logger2 := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
// Making a new app object with the db, so that initchain hasn't been called
app2 := NewSimApp(logger2, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))
_, err := app2.ExportAppStateAndValidators(false, []string{})
Expand All @@ -69,7 +70,7 @@ func TestGetMaccPerms(t *testing.T) {

func TestRunMigrations(t *testing.T) {
db := dbm.NewMemDB()
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))

// Create a new baseapp and configurator for the purpose of this test.
Expand Down Expand Up @@ -201,7 +202,7 @@ func TestRunMigrations(t *testing.T) {

func TestInitGenesisOnMigration(t *testing.T) {
db := dbm.NewMemDB()
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

Expand Down Expand Up @@ -244,7 +245,7 @@ func TestInitGenesisOnMigration(t *testing.T) {

func TestUpgradeStateOnGenesis(t *testing.T) {
db := dbm.NewMemDB()
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewSimappWithCustomOptions(t, false, SetupOptions{
Logger: logger,
DB: db,
Expand Down
3 changes: 1 addition & 2 deletions simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
tmconfig "github.com/tendermint/tendermint/config"
tmos "github.com/tendermint/tendermint/libs/os"
tmrand "github.com/tendermint/tendermint/libs/rand"
tmtime "github.com/tendermint/tendermint/libs/time"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -229,7 +229,6 @@ func initTestnetFiles(
nodeConfig.SetRoot(nodeDir)
nodeConfig.Moniker = nodeDirName
nodeConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657"
nodeConfig.Mode = tmconfig.ModeValidator

if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil {
_ = os.RemoveAll(args.outputDir)
Expand Down
9 changes: 4 additions & 5 deletions test_helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package simapp

import (
"context"
"encoding/json"
"testing"

Expand Down Expand Up @@ -59,7 +58,7 @@ func NewSimappWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptio
t.Helper()

privVal := mock.NewPV()
pubKey, err := privVal.GetPubKey(context.TODO())
pubKey, err := privVal.GetPubKey()
require.NoError(t, err)
// create validator set with single validator
validator := tmtypes.NewValidator(pubKey, 1)
Expand Down Expand Up @@ -101,7 +100,7 @@ func Setup(t *testing.T, isCheckTx bool) *SimApp {
t.Helper()

privVal := mock.NewPV()
pubKey, err := privVal.GetPubKey(context.TODO())
pubKey, err := privVal.GetPubKey()
require.NoError(t, err)

// create validator set with single validator
Expand Down Expand Up @@ -162,7 +161,7 @@ func SetupWithGenesisAccounts(t *testing.T, genAccs []authtypes.GenesisAccount,
t.Helper()

privVal := mock.NewPV()
pubKey, err := privVal.GetPubKey(context.TODO())
pubKey, err := privVal.GetPubKey()
require.NoError(t, err)

// create validator set with single validator
Expand All @@ -178,7 +177,7 @@ func GenesisStateWithSingleValidator(t *testing.T, app *SimApp) GenesisState {
t.Helper()

privVal := mock.NewPV()
pubKey, err := privVal.GetPubKey(context.TODO())
pubKey, err := privVal.GetPubKey()
require.NoError(t, err)

// create validator set with single validator
Expand Down

0 comments on commit a601167

Please sign in to comment.