48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package colinearcore_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
keepertest "colinear/testutil/keeper"
|
|
"colinear/testutil/nullify"
|
|
colinear "colinear/x/colinearcore"
|
|
"colinear/x/colinearcore/types"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGenesis(t *testing.T) {
|
|
genesisState := types.GenesisState{
|
|
Params: types.DefaultParams(),
|
|
|
|
NextAuction: &types.NextAuction{
|
|
AuctionId: 43,
|
|
},
|
|
AuctionList: []types.Auction{
|
|
{
|
|
Index: "0",
|
|
},
|
|
{
|
|
Index: "1",
|
|
},
|
|
},
|
|
LockedUsers: &types.LockedUsers{
|
|
Users: map[string]string{},
|
|
},
|
|
// this line is used by starport scaffolding # genesis/test/state
|
|
}
|
|
|
|
k, ctx := keepertest.ColinearcoreKeeper(t)
|
|
colinear.InitGenesis(ctx, *k, genesisState)
|
|
got := colinear.ExportGenesis(ctx, *k)
|
|
require.NotNil(t, got)
|
|
|
|
nullify.Fill(&genesisState)
|
|
nullify.Fill(got)
|
|
|
|
require.Equal(t, genesisState.NextAuction, got.NextAuction)
|
|
require.ElementsMatch(t, genesisState.AuctionList, got.AuctionList)
|
|
require.Equal(t, genesisState.LockedUsers, got.LockedUsers)
|
|
// this line is used by starport scaffolding # genesis/test/assert
|
|
}
|