channel

package
v0.0.0-...-2897c99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthChannel        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowChannel          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupChannel = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Channel_Order_name = map[int32]string{
	0: "ORDER_NONE_UNSPECIFIED",
	1: "ORDER_UNORDERED",
	2: "ORDER_ORDERED",
}
View Source
var Channel_Order_value = map[string]int32{
	"ORDER_NONE_UNSPECIFIED": 0,
	"ORDER_UNORDERED":        1,
	"ORDER_ORDERED":          2,
}
View Source
var Channel_State_name = map[int32]string{
	0: "STATE_UNINITIALIZED_UNSPECIFIED",
	1: "STATE_INIT",
	2: "STATE_TRYOPEN",
	3: "STATE_OPEN",
	4: "STATE_CLOSED",
}
View Source
var Channel_State_value = map[string]int32{
	"STATE_UNINITIALIZED_UNSPECIFIED": 0,
	"STATE_INIT":                      1,
	"STATE_TRYOPEN":                   2,
	"STATE_OPEN":                      3,
	"STATE_CLOSED":                    4,
}

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// current state of the channel end
	State Channel_State `protobuf:"varint,1,opt,name=state,proto3,enum=Channel_State" json:"state,omitempty"`
	// whether the channel is ordered or unordered
	Ordering Channel_Order `protobuf:"varint,2,opt,name=ordering,proto3,enum=Channel_Order" json:"ordering,omitempty"`
	// counterparty channel end
	Counterparty Channel_Counterparty `protobuf:"bytes,3,opt,name=counterparty,proto3" json:"counterparty"`
	// list of connection identifiers, in order, along which packets sent on
	// this channel will travel
	ConnectionHops []string `` /* 126-byte string literal not displayed */
	// opaque channel version, which is agreed upon during the handshake
	Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
}

Channel defines pipeline for exactly-once packet delivery between specific modules on separate blockchains, which has at least one end capable of sending packets and one end capable of receiving packets.

func (*Channel) Descriptor

func (*Channel) Descriptor() ([]byte, []int)

func (*Channel) Marshal

func (m *Channel) Marshal() (dAtA []byte, err error)

func (*Channel) MarshalTo

func (m *Channel) MarshalTo(dAtA []byte) (int, error)

func (*Channel) MarshalToSizedBuffer

func (m *Channel) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Channel) ProtoMessage

func (*Channel) ProtoMessage()

func (*Channel) Reset

func (m *Channel) Reset()

func (*Channel) Size

func (m *Channel) Size() (n int)

func (*Channel) String

func (m *Channel) String() string

func (*Channel) Unmarshal

func (m *Channel) Unmarshal(dAtA []byte) error

func (*Channel) XXX_DiscardUnknown

func (m *Channel) XXX_DiscardUnknown()

func (*Channel) XXX_Marshal

func (m *Channel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Channel) XXX_Merge

func (m *Channel) XXX_Merge(src proto.Message)

func (*Channel) XXX_Size

func (m *Channel) XXX_Size() int

func (*Channel) XXX_Unmarshal

func (m *Channel) XXX_Unmarshal(b []byte) error

type Channel_Counterparty

type Channel_Counterparty struct {
	// port on the counterparty chain which owns the other end of the channel.
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"`
	// channel end on the counterparty chain
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"`
}

Counterparty defines a channel end counterparty

func (*Channel_Counterparty) Descriptor

func (*Channel_Counterparty) Descriptor() ([]byte, []int)

func (*Channel_Counterparty) Marshal

func (m *Channel_Counterparty) Marshal() (dAtA []byte, err error)

func (*Channel_Counterparty) MarshalTo

func (m *Channel_Counterparty) MarshalTo(dAtA []byte) (int, error)

func (*Channel_Counterparty) MarshalToSizedBuffer

func (m *Channel_Counterparty) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Channel_Counterparty) ProtoMessage

func (*Channel_Counterparty) ProtoMessage()

func (*Channel_Counterparty) Reset

func (m *Channel_Counterparty) Reset()

func (*Channel_Counterparty) Size

func (m *Channel_Counterparty) Size() (n int)

func (*Channel_Counterparty) String

func (m *Channel_Counterparty) String() string

func (*Channel_Counterparty) Unmarshal

func (m *Channel_Counterparty) Unmarshal(dAtA []byte) error

