Documentation
¶
Index ¶
- Constants
- Variables
- func GetModuleOwner(modules []string) string
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type FacadedMiddleware
- func (f *FacadedMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (f *FacadedMiddleware) NegotiateAppVersion(ctx sdk.Context, order channeltypes.Order, connectionID string, portID string, ...) (version string, err error)
- func (f *FacadedMiddleware) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, ...) error
- func (f *FacadedMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error
- func (f *FacadedMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error
- func (f *FacadedMiddleware) OnChanOpenAck(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, ...) error
- func (f *FacadedMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error
- func (f *FacadedMiddleware) OnChanOpenInit(ctx sdk.Context, order channeltypes.Order, connectionHops []string, ...) (string, error)
- func (f *FacadedMiddleware) OnChanOpenTry(ctx sdk.Context, order channeltypes.Order, connectionHops []string, ...) (string, error)
- func (f *FacadedMiddleware) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) exported.Acknowledgement
- func (f *FacadedMiddleware) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error
- func (f *FacadedMiddleware) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error
- func (f *FacadedMiddleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ...) error
- type IBCModule
- type ICS4Wrapper
- type Middleware
- type QueryAppVersionRequest
- func (*QueryAppVersionRequest) Descriptor() ([]byte, []int)
- func (m *QueryAppVersionRequest) GetConnectionId() string
- func (m *QueryAppVersionRequest) GetCounterparty() *types.Counterparty
- func (m *QueryAppVersionRequest) GetOrdering() types.Order
- func (m *QueryAppVersionRequest) GetPortId() string
- func (m *QueryAppVersionRequest) GetProposedVersion() string
- func (m *QueryAppVersionRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryAppVersionRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryAppVersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryAppVersionRequest) ProtoMessage()
- func (m *QueryAppVersionRequest) Reset()
- func (m *QueryAppVersionRequest) Size() (n int)
- func (m *QueryAppVersionRequest) String() string
- func (m *QueryAppVersionRequest) Unmarshal(dAtA []byte) error
- func (m *QueryAppVersionRequest) XXX_DiscardUnknown()
- func (m *QueryAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryAppVersionRequest) XXX_Merge(src proto.Message)
- func (m *QueryAppVersionRequest) XXX_Size() int
- func (m *QueryAppVersionRequest) XXX_Unmarshal(b []byte) error
- type QueryAppVersionResponse
- func (*QueryAppVersionResponse) Descriptor() ([]byte, []int)
- func (m *QueryAppVersionResponse) GetPortId() string
- func (m *QueryAppVersionResponse) GetVersion() string
- func (m *QueryAppVersionResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryAppVersionResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryAppVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryAppVersionResponse) ProtoMessage()
- func (m *QueryAppVersionResponse) Reset()
- func (m *QueryAppVersionResponse) Size() (n int)
- func (m *QueryAppVersionResponse) String() string
- func (m *QueryAppVersionResponse) Unmarshal(dAtA []byte) error
- func (m *QueryAppVersionResponse) XXX_DiscardUnknown()
- func (m *QueryAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryAppVersionResponse) XXX_Merge(src proto.Message)
- func (m *QueryAppVersionResponse) XXX_Size() int
- func (m *QueryAppVersionResponse) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type Router
- type UnimplementedQueryServer
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
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type FacadedMiddleware ¶ added in v1.6.7
type FacadedMiddleware struct {
*common.SelectorStrategy
}
func (*FacadedMiddleware) GetAppVersion ¶ added in v1.6.7
func (*FacadedMiddleware) NegotiateAppVersion ¶ added in v1.6.7
func (f *FacadedMiddleware) NegotiateAppVersion(ctx sdk.Context, order channeltypes.Order, connectionID string, portID string, counterparty channeltypes.Counterparty, proposedVersion string) (version string, err error)
func (*FacadedMiddleware) OnAcknowledgementPacket ¶ added in v1.6.7
func (f *FacadedMiddleware) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error
func (*FacadedMiddleware) OnChanCloseConfirm ¶ added in v1.6.7
func (f *FacadedMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error
func (*FacadedMiddleware) OnChanCloseInit ¶ added in v1.6.7
func (f *FacadedMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error
func (*FacadedMiddleware) OnChanOpenAck ¶ added in v1.6.7
func (*FacadedMiddleware) OnChanOpenConfirm ¶ added in v1.6.7
func (f *FacadedMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error
func (*FacadedMiddleware) OnChanOpenInit ¶ added in v1.6.7
func (f *FacadedMiddleware) OnChanOpenInit(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) (string, error)
func (*FacadedMiddleware) OnChanOpenTry ¶ added in v1.6.7
func (f *FacadedMiddleware) OnChanOpenTry(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version, counterpartyVersion string) (string, error)
func (*FacadedMiddleware) OnRecvPacket ¶ added in v1.6.7
func (f *FacadedMiddleware) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) exported.Acknowledgement
func (*FacadedMiddleware) OnTimeoutPacket ¶ added in v1.6.7
func (f *FacadedMiddleware) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error
func (*FacadedMiddleware) SendPacket ¶ added in v1.6.7
func (f *FacadedMiddleware) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error
func (*FacadedMiddleware) WriteAcknowledgement ¶ added in v1.6.7
func (f *FacadedMiddleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error
type IBCModule ¶
type IBCModule interface { OnChanOpenInit( ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, ) (string, error) OnChanOpenTry( ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version, counterpartyVersion string, ) (string, error) OnChanOpenAck( ctx sdk.Context, portID, channelID string, counterpartyChannelID 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 must return an acknowledgement that implements the Acknowledgement interface. // In the case of an asynchronous acknowledgement, nil should be returned. // If the acknowledgement returned is successful, the state changes on callback are written, // otherwise the application state changes are discarded. In either case the packet is received // and the acknowledgement is written (in synchronous cases). OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) exported.Acknowledgement OnAcknowledgementPacket( ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress, ) error OnTimeoutPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) error // NegotiateAppVersion performs application version negotiation given the provided channel ordering, connectionID, portID, counterparty and proposed version. // An error is returned if version negotiation cannot be performed. For example, an application module implementing this interface // may decide to return an error in the event of the proposed version being incompatible with it's own NegotiateAppVersion( ctx sdk.Context, order channeltypes.Order, connectionID string, portID string, counterparty channeltypes.Counterparty, proposedVersion string, ) (version string, err error) }
IBCModule defines an interface that implements all the callbacks that modules must define as specified in ICS-26
type ICS4Wrapper ¶ added in v1.6.7
type ICS4Wrapper interface { SendPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ) error WriteAcknowledgement( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement, ) error GetAppVersion( ctx sdk.Context, portID, channelID string, ) (string, bool) }
ICS4Wrapper implements the ICS4 interfaces that IBC applications use to send packets and acknowledgements.
type Middleware ¶ added in v1.6.7
type Middleware interface { IBCModule ICS4Wrapper }
Middleware must implement IBCModule to wrap communication from core IBC to underlying application and ICS4Wrapper to wrap communication from underlying application to core IBC.
func NewFacadedMiddleware ¶ added in v1.6.7
func NewFacadedMiddleware(defaultMiddleware Middleware, factories ...common.SelectorFactory) Middleware
type QueryAppVersionRequest ¶
type QueryAppVersionRequest struct { // port unique identifier PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` // connection unique identifier ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` // whether the channel is ordered or unordered Ordering types.Order `protobuf:"varint,3,opt,name=ordering,proto3,enum=ibc.core.channel.v1.Order" json:"ordering,omitempty"` // counterparty channel end Counterparty *types.Counterparty `protobuf:"bytes,4,opt,name=counterparty,proto3" json:"counterparty,omitempty"` // proposed version ProposedVersion string `protobuf:"bytes,5,opt,name=proposed_version,json=proposedVersion,proto3" json:"proposed_version,omitempty"` }
QueryAppVersionRequest is the request type for the Query/AppVersion RPC method
func (*QueryAppVersionRequest) Descriptor ¶
func (*QueryAppVersionRequest) Descriptor() ([]byte, []int)
func (*QueryAppVersionRequest) GetConnectionId ¶
func (m *QueryAppVersionRequest) GetConnectionId() string
func (*QueryAppVersionRequest) GetCounterparty ¶
func (m *QueryAppVersionRequest) GetCounterparty() *types.Counterparty
func (*QueryAppVersionRequest) GetOrdering ¶
func (m *QueryAppVersionRequest) GetOrdering() types.Order
func (*QueryAppVersionRequest) GetPortId ¶
func (m *QueryAppVersionRequest) GetPortId() string
func (*QueryAppVersionRequest) GetProposedVersion ¶
func (m *QueryAppVersionRequest) GetProposedVersion() string
func (*QueryAppVersionRequest) Marshal ¶
func (m *QueryAppVersionRequest) Marshal() (dAtA []byte, err error)
func (*QueryAppVersionRequest) MarshalTo ¶
func (m *QueryAppVersionRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryAppVersionRequest) MarshalToSizedBuffer ¶
func (m *QueryAppVersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryAppVersionRequest) ProtoMessage ¶
func (*QueryAppVersionRequest) ProtoMessage()
func (*QueryAppVersionRequest) Reset ¶
func (m *QueryAppVersionRequest) Reset()
func (*QueryAppVersionRequest) Size ¶
func (m *QueryAppVersionRequest) Size() (n int)
func (*QueryAppVersionRequest) String ¶
func (m *QueryAppVersionRequest) String() string
func (*QueryAppVersionRequest) Unmarshal ¶
func (m *QueryAppVersionRequest) Unmarshal(dAtA []byte) error
func (*QueryAppVersionRequest) XXX_DiscardUnknown ¶
func (m *QueryAppVersionRequest) XXX_DiscardUnknown()
func (*QueryAppVersionRequest) XXX_Marshal ¶
func (m *QueryAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryAppVersionRequest) XXX_Merge ¶
func (m *QueryAppVersionRequest) XXX_Merge(src proto.Message)
func (*QueryAppVersionRequest) XXX_Size ¶
func (m *QueryAppVersionRequest) XXX_Size() int
func (*QueryAppVersionRequest) XXX_Unmarshal ¶
func (m *QueryAppVersionRequest) XXX_Unmarshal(b []byte) error
type QueryAppVersionResponse ¶
type QueryAppVersionResponse struct { // port id associated with the request identifiers PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` // supported app version Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` }
QueryAppVersionResponse is the response type for the Query/AppVersion RPC method.
func NewQueryAppVersionResponse ¶
func NewQueryAppVersionResponse(portID, version string) *QueryAppVersionResponse
NewQueryAppVersionResponse creates a new QueryAppVersionResponse instance
func (*QueryAppVersionResponse) Descriptor ¶
func (*QueryAppVersionResponse) Descriptor() ([]byte, []int)
func (*QueryAppVersionResponse) GetPortId ¶
func (m *QueryAppVersionResponse) GetPortId() string
func (*QueryAppVersionResponse) GetVersion ¶
func (m *QueryAppVersionResponse) GetVersion() string
func (*QueryAppVersionResponse) Marshal ¶
func (m *QueryAppVersionResponse) Marshal() (dAtA []byte, err error)
func (*QueryAppVersionResponse) MarshalTo ¶
func (m *QueryAppVersionResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryAppVersionResponse) MarshalToSizedBuffer ¶
func (m *QueryAppVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryAppVersionResponse) ProtoMessage ¶
func (*QueryAppVersionResponse) ProtoMessage()
func (*QueryAppVersionResponse) Reset ¶
func (m *QueryAppVersionResponse) Reset()
func (*QueryAppVersionResponse) Size ¶
func (m *QueryAppVersionResponse) Size() (n int)
func (*QueryAppVersionResponse) String ¶
func (m *QueryAppVersionResponse) String() string
func (*QueryAppVersionResponse) Unmarshal ¶
func (m *QueryAppVersionResponse) Unmarshal(dAtA []byte) error
func (*QueryAppVersionResponse) XXX_DiscardUnknown ¶
func (m *QueryAppVersionResponse) XXX_DiscardUnknown()
func (*QueryAppVersionResponse) XXX_Marshal ¶
func (m *QueryAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryAppVersionResponse) XXX_Merge ¶
func (m *QueryAppVersionResponse) XXX_Merge(src proto.Message)
func (*QueryAppVersionResponse) XXX_Size ¶
func (m *QueryAppVersionResponse) XXX_Size() int
func (*QueryAppVersionResponse) XXX_Unmarshal ¶
func (m *QueryAppVersionResponse) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { // AppVersion queries an IBC Port and determines the appropriate application version to be used AppVersion(ctx context.Context, in *QueryAppVersionRequest, opts ...grpc.CallOption) (*QueryAppVersionResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryServer ¶
type QueryServer interface { // AppVersion queries an IBC Port and determines the appropriate application version to be used AppVersion(context.Context, *QueryAppVersionRequest) (*QueryAppVersionResponse, error) }
QueryServer is the server API for Query service.
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.
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) AppVersion ¶
func (*UnimplementedQueryServer) AppVersion(ctx context.Context, req *QueryAppVersionRequest) (*QueryAppVersionResponse, error)