Gaia simulation needs internal field access

This commit is contained in:
Christopher Goes
2018-07-17 23:06:30 +02:00
parent af206bd0ed
commit eda7eb48cd
2 changed files with 14 additions and 9 deletions
@@ -1,6 +1,7 @@
package simulation
package app
import (
"os"
"testing"
"github.com/stretchr/testify/require"
@@ -8,7 +9,6 @@ import (
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
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"
)
@@ -17,24 +17,29 @@ const (
NumKeys = 10
NumBlocks = 1000
BlockSize = 1000
simulationEnv = "ENABLE_GAIA_SIMULATION"
)
func TestFullGaiaSimulation(t *testing.T) {
if os.Getenv(simulationEnv) == "" {
t.Skip("Skipping Gaia simulation")
}
// Setup Gaia application
logger := log.NewNopLogger()
db := dbm.NewMemDB()
app := gaia.NewGaiaApp(logger, db, nil)
app := NewGaiaApp(logger, db, nil)
require.Equal(t, "GaiaApp", app.Name())
// Default genesis state
genesis := gaia.GenesisState{
Accounts: []gaia.GenesisAccount{},
genesis := GenesisState{
Accounts: []GenesisAccount{},
StakeData: stake.DefaultGenesisState(),
}
// Marshal genesis
appState, err := gaia.MakeCodec().MarshalJSON(genesis)
appState, err := MakeCodec().MarshalJSON(genesis)
if err != nil {
panic(err)
}