types

package
v0.0.0-...-fb5cf86 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// module name
	ModuleName = "vibc"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const (
	// AsyncVersions is a flag that indicates whether the IBC module supports
	// asynchronous versions.  If it does, then the VM must supply an empty
	// version string to indicate that the VM explicitly (possibly async)
	// performs the Write* method.
	// This flag is created in anticipation of ibc-go implementing async versions,
	// see https://github.com/Agoric/agoric-sdk/issues/9358 for more details.
	AsyncVersions = false
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

Variables

View Source
var (
	ErrInvalidLengthMsgs        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsgs          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (

	// ModuleCdc references the global x/deployment module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/swingset and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)
View Source
var Msg_serviceDesc = _Msg_serviceDesc

Functions

func DefineCustomGetSigners

func DefineCustomGetSigners(options *signing.Options)

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

RegisterCodec registers concrete types on the Amino codec

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the x/swingset interfaces types with the interface registry

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type AcknowledgementPacketEvent

type AcknowledgementPacketEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string            `json:"event" default:"acknowledgementPacket"`
	Target           string            `json:"target,omitempty"`
	ChannelVersion   string            `json:"channelVersion"`
	Packet           agtypes.IBCPacket `json:"packet"`
	Acknowledgement  []byte            `json:"acknowledgement"`
	Relayer          sdk.AccAddress    `json:"relayer"`
}

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
}

type ChannelCloseConfirmEvent

type ChannelCloseConfirmEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string `json:"event" default:"channelCloseConfirm"`
	Target           string `json:"target,omitempty"`
	PortID           string `json:"portID"`
	ChannelID        string `json:"channelID"`
}

type ChannelCloseInitEvent

type ChannelCloseInitEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string `json:"event" default:"channelCloseInit"`
	Target           string `json:"target,omitempty"`
	PortID           string `json:"portID"`
	ChannelID        string `json:"channelID"`
}

type ChannelKeeper

type ChannelKeeper interface {
	GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
	GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channel.Channel, found bool)
	SendPacket(
		ctx sdk.Context,
		sourcePort string,
		sourceChannel string,
		timeoutHeight clienttypes.Height,
		timeoutTimestamp uint64,
		data []byte,
	) (uint64, error)
	WriteAcknowledgement(ctx sdk.Context, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error
	ChanOpenInit(ctx sdk.Context, order channel.Order, connectionHops []string, portID string,
		counterparty channel.Counterparty, version string) (string, error)
	WriteOpenInitChannel(ctx sdk.Context, portID, channelID string, order channel.Order,
		connectionHops []string, counterparty channel.Counterparty, version string)
	WriteOpenTryChannel(ctx sdk.Context, portID, channelID string, order channel.Order,
		connectionHops []string, counterparty channel.Counterparty, version string)
	WriteOpenAckChannel(ctx sdk.Context, portID, channelID, counterpartyVersion, counterpartyChannelID string)
	ChanCloseInit(ctx sdk.Context, portID, channelID string) error
	TimeoutExecuted(ctx sdk.Context, packet channel.Packet) error
}

ChannelKeeper defines the expected IBC channel keeper

type ChannelOpenAckEvent

type ChannelOpenAckEvent struct {
	*vm.ActionHeader    `actionType:"IBC_EVENT"`
	Event               string                    `json:"event" default:"channelOpenAck"`
	PortID              string                    `json:"portID"`
	ChannelID           string                    `json:"channelID"`
	CounterpartyVersion string                    `json:"counterpartyVersion"`
	Counterparty        channeltypes.Counterparty `json:"counterparty"`
	ConnectionHops      []string                  `json:"connectionHops"`
}

type ChannelOpenConfirmEvent

type ChannelOpenConfirmEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string `json:"event" default:"channelOpenConfirm"`
	Target           string `json:"target,omitempty"`
	PortID           string `json:"portID"`
	ChannelID        string `json:"channelID"`
}

type ChannelOpenInitEvent

type ChannelOpenInitEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string                    `json:"event" default:"channelOpenInit"`
	Target           string                    `json:"target,omitempty"`
	Order            string                    `json:"order"`
	ConnectionHops   []string                  `json:"connectionHops"`
	PortID           string                    `json:"portID"`
	ChannelID        string                    `json:"channelID"`
	Counterparty     channeltypes.Counterparty `json:"counterparty"`
	Version          string                    `json:"version"`
	AsyncVersions    bool                      `json:"asyncVersions"`
}

