2019-08-28 07:58:25 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
// NewGenesisState creates a new GenesisState object
|
|
|
|
func NewGenesisState(minter Minter, params Params) GenesisState {
|
|
|
|
return GenesisState{
|
|
|
|
Minter: minter,
|
|
|
|
Params: params,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultGenesisState creates a default GenesisState object
|
|
|
|
func DefaultGenesisState() GenesisState {
|
|
|
|
return GenesisState{
|
|
|
|
Minter: DefaultInitialMinter(),
|
|
|
|
Params: DefaultParams(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateGenesis validates the provided genesis state to ensure the
|
|
|
|
// expected invariants holds.
|
|
|
|
func ValidateGenesis(data GenesisState) error {
|
2019-12-10 08:48:57 -08:00
|
|
|
if err := data.Params.Validate(); err != nil {
|
2019-08-28 07:58:25 -07:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return ValidateMinter(data.Minter)
|
|
|
|
}
|