2020-04-17 14:08:25 -07:00
|
|
|
package types
|
|
|
|
|
2020-05-14 15:47:11 -07:00
|
|
|
import (
|
|
|
|
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
|
|
|
|
)
|
|
|
|
|
2020-04-17 14:08:25 -07:00
|
|
|
// GenesisState is currently only used to ensure that the InitGenesis gets run
|
|
|
|
// by the module manager
|
|
|
|
type GenesisState struct {
|
2020-05-14 15:47:11 -07:00
|
|
|
PortID string `json:"port_id" yaml:"port_id"`
|
2020-04-17 14:08:25 -07:00
|
|
|
}
|
|
|
|
|
2020-05-14 15:47:11 -07:00
|
|
|
// DefaultGenesisState returns a GenesisState with "transfer" as the default PortID.
|
|
|
|
func DefaultGenesisState() GenesisState {
|
2020-04-17 14:08:25 -07:00
|
|
|
return GenesisState{
|
|
|
|
PortID: PortID,
|
|
|
|
}
|
|
|
|
}
|
2020-05-14 15:47:11 -07:00
|
|
|
|
|
|
|
// Validate performs basic genesis state validation returning an error upon any
|
|
|
|
// failure.
|
|
|
|
func (gs GenesisState) Validate() error {
|
|
|
|
return host.PortIdentifierValidator(gs.PortID)
|
|
|
|
}
|