type ChannelOpenTryEvent

type ChannelOpenTryEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string                    `json:"event" default:"channelOpenTry"`
	Target           string                    `json:"target,omitempty"`
	Order            string                    `json:"order"`
	ConnectionHops   []string                  `json:"connectionHops"`
	PortID           string                    `json:"portID"`
	ChannelID        string                    `json:"channelID"`
	Counterparty     channeltypes.Counterparty `json:"counterparty"`
	Version          string                    `json:"version"`
	AsyncVersions    bool                      `json:"asyncVersions"`
}

type ClientKeeper

type ClientKeeper interface {
	GetParams(ctx sdk.Context) clienttypes.Params
	SetParams(ctx sdk.Context, params clienttypes.Params)
}

ClientKeeper defines the expected IBC client keeper

type Height

type Height struct {
	// the revision that the client is currently on
	RevisionNumber uint64 `protobuf:"varint,1,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number"`
	// the height within the given revision
	RevisionHeight uint64 `protobuf:"varint,2,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height"`
}

Height is a local type that enforces amino and gogoproto compatibility for the Height type used in IBC. See ibc/core/client/v1/client.proto for more details on the Height type.

func (*Height) Descriptor

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

func (*Height) Marshal

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

func (*Height) MarshalTo

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

func (*Height) MarshalToSizedBuffer

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

func (*Height) ProtoMessage

func (*Height) ProtoMessage()

func (*Height) Reset

func (m *Height) Reset()

func (*Height) Size

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

func (*Height) String

func (m *Height) String() string

func (*Height) Unmarshal

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

func (*Height) XXX_DiscardUnknown

func (m *Height) XXX_DiscardUnknown()

func (*Height) XXX_Marshal

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

func (*Height) XXX_Merge

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

func (*Height) XXX_Size

func (m *Height) XXX_Size() int

func (*Height) XXX_Unmarshal

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

type IBCModule

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

func NewIBCModule

func NewIBCModule(impl IBCModuleImpl) IBCModule

func (IBCModule) OnAcknowledgementPacket

func (im IBCModule) OnAcknowledgementPacket(
	ctx sdk.Context,
	channelVersion string,
	packet channeltypes.Packet,
	acknowledgement []byte,
	relayer sdk.AccAddress,
) error

func (IBCModule) OnChanCloseConfirm

func (im IBCModule) OnChanCloseConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

func (IBCModule) OnChanCloseInit

func (im IBCModule) OnChanCloseInit(
	ctx sdk.Context,
	portID,
	channelID string,
) error

func (IBCModule) OnChanOpenAck

func (im IBCModule) OnChanOpenAck(
	ctx sdk.Context,
	portID,
	channelID string,
	counterpartyChannelID string,
	counterpartyVersion string,
) error

func (IBCModule) OnChanOpenConfirm

func (im IBCModule) OnChanOpenConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

func (IBCModule) OnChanOpenInit

func (im IBCModule) OnChanOpenInit(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID string,
	channelID string,
	counterparty channeltypes.Counterparty,
	version string,
) (string, error)

Implement IBCModule callbacks

func (IBCModule) OnChanOpenTry

func (im IBCModule) OnChanOpenTry(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID,
	channelID string,
	counterparty channeltypes.Counterparty,
	counterpartyVersion string,
) (string, error)

func (IBCModule) OnRecvPacket

func (im IBCModule) OnRecvPacket(
	ctx sdk.Context,
	channelVersion string,
	packet channeltypes.Packet,
	relayer sdk.AccAddress,
) exported.Acknowledgement

func (IBCModule) OnTimeoutPacket

func (im IBCModule) OnTimeoutPacket(
	ctx sdk.Context,
	channelVersion string,
	packet channeltypes.Packet,
	relayer sdk.AccAddress,
) error

type IBCModuleImpl

type IBCModuleImpl interface {
	GetChannel(ctx sdk.Context, portID, channelID string) (channeltypes.Channel, bool)
	PushAction(ctx sdk.Context, action vm.Action) error
}

type MsgClient

