packets

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypesTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypesTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypesTest = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type ACKSender

type ACKSender interface {
	SendACK(
		ctx sdk.Context,
		ack OutgoingPacketAcknowledgement,
	) error
}

ACKSender defines packet acknowledgement sender interface

func NewBasicACKSender

func NewBasicACKSender() ACKSender

NewBasicACKSender returns a new ACKSender instance

type ChannelKeeper

type ChannelKeeper interface {
	GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
	GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
	SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
	ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
}

ChannelKeeper defines the expected IBC channel keeper

type Header = sptypes.Header

type IncomingPacket

type IncomingPacket interface {
	exported.PacketI
	PacketData() PacketData
	Header() Header
	Payload() PacketDataPayload
}

IncomingPacket defines the interface of incoming packet

func NewIncomingPacket

func NewIncomingPacket(raw exported.PacketI, packetData PacketData, payload PacketDataPayload) IncomingPacket

NewIncomingPacket returns a new IncomingPacket

func UnmarshalIncomingPacket added in v0.0.9

func UnmarshalIncomingPacket(m codec.Codec, raw exported.PacketI) (IncomingPacket, error)

type IncomingPacketAcknowledgement

type IncomingPacketAcknowledgement interface {
	Data() PacketAcknowledgementData
	Header() Header
	Payload() PacketAcknowledgementPayload
}

IncomingPacketAcknowledgement defines the interface of incoming packet acknowledgement

func NewIncomingPacketAcknowledgement

func NewIncomingPacketAcknowledgement(h *Header, payload PacketAcknowledgementPayload) IncomingPacketAcknowledgement

NewIncomingPacketAcknowledgement returns a new IncomingPacketAcknowledgement

func UnmarshalIncomingPacketAcknowledgement added in v0.0.9

func UnmarshalIncomingPacketAcknowledgement(m codec.Codec, ack []byte) (IncomingPacketAcknowledgement, error)

type OutgoingPacket

type OutgoingPacket interface {
	IncomingPacket
	SetPacketData(header Header, payload PacketDataPayload)
}

OutgoingPacket defines the interface of outgoing packet

func NewOutgoingPacket

func NewOutgoingPacket(raw exported.PacketI, packetData PacketData, payload PacketDataPayload) OutgoingPacket

NewOutgoingPacket returns a new OutgoingPacket

type OutgoingPacketAcknowledgement

type OutgoingPacketAcknowledgement interface {
	IncomingPacketAcknowledgement
	SetData(header Header, payload PacketAcknowledgementPayload)
}

OutgoingPacketAcknowledgement defines the interface of outgoing packet acknowledgement

func NewOutgoingPacketAcknowledgement

func NewOutgoingPacketAcknowledgement(h *Header, payload PacketAcknowledgementPayload) OutgoingPacketAcknowledgement

NewOutgoingPacketAcknowledgement returns a new OutgoingPacketAcknowledgement

type PacketAcknowledgementData

type PacketAcknowledgementData = PacketData

func NewPacketAcknowledgementData

func NewPacketAcknowledgementData(h *Header, payload PacketAcknowledgementPayload) PacketAcknowledgementData

NewPacketAcknowledgementData returns a new PacketAcknowledgementData

type PacketAcknowledgementPayload

type PacketAcknowledgementPayload interface {
	proto.Message
	Type() string
	ValidateBasic() error
}

PacketAcknowledgementPayload defines the interface of packet ack's payload

type PacketData

type PacketData = sptypes.PacketData

func NewPacketData

func NewPacketData(h *Header, payload PacketDataPayload) PacketData

NewPacketData returns a new packet data

type PacketDataPayload

type PacketDataPayload interface {
	proto.Message
	Type() string
	ValidateBasic() error
}

PacketDataPayload defines the interface of packet data's payload

type PacketMiddleware

type PacketMiddleware interface {
	// HandleMsg handles sdk.Msg
	HandleMsg(ctx sdk.Context, msg sdk.Msg, ps PacketSender) (sdk.Context, PacketSender, error)
	// HandlePacket handles a packet
	HandlePacket(ctx sdk.Context, packet IncomingPacket, ps PacketSender, as ACKSender) (sdk.Context, PacketSender, ACKSender, error)
	// HandleACK handles a packet and packet ack
	HandleACK(ctx sdk.Context, packet IncomingPacket, ack IncomingPacketAcknowledgement, ps PacketSender) (sdk.Context, PacketSender, error)
}

PacketMiddleware defines middleware interface of handling packets

func NewNOPPacketMiddleware

func NewNOPPacketMiddleware() PacketMiddleware

NewNOPPacketMiddleware returns nopPacketMiddleware

type PacketSendKeeper

type PacketSendKeeper struct {
	// contains filtered or unexported fields
}

func NewPacketSendKeeper

func NewPacketSendKeeper(
	cdc codec.Codec,
	channelKeeper ChannelKeeper,
	portKeeper PortKeeper,
	scopedKeeper capabilitykeeper.ScopedKeeper,
) PacketSendKeeper

func (PacketSendKeeper) SendPacket

func (k PacketSendKeeper) SendPacket(
	ctx sdk.Context,
	packetSender PacketSender,
	payload PacketDataPayload,
	sourcePort,
	sourceChannel,
	destinationPort,
	destinationChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) error

type PacketSender

type PacketSender interface {
	SendPacket(
		ctx sdk.Context,
		channelCap *capabilitytypes.Capability,
		packet OutgoingPacket,
	) error
}

PacketSender defines packet-sender interface

func NewBasicPacketSender

func NewBasicPacketSender(channelKeeper ChannelKeeper) PacketSender

NewBasicPacketSender returns a new PacketSender instance

type PortKeeper

type PortKeeper interface {
	BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}

PortKeeper defines the expected IBC port keeper

type TestPacketDataPayload

type TestPacketDataPayload struct {
}

func (*TestPacketDataPayload) Descriptor

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

func (*TestPacketDataPayload) Marshal

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

func (*TestPacketDataPayload) MarshalTo

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

func (*TestPacketDataPayload) MarshalToSizedBuffer

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

func (*TestPacketDataPayload) ProtoMessage

func (*TestPacketDataPayload) ProtoMessage()

func (*TestPacketDataPayload) Reset

func (m *TestPacketDataPayload) Reset()

func (*TestPacketDataPayload) Size

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

func (*TestPacketDataPayload) String

func (m *TestPacketDataPayload) String() string

func (*TestPacketDataPayload) Unmarshal

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

func (*TestPacketDataPayload) XXX_DiscardUnknown

func (m *TestPacketDataPayload) XXX_DiscardUnknown()

func (*TestPacketDataPayload) XXX_Marshal

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

func (*TestPacketDataPayload) XXX_Merge

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

func (*TestPacketDataPayload) XXX_Size

func (m *TestPacketDataPayload) XXX_Size() int

func (*TestPacketDataPayload) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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