Documentation
¶
Index ¶
Constants ¶
const ( // SubModuleName defines the IBC port name SubModuleName = "port" // StoreKey is the store key string for IBC ports StoreKey = SubModuleName // RouterKey is the message route for IBC ports RouterKey = SubModuleName // QuerierRoute is the querier route for IBC ports QuerierRoute = SubModuleName )
Variables ¶
var ( ErrPortExists = sdkerrors.Register(SubModuleName, 2, "port is already binded") ErrPortNotFound = sdkerrors.Register(SubModuleName, 3, "port not found") ErrInvalidPort = sdkerrors.Register(SubModuleName, 4, "invalid port") ErrInvalidRoute = sdkerrors.Register(SubModuleName, 5, "route not found") )
IBC port sentinel errors
Functions ¶
func GetModuleOwner ¶
GetModuleOwner enforces that only IBC and the module bound to port can own the capability while future implementations may allow multiple modules to bind to a port, currently we only allow one module to be bound to a port at any given time
Types ¶
type IBCModule ¶
type IBCModule interface {
OnChanOpenInit(
ctx sdk.Context,
order channeltypes.Order,
connectionHops []string,
portID string,
channelID string,
channelCap *capability.Capability,
counterParty channeltypes.Counterparty,
version string,
) error
OnChanOpenTry(
ctx sdk.Context,
order channeltypes.Order,
connectionHops []string,
portID,
channelID string,
channelCap *capability.Capability,
counterparty channeltypes.Counterparty,
version,
counterpartyVersion string,
) error
OnChanOpenAck(
ctx sdk.Context,
portID,
channelID string,
counterpartyVersion string,
) error
OnChanOpenConfirm(
ctx sdk.Context,
portID,
channelID string,
) error
OnChanCloseInit(
ctx sdk.Context,
portID,
channelID string,
) error
OnChanCloseConfirm(
ctx sdk.Context,
portID,
channelID string,
) error
OnRecvPacket(
ctx sdk.Context,
packet channeltypes.Packet,
) (*sdk.Result, error)
OnAcknowledgementPacket(
ctx sdk.Context,
packet channeltypes.Packet,
acknowledgement []byte,
) (*sdk.Result, error)
OnTimeoutPacket(
ctx sdk.Context,
packet channeltypes.Packet,
) (*sdk.Result, error)
}
IBCModule defines an interface that implements all the callbacks that modules must define as specified in ICS-26
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
The router is a map from module name to the IBCModule which contains all the module-defined callbacks required by ICS-26
func (*Router) AddRoute ¶
AddRoute adds IBCModule for a given module name. It returns the Router so AddRoute calls can be linked. It will panic if the Router is sealed.
func (*Router) HasRoute ¶
HasRoute returns true if the Router has a module registered or false otherwise.