2022-08-25 16:51:14 -07:00
|
|
|
package cosmostest_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
keepertest "cosmos-test/testutil/keeper"
|
|
|
|
"cosmos-test/testutil/nullify"
|
|
|
|
"cosmos-test/x/cosmostest"
|
|
|
|
"cosmos-test/x/cosmostest/types"
|
2022-08-25 16:53:47 -07:00
|
|
|
|
2022-08-25 16:51:14 -07:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGenesis(t *testing.T) {
|
|
|
|
genesisState := types.GenesisState{
|
|
|
|
Params: types.DefaultParams(),
|
|
|
|
|
2022-08-25 18:49:35 -07:00
|
|
|
NextAuction: &types.NextAuction{
|
|
|
|
AuctionId: 43,
|
|
|
|
},
|
|
|
|
AuctionList: []types.Auction{
|
|
|
|
{
|
|
|
|
Index: "0",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Index: "1",
|
|
|
|
},
|
|
|
|
},
|
2022-08-25 16:51:14 -07:00
|
|
|
// this line is used by starport scaffolding # genesis/test/state
|
|
|
|
}
|
|
|
|
|
|
|
|
k, ctx := keepertest.CosmostestKeeper(t)
|
|
|
|
cosmostest.InitGenesis(ctx, *k, genesisState)
|
|
|
|
got := cosmostest.ExportGenesis(ctx, *k)
|
|
|
|
require.NotNil(t, got)
|
|
|
|
|
|
|
|
nullify.Fill(&genesisState)
|
|
|
|
nullify.Fill(got)
|
|
|
|
|
2022-08-25 18:49:35 -07:00
|
|
|
require.Equal(t, genesisState.NextAuction, got.NextAuction)
|
|
|
|
require.ElementsMatch(t, genesisState.AuctionList, got.AuctionList)
|
2022-08-25 16:51:14 -07:00
|
|
|
// this line is used by starport scaffolding # genesis/test/assert
|
|
|
|
}
|