/ Keeper defines the IBC app module keeper
type Keeper struct {
storeKey sdk.StoreKey
cdc codec.BinaryCodec
paramSpace paramtypes.Subspace
channelKeeper types.ChannelKeeper
portKeeper types.PortKeeper
/ ... additional according to custom logic
}
/ NewKeeper creates a new IBC app module Keeper instance
func NewKeeper(
/ args
)
Keeper {
/ ...
return Keeper{
cdc: cdc,
storeKey: key,
paramSpace: paramSpace,
channelKeeper: channelKeeper,
portKeeper: portKeeper,
/ ... additional according to custom logic
}
}
/ GetPort returns the portID for the IBC app module. Used in ExportGenesis
func (k Keeper)
GetPort(ctx sdk.Context)
string {
store := ctx.KVStore(k.storeKey)
return string(store.Get(types.PortKey))
}
/ SetPort sets the portID for the IBC app module. Used in InitGenesis
func (k Keeper)
SetPort(ctx sdk.Context, portID string) {
store := ctx.KVStore(k.storeKey)
store.Set(types.PortKey, []byte(portID))
}
/ ... additional according to custom logic