func (*Channel_Counterparty) XXX_DiscardUnknown

func (m *Channel_Counterparty) XXX_DiscardUnknown()

func (*Channel_Counterparty) XXX_Marshal

func (m *Channel_Counterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Channel_Counterparty) XXX_Merge

func (m *Channel_Counterparty) XXX_Merge(src proto.Message)

func (*Channel_Counterparty) XXX_Size

func (m *Channel_Counterparty) XXX_Size() int

func (*Channel_Counterparty) XXX_Unmarshal

func (m *Channel_Counterparty) XXX_Unmarshal(b []byte) error

type Channel_IdentifiedChannel

type Channel_IdentifiedChannel struct {
	// current state of the channel end
	State Channel_State `protobuf:"varint,1,opt,name=state,proto3,enum=Channel_State" json:"state,omitempty"`
	// whether the channel is ordered or unordered
	Ordering Channel_Order `protobuf:"varint,2,opt,name=ordering,proto3,enum=Channel_Order" json:"ordering,omitempty"`
	// counterparty channel end
	Counterparty Channel_Counterparty `protobuf:"bytes,3,opt,name=counterparty,proto3" json:"counterparty"`
	// list of connection identifiers, in order, along which packets sent on
	// this channel will travel
	ConnectionHops []string `` /* 126-byte string literal not displayed */
	// opaque channel version, which is agreed upon during the handshake
	Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
	// port identifier
	PortId string `protobuf:"bytes,6,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"`
	// channel identifier
	ChannelId string `protobuf:"bytes,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
}

IdentifiedChannel defines a channel with additional port and channel identifier fields.

func (*Channel_IdentifiedChannel) Descriptor

func (*Channel_IdentifiedChannel) Descriptor() ([]byte, []int)

func (*Channel_IdentifiedChannel) Marshal

func (m *Channel_IdentifiedChannel) Marshal() (dAtA []byte, err error)

func (*Channel_IdentifiedChannel) MarshalTo

func (m *Channel_IdentifiedChannel) MarshalTo(dAtA []byte) (int, error)

func (*Channel_IdentifiedChannel) MarshalToSizedBuffer

func (m *Channel_IdentifiedChannel) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Channel_IdentifiedChannel) ProtoMessage

func (*Channel_IdentifiedChannel) ProtoMessage()

func (*Channel_IdentifiedChannel) Reset

func (m *Channel_IdentifiedChannel) Reset()

func (*Channel_IdentifiedChannel) Size

func (m *Channel_IdentifiedChannel) Size() (n int)

func (*Channel_IdentifiedChannel) String

func (m *Channel_IdentifiedChannel) String() string

func (*Channel_IdentifiedChannel) Unmarshal

func (m *Channel_IdentifiedChannel) Unmarshal(dAtA []byte) error

func (*Channel_IdentifiedChannel) XXX_DiscardUnknown

func (m *Channel_IdentifiedChannel) XXX_DiscardUnknown()

func (*Channel_IdentifiedChannel) XXX_Marshal

func (m *Channel_IdentifiedChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Channel_IdentifiedChannel) XXX_Merge

func (m *Channel_IdentifiedChannel) XXX_Merge(src proto.Message)

func (*Channel_IdentifiedChannel) XXX_Size

func (m *Channel_IdentifiedChannel) XXX_Size() int

func (*Channel_IdentifiedChannel) XXX_Unmarshal

func (m *Channel_IdentifiedChannel) XXX_Unmarshal(b []byte) error

type Channel_Order

type Channel_Order int32

Order defines if a channel is ORDERED or UNORDERED

const (
	// zero-value for channel ordering
	NONE Channel_Order = 0
	// packets can be delivered in any order, which may differ from the order in
	// which they were sent.
	UNORDERED Channel_Order = 1
	// packets are delivered exactly in the order which they were sent
	ORDERED Channel_Order = 2
)

func (Channel_Order) EnumDescriptor

func (Channel_Order) EnumDescriptor() ([]byte, []int)

func (Channel_Order) String

func (x Channel_Order) String() string

type Channel_State

type Channel_State int32

State defines if a channel is in one of the following states: CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.

const (
	// Default State
	UNINITIALIZED Channel_State = 0
	// A channel has just started the opening handshake.
	INIT Channel_State = 1
	// A channel has acknowledged the handshake step on the counterparty chain.
	TRYOPEN Channel_State = 2
	// A channel has completed the handshake. Open channels are
	// ready to send and receive packets.
	OPEN Channel_State = 3
	// A channel has been closed and can no longer be used to send or receive
	// packets.
	CLOSED Channel_State = 4
)

func (Channel_State) EnumDescriptor

func (Channel_State) EnumDescriptor() ([]byte, []int)

func (Channel_State) String

func (x Channel_State) String() string

type Packet

type Packet struct {
	// number corresponds to the order of sends and receives, where a Packet
	// with an earlier sequence number must be sent and received before a Packet
	// with a later sequence number.
	Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
	// identifies the port on the sending chain.
	SourcePort string `protobuf:"bytes,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"`
	// identifies the channel end on the sending chain.
	SourceChannel string `protobuf:"bytes,3,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"`
	// identifies the port on the receiving chain.
	DestinationPort string `` /* 130-byte string literal not displayed */
	// identifies the channel end on the receiving chain.
	DestinationChannel string `` /* 142-byte string literal not displayed */
	// actual opaque bytes transferred directly to the application module
	Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
	// block height after which the packet times out
	TimeoutHeight client.Height `protobuf:"bytes,7,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// block timestamp (in nanoseconds) after which the packet times out
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
}

