Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 21, 2022
1 parent 1205a17 commit 614be15
Show file tree
Hide file tree
Showing 27 changed files with 252 additions and 135 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking Changes


* (simapp) [#12312](https:12278//github.com/cosmos/cosmos-sdk/pull/12312) Remove `skipUpgradeHeights map[int64]bool` and `homePath string` from `NewSimApp` constructor as per migration of `x/upgrade` to app-wiring.
* (testutil) [#12278](https:12278//github.com/cosmos/cosmos-sdk/pull/12278) Move all function from `simapp/helpers` to `testutil/sims`
* (simapp) [#12312](https:12278//github.com/cosmos/cosmos-sdk/pull/12312) Move `simapp.EmptyAppOptions` to `simtestutil.EmptyAppOptions` (`testutil/sims`)
* (simapp) [#12312](https:12278//github.com/cosmos/cosmos-sdk/pull/12312) Remove `skipUpgradeHeights map[int64]bool` and `homePath string` from `NewSimApp` constructor as per migration of `x/upgrade` to app-wiring.
* (testutil) [#12278](https:12278//github.com/cosmos/cosmos-sdk/pull/12278) Move all functions from `simapp/helpers` to `testutil/sims`
* (testutil) [#12233](https://github.com/cosmos/cosmos-sdk/pull/12233) Move `simapp.TestAddr` to `simtestutil.TestAddr` (`testutil/sims`)
* (x/staking) [#12102](https://github.com/cosmos/cosmos-sdk/pull/12102) Staking keeper now is passed by reference instead of copy. Keeper's SetHooks no longer returns keeper. It updates the keeper in place instead.
* (linting) [#12141](https://github.com/cosmos/cosmos-sdk/pull/12141) Fix usability related linting for database. This means removing the infix Prefix from `prefix.NewPrefixWriter` and such so that it is `prefix.NewWriter` and making `db.DBConnection` and such into `db.Connection`
Expand Down
2 changes: 1 addition & 1 deletion baseapp/block_gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestBaseApp_BlockGas(t *testing.T) {
}

encCfg := simapp.MakeTestEncodingConfig()
app = simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, 0, encCfg, simapp.EmptyAppOptions{}, routerOpt)
app = simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, 0, encCfg, simtestutil.EmptyAppOptions{}, routerOpt)
app.InterfaceRegistry().RegisterImplementations((*sdk.Msg)(nil),
&testdata.TestMsg{},
)
Expand Down
2 changes: 1 addition & 1 deletion server/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t
logger, _ := log.NewDefaultLogger("plain", "info", false)
db := dbm.NewMemDB()
encCfg := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(logger, db, nil, true, 0, encCfg, simapp.NewCustomAppOptions(nil, tempDir))
app := simapp.NewSimApp(logger, db, nil, true, 0, encCfg, simtestutil.NewCustomAppOptions(nil, tempDir))

genesisState := simapp.GenesisStateWithSingleValidator(t, app)
stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ")
Expand Down
4 changes: 4 additions & 0 deletions simapp/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ modules:
- name: vesting
config:
"@type": cosmos.vesting.module.v1.Module

- name: upgrade
config:
"@type": cosmos.upgrade.module.v1.Module
11 changes: 6 additions & 5 deletions simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/tests/mocks"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -44,7 +45,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
DB: db,
InvCheckPeriod: 0,
EncConfig: encCfg,
AppOpts: NewCustomAppOptions(nil, DefaultNodeHome),
AppOpts: simtestutil.NewCustomAppOptions(nil, DefaultNodeHome),
})

for acc := range maccPerms {
Expand All @@ -59,7 +60,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {

logger2, _ := log.NewDefaultLogger("plain", "info", false)
// Making a new app object with the db, so that initchain hasn't been called
app2 := NewSimApp(logger2, db, nil, true, 0, encCfg, NewCustomAppOptions(nil, DefaultNodeHome))
app2 := NewSimApp(logger2, db, nil, true, 0, encCfg, simtestutil.NewCustomAppOptions(nil, DefaultNodeHome))
_, err := app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}
Expand All @@ -73,7 +74,7 @@ func TestRunMigrations(t *testing.T) {
db := dbm.NewMemDB()
encCfg := MakeTestEncodingConfig()
logger, _ := log.NewDefaultLogger("plain", "info", false)
app := NewSimApp(logger, db, nil, true, 0, encCfg, NewCustomAppOptions(nil, DefaultNodeHome))
app := NewSimApp(logger, db, nil, true, 0, encCfg, simtestutil.NewCustomAppOptions(nil, DefaultNodeHome))

// Create a new baseapp and configurator for the purpose of this test.
bApp := baseapp.NewBaseApp(app.Name(), logger, db, encCfg.TxConfig.TxDecoder())
Expand Down Expand Up @@ -206,7 +207,7 @@ func TestInitGenesisOnMigration(t *testing.T) {
db := dbm.NewMemDB()
encCfg := MakeTestEncodingConfig()
logger, _ := log.NewDefaultLogger("plain", "info", false)
app := NewSimApp(logger, db, nil, true, 0, encCfg, NewCustomAppOptions(nil, DefaultNodeHome))
app := NewSimApp(logger, db, nil, true, 0, encCfg, simtestutil.NewCustomAppOptions(nil, DefaultNodeHome))
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

// Create a mock module. This module will serve as the new module we're
Expand Down Expand Up @@ -255,7 +256,7 @@ func TestUpgradeStateOnGenesis(t *testing.T) {
DB: db,
InvCheckPeriod: 0,
EncConfig: encCfg,
AppOpts: NewCustomAppOptions(nil, DefaultNodeHome),
AppOpts: simtestutil.NewCustomAppOptions(nil, DefaultNodeHome),
})

// make sure the upgrade keeper has version map in state
Expand Down
5 changes: 3 additions & 2 deletions simapp/sim_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/stretchr/testify/require"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
)
Expand All @@ -30,7 +31,7 @@ func BenchmarkFullAppSimulation(b *testing.B) {
require.NoError(b, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand Down Expand Up @@ -77,7 +78,7 @@ func BenchmarkInvariants(b *testing.B) {
require.NoError(b, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand Down
12 changes: 6 additions & 6 deletions simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestFullAppSimulation(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// run randomized simulation
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -149,7 +149,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

var genesisState GenesisState
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -263,7 +263,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

newApp.InitChain(abci.RequestInitChain{
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestAppStateDeterminism(t *testing.T) {
}

db := dbm.NewMemDB()
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, FlagPeriodValue, MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, DefaultNodeHome), interBlockCacheOpt())

fmt.Printf(
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
Expand Down
27 changes: 1 addition & 26 deletions simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ import (
"cosmossdk.io/math"
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/depinject"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/testutil/mock"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand All @@ -50,7 +47,7 @@ type SetupOptions struct {
func setup(withGenesis bool, invCheckPeriod uint) (*SimApp, GenesisState) {
db := dbm.NewMemDB()
encCdc := MakeTestEncodingConfig()
app := NewSimApp(log.NewNopLogger(), db, nil, true, invCheckPeriod, encCdc, NewCustomAppOptions(nil, DefaultNodeHome))
app := NewSimApp(log.NewNopLogger(), db, nil, true, invCheckPeriod, encCdc, simtestutil.NewCustomAppOptions(nil, DefaultNodeHome))
if withGenesis {
return app, NewDefaultGenesisState(encCdc.Codec)
}
Expand Down Expand Up @@ -379,28 +376,6 @@ func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) {
return &ed25519.PubKey{Key: pkBytes}
}

// EmptyAppOptions is a stub implementing AppOptions
type EmptyAppOptions struct{}

// Get implements AppOptions
func (ao EmptyAppOptions) Get(o string) interface{} {
return nil
}

// AppOptionsMap is a stub implementing AppOptions which can get
type AppOptionsMap map[string]interface{}

func (m AppOptionsMap) Get(key string) interface{} {
return m[key]
}

func NewCustomAppOptions(skipUpgradeHeights []int64, homePath string) servertypes.AppOptions {
return AppOptionsMap{
server.FlagUnsafeSkipUpgrades: skipUpgradeHeights,
flags.FlagHome: homePath,
}
}

// ModuleAccountAddrs provides a list of blocked module accounts from configuration in app.yaml
//
// Ported from SimApp
Expand Down
3 changes: 2 additions & 1 deletion store/streaming/constructor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/store/streaming"
"github.com/cosmos/cosmos-sdk/store/streaming/file"
"github.com/cosmos/cosmos-sdk/store/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
Expand Down Expand Up @@ -59,7 +60,7 @@ func TestLoadStreamingServices(t *testing.T) {
activeStreamersLen int
}{
"empty app options": {
appOpts: simapp.EmptyAppOptions{},
appOpts: simtestutil.EmptyAppOptions{},
},
"all StoreKeys exposed": {
appOpts: streamingAppOptions{keys: []string{"*"}},
Expand Down
3 changes: 2 additions & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/testutil"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -64,7 +65,7 @@ func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor {
return simapp.NewSimApp(
val.Ctx.Logger, dbm.NewMemDB(), nil, true, 0,
encodingCfg,
simapp.NewCustomAppOptions(nil, val.Ctx.Config.RootDir),
simtestutil.NewCustomAppOptions(nil, val.Ctx.Config.RootDir),
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
)
Expand Down
25 changes: 25 additions & 0 deletions testutil/sims/app_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ import (
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/cosmos/cosmos-sdk/depinject"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/testutil/mock"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -220,3 +223,25 @@ func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawM

return genesisState, nil
}

// EmptyAppOptions is a stub implementing AppOptions
type EmptyAppOptions struct{}

// Get implements AppOptions
func (ao EmptyAppOptions) Get(o string) interface{} {
return nil
}

// AppOptionsMap is a stub implementing AppOptions which can get data from a map
type AppOptionsMap map[string]interface{}

func (m AppOptionsMap) Get(key string) interface{} {
return m[key]
}

func NewCustomAppOptions(skipUpgradeHeights []int64, homePath string) servertypes.AppOptions {
return AppOptionsMap{
server.FlagUnsafeSkipUpgrades: skipUpgradeHeights,
flags.FlagHome: homePath,
}
}
3 changes: 2 additions & 1 deletion x/auth/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/simapp"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
db := dbm.NewMemDB()
encCdc := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simapp.NewCustomAppOptions(nil, simapp.DefaultNodeHome))
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simtestutil.NewCustomAppOptions(nil, simapp.DefaultNodeHome))

genesisState := simapp.GenesisStateWithSingleValidator(t, app)
stateBytes, err := tmjson.Marshal(genesisState)
Expand Down
3 changes: 2 additions & 1 deletion x/distribution/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/simapp"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/distribution/types"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
db := dbm.NewMemDB()
encCdc := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simapp.NewCustomAppOptions(nil, simapp.DefaultNodeHome))
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simtestutil.NewCustomAppOptions(nil, simapp.DefaultNodeHome))

genesisState := simapp.GenesisStateWithSingleValidator(t, app)
stateBytes, err := tmjson.Marshal(genesisState)
Expand Down
2 changes: 1 addition & 1 deletion x/gov/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestImportExportQueues(t *testing.T) {
}

db := dbm.NewMemDB()
app2 := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 0, simapp.MakeTestEncodingConfig(), simapp.NewCustomAppOptions(nil, simapp.DefaultNodeHome))
app2 := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 0, simapp.MakeTestEncodingConfig(), simtestutil.NewCustomAppOptions(nil, simapp.DefaultNodeHome))

app2.InitChain(
abci.RequestInitChain{
Expand Down
3 changes: 2 additions & 1 deletion x/gov/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/simapp"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
db := dbm.NewMemDB()
encCdc := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simapp.NewCustomAppOptions(nil, simapp.DefaultNodeHome))
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simtestutil.NewCustomAppOptions(nil, simapp.DefaultNodeHome))

genesisState := simapp.GenesisStateWithSingleValidator(t, app)
stateBytes, err := tmjson.Marshal(genesisState)
Expand Down
3 changes: 2 additions & 1 deletion x/staking/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/simapp"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
db := dbm.NewMemDB()
encCdc := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simapp.NewCustomAppOptions(nil, simapp.DefaultNodeHome))
app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, 5, encCdc, simtestutil.NewCustomAppOptions(nil, simapp.DefaultNodeHome))

genesisState := simapp.GenesisStateWithSingleValidator(t, app)
stateBytes, err := tmjson.Marshal(genesisState)
Expand Down
Loading

0 comments on commit 614be15

Please sign in to comment.