type MsgClient interface {
	// Force sending an arbitrary packet on a channel.
	SendPacket(ctx context.Context, in *MsgSendPacket, opts ...grpc.CallOption) (*MsgSendPacketResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgSendPacket

type MsgSendPacket struct {
	Packet Packet                                        `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet" yaml:"packet"`
	Sender github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 130-byte string literal not displayed */
}

MsgSendPacket is an SDK message for sending an outgoing IBC packet

func NewMsgSendPacket

func NewMsgSendPacket(packet ibcexported.PacketI, sender sdk.AccAddress) *MsgSendPacket

NewMsgSendPacket returns a new send request

func (*MsgSendPacket) Descriptor

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

func (*MsgSendPacket) GetPacket

func (m *MsgSendPacket) GetPacket() Packet

func (*MsgSendPacket) GetSender

func (MsgSendPacket) GetSigners

func (msg MsgSendPacket) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgSendPacket) Marshal

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

func (*MsgSendPacket) MarshalTo

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

func (*MsgSendPacket) MarshalToSizedBuffer

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

func (*MsgSendPacket) ProtoMessage

func (*MsgSendPacket) ProtoMessage()

func (*MsgSendPacket) Reset

func (m *MsgSendPacket) Reset()

func (MsgSendPacket) Route

func (msg MsgSendPacket) Route() string

Route implements sdk.Msg

func (*MsgSendPacket) Size

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

func (*MsgSendPacket) String

func (m *MsgSendPacket) String() string

func (MsgSendPacket) Type

func (msg MsgSendPacket) Type() string

Type implements sdk.Msg

func (*MsgSendPacket) Unmarshal

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

func (MsgSendPacket) ValidateBasic

func (msg MsgSendPacket) ValidateBasic() error

ValidateBasic implements sdk.Msg

func (*MsgSendPacket) XXX_DiscardUnknown

func (m *MsgSendPacket) XXX_DiscardUnknown()

func (*MsgSendPacket) XXX_Marshal

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

func (*MsgSendPacket) XXX_Merge

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

func (*MsgSendPacket) XXX_Size

func (m *MsgSendPacket) XXX_Size() int

func (*MsgSendPacket) XXX_Unmarshal

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

type MsgSendPacketResponse

type MsgSendPacketResponse struct {
}

Empty response for SendPacket.

func (*MsgSendPacketResponse) Descriptor

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

func (*MsgSendPacketResponse) Marshal

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

func (*MsgSendPacketResponse) MarshalTo

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

func (*MsgSendPacketResponse) MarshalToSizedBuffer

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

func (*MsgSendPacketResponse) ProtoMessage

func (*MsgSendPacketResponse) ProtoMessage()

func (*MsgSendPacketResponse) Reset

func (m *MsgSendPacketResponse) Reset()

func (*MsgSendPacketResponse) Size

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

func (*MsgSendPacketResponse) String

func (m *MsgSendPacketResponse) String() string

func (*MsgSendPacketResponse) Unmarshal

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

func (*MsgSendPacketResponse) XXX_DiscardUnknown

func (m *MsgSendPacketResponse) XXX_DiscardUnknown()

func (*MsgSendPacketResponse) XXX_Marshal

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

func (*MsgSendPacketResponse) XXX_Merge

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

func (*MsgSendPacketResponse) XXX_Size

func (m *MsgSendPacketResponse) XXX_Size() int

func (*MsgSendPacketResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// Force sending an arbitrary packet on a channel.
	SendPacket(context.Context, *MsgSendPacket) (*MsgSendPacketResponse, error)
}

MsgServer is the server API for Msg service.

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"`
	// identifies the channel end on the sending chain.
	SourceChannel string `protobuf:"bytes,3,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"`
	// identifies the port on the receiving chain.
	DestinationPort string `protobuf:"bytes,4,opt,name=destination_port,json=destinationPort,proto3" json:"destination_port,omitempty"`
	// identifies the channel end on the receiving chain.
	DestinationChannel string `protobuf:"bytes,5,opt,name=destination_channel,json=destinationChannel,proto3" json:"destination_channel,omitempty"`
	// 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 Height `protobuf:"bytes,7,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height"`
	// block timestamp (in nanoseconds) after which the packet times out
	TimeoutTimestamp uint64 `protobuf:"varint,8,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"`
}

Packet defines a type that carries data across different chains through IBC. The fields in the Packet correspond to the fields in the IBC packet definition in ibc/core/channel/v1/channel.proto, but with amino and gogoproto options to ensure compatibility with the Cosmos SDK's Protobuf code generation and JSON encoding. See ibc/core/channel/v1/channel.proto for more details on the semantics of each field in the Packet.

func (*Packet) Descriptor

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

func (Packet) GetData

func (p Packet) GetData() []byte

func (Packet) GetDestChannel

func (p Packet) GetDestChannel() string

func (Packet) GetDestPort

func (p Packet) GetDestPort() string

func (Packet) GetSequence

func (p Packet) GetSequence() uint64

func (Packet) GetSourceChannel

func (p Packet) GetSourceChannel() string

func (Packet) GetSourcePort

func (p Packet) GetSourcePort() string

func (Packet) GetTimeoutHeight

func (p Packet) GetTimeoutHeight() ibcexported.Height

func (Packet) GetTimeoutTimestamp

func (p Packet) GetTimeoutTimestamp() uint64

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) ValidateBasic

func (p Packet) ValidateBasic() 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 RawAcknowledgement

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

func NewRawAcknowledgement

func NewRawAcknowledgement(data []byte) RawAcknowledgement

func (RawAcknowledgement) Acknowledgement

func (r RawAcknowledgement) Acknowledgement() []byte

func (RawAcknowledgement) Success

func (r RawAcknowledgement) Success() bool

type ReceivePacketEvent

type ReceivePacketEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string            `json:"event" default:"receivePacket"`
	Target           string            `json:"target,omitempty"`
	ChannelVersion   string            `json:"channelVersion"`
	Packet           agtypes.IBCPacket `json:"packet"`
	Relayer          sdk.AccAddress    `json:"relayer"`
}

type Receiver

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

func NewReceiver

func NewReceiver(impl ReceiverImpl) Receiver

func (Receiver) Receive

func (ir Receiver) Receive(cctx context.Context, jsonRequest string) (jsonReply string, err error)

Receive implements vm.PortHandler. It unmarshals the string as JSON text representing an IBC portMessage object. If the resulting type is "IBC_METHOD" it dispatches on method ("sendPacket"/"receiveExecuted"/etc.) and calls the corresponding method of the wrapped ReceiverImpl.

Otherwise, it requires the wrapped ReceiverImpl to be a vm.PortHandler and delegates to the Receive method of that PortHandler.

type ReceiverImpl

type ReceiverImpl interface {
	ReceiveSendPacket(ctx sdk.Context, packet exported.PacketI) (uint64, error)
	ReceiveWriteAcknowledgement(ctx sdk.Context, packet exported.PacketI, ack exported.Acknowledgement) error
	ReceiveChanOpenInit(ctx sdk.Context, order channeltypes.Order, hops []string, sourcePort, destinationPort, version string) error
	ReceiveWriteOpenTryChannel(ctx sdk.Context, packet exported.PacketI, order channeltypes.Order, connectionHops []string, version string) error
	ReceiveChanCloseInit(ctx sdk.Context, sourcePort, sourceChannel string) error
	ReceiveBindPort(ctx sdk.Context, sourcePort string) error
	ReceiveTimeoutExecuted(ctx sdk.Context, packet exported.PacketI) error
}

type TimeoutPacketEvent

type TimeoutPacketEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string            `json:"event" default:"timeoutPacket"`
	Target           string            `json:"target,omitempty"`
	ChannelVersion   string            `json:"channelVersion"`
	Packet           agtypes.IBCPacket `json:"packet"`
	Relayer          sdk.AccAddress    `json:"relayer"`
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) SendPacket

type WriteAcknowledgementEvent

type WriteAcknowledgementEvent struct {
	*vm.ActionHeader `actionType:"IBC_EVENT"`
	Event            string            `json:"event" default:"writeAcknowledgement"`
	Target           string            `json:"target"`
	Packet           agtypes.IBCPacket `json:"packet"`
	Acknowledgement  []byte            `json:"acknowledgement"`
	Relayer          sdk.AccAddress    `json:"relayer"`
}

Jump to

Keyboard shortcuts

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