Packet defines a type that carries data across different chains through IBC

func NewPacket

func NewPacket(
	data []byte,
	sequence uint64, sourcePort, sourceChannel,
	destinationPort, destinationChannel string,
	timeoutHeight client.Height, timeoutTimestamp uint64,
) Packet

NewPacket creates a new Packet instance.

func (*Packet) Descriptor

func (*Packet) Descriptor() ([]byte, []int)

func (*Packet) Marshal

func (m *Packet) Marshal() (dAtA []byte, err error)

func (*Packet) MarshalTo

func (m *Packet) MarshalTo(dAtA []byte) (int, error)

func (*Packet) MarshalToSizedBuffer

func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) Reset

func (m *Packet) Reset()

func (*Packet) Size

func (m *Packet) Size() (n int)

func (*Packet) String

func (m *Packet) String() string

func (*Packet) Unmarshal

func (m *Packet) Unmarshal(dAtA []byte) error

func (*Packet) XXX_DiscardUnknown

func (m *Packet) XXX_DiscardUnknown()

func (*Packet) XXX_Marshal

func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Packet) XXX_Merge

func (m *Packet) XXX_Merge(src proto.Message)

func (*Packet) XXX_Size

func (m *Packet) XXX_Size() int

func (*Packet) XXX_Unmarshal

func (m *Packet) XXX_Unmarshal(b []byte) error

type PacketState

type PacketState struct {
	// channel port identifier.
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"`
	// channel unique identifier.
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"`
	// packet sequence.
	Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"`
	// embedded data that represents packet state.
	Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
}

PacketState defines the generic type necessary to retrieve and store packet commitments, acknowledgements, and receipts. Caller is responsible for knowing the context necessary to interpret this state as a commitment, acknowledgement, or a receipt.

func (*PacketState) Descriptor

func (*PacketState) Descriptor() ([]byte, []int)

func (*PacketState) Marshal

func (m *PacketState) Marshal() (dAtA []byte, err error)

func (*PacketState) MarshalTo

func (m *PacketState) MarshalTo(dAtA []byte) (int, error)

func (*PacketState) MarshalToSizedBuffer

func (m *PacketState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PacketState) ProtoMessage

func (*PacketState) ProtoMessage()

func (*PacketState) Reset

func (m *PacketState) Reset()

func (*PacketState) Size

func (m *PacketState) Size() (n int)

func (*PacketState) String

func (m *PacketState) String() string

func (*PacketState) Unmarshal

func (m *PacketState) Unmarshal(dAtA []byte) error

func (*PacketState) XXX_DiscardUnknown

func (m *PacketState) XXX_DiscardUnknown()

func (*PacketState) XXX_Marshal

func (m *PacketState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PacketState) XXX_Merge

func (m *PacketState) XXX_Merge(src proto.Message)

func (*PacketState) XXX_Size

func (m *PacketState) XXX_Size() int

func (*PacketState) XXX_Unmarshal

func (m *PacketState) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL