Genesis state

This commit is contained in:
Christopher Goes
2018-07-17 20:33:53 +02:00
parent d171dbf913
commit cbc9d7d1da
2 changed files with 25 additions and 10 deletions
+16 -2
View File
@@ -10,6 +10,7 @@ import (
gaia "github.com/cosmos/cosmos-sdk/cmd/gaia/app"
"github.com/cosmos/cosmos-sdk/x/mock/simulation"
stake "github.com/cosmos/cosmos-sdk/x/stake"
)
const (
@@ -19,15 +20,28 @@ const (
)
func TestFullGaiaSimulation(t *testing.T) {
// Setup Gaia application
logger := log.NewNopLogger()
db := dbm.NewMemDB()
app := gaia.NewGaiaApp(logger, db, nil)
require.Equal(t, "GaiaApp", app.Name())
// Default genesis state
genesis := gaia.GenesisState{
Accounts: []gaia.GenesisAccount{},
StakeData: stake.DefaultGenesisState(),
}
// Marshal genesis
appState, err := gaia.MakeCodec().MarshalJSON(genesis)
if err != nil {
panic(err)
}
// Run randomized simulation
simulation.RandomizedTesting(
t, app.BaseApp,
simulation.Simulate(
t, app.BaseApp, appState,
[]simulation.TestAndRunTx{},
[]simulation.RandSetup{},
[]simulation.Invariant{},