cosmos

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 60 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 Order_name = map[int32]string{
	0: "ORDER_NONE_UNSPECIFIED",
	1: "ORDER_UNORDERED",
	2: "ORDER_ORDERED",
}
View Source
var Order_value = map[string]int32{
	"ORDER_NONE_UNSPECIFIED": 0,
	"ORDER_UNORDERED":        1,
	"ORDER_ORDERED":          2,
}
View Source
var State_name = map[int32]string{
	0: "STATE_UNINITIALIZED_UNSPECIFIED",
	1: "STATE_INIT",
	2: "STATE_TRYOPEN",
	3: "STATE_OPEN",
	4: "STATE_CLOSED",
}
View Source
var State_value = map[string]int32{
	"STATE_UNINITIALIZED_UNSPECIFIED": 0,
	"STATE_INIT":                      1,
	"STATE_TRYOPEN":                   2,
	"STATE_OPEN":                      3,
	"STATE_CLOSED":                    4,
}

Functions

func DefaultEncoding

func DefaultEncoding() testutil.TestEncodingConfig

func NewCosmosChain

func NewCosmosChain(t *testing.T, ctx context.Context, environment string, chainConfig chains.ChainConfig, keystorePath string, keyPassword string, url string, contractPaths map[string]string, logger *zap.Logger, chainID string) (chains.Chain, error)

func NewCosmosLocalnet

func NewCosmosLocalnet(testName string, log *zap.Logger, chainConfig ibc.ChainConfig, numValidators int, numFullNodes int, keyPassword string, contracts map[string]string) (chains.Chain, error)

func RlpEncodeRequest

func RlpEncodeRequest(request CallServiceMessageRequest, callType CallServiceMessageType) ([]byte, error)

Types

type Acknowledgement

type Acknowledgement struct {
	// response contains either a result or an error and must be non-empty
	//
	// Types that are valid to be assigned to Response:
	//	*Acknowledgement_Result
	//	*Acknowledgement_Error
	Response isAcknowledgement_Response `protobuf_oneof:"response"`
}

Acknowledgement is the recommended acknowledgement format to be used by app-specific protocols. NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental conflicts with other protobuf message formats used for acknowledgements. The first byte of any message with this format will be the non-ASCII values `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope

func (*Acknowledgement) Descriptor

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

func (*Acknowledgement) GetError

func (m *Acknowledgement) GetError() string

func (*Acknowledgement) GetResponse

func (m *Acknowledgement) GetResponse() isAcknowledgement_Response

func (*Acknowledgement) GetResult

func (m *Acknowledgement) GetResult() []byte

func (*Acknowledgement) Marshal

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

func (*Acknowledgement) MarshalTo

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

func (*Acknowledgement) MarshalToSizedBuffer

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

func (*Acknowledgement) ProtoMessage

func (*Acknowledgement) ProtoMessage()

func (*Acknowledgement) Reset

func (m *Acknowledgement) Reset()

func (*Acknowledgement) Size

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

func (*Acknowledgement) String

func (m *Acknowledgement) String() string

func (*Acknowledgement) Unmarshal

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

func (*Acknowledgement) XXX_DiscardUnknown

func (m *Acknowledgement) XXX_DiscardUnknown()

func (*Acknowledgement) XXX_Marshal

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

func (*Acknowledgement) XXX_Merge

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

func (*Acknowledgement) XXX_OneofWrappers

func (*Acknowledgement) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Acknowledgement) XXX_Size

func (m *Acknowledgement) XXX_Size() int

func (*Acknowledgement) XXX_Unmarshal

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

type Acknowledgement_Error

type Acknowledgement_Error struct {
	Error string `protobuf:"bytes,22,opt,name=error,proto3,oneof" json:"error,omitempty"`
}

func (*Acknowledgement_Error) MarshalTo

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

func (*Acknowledgement_Error) MarshalToSizedBuffer

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

func (*Acknowledgement_Error) Size

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

type Acknowledgement_Result

type Acknowledgement_Result struct {
	Result []byte `protobuf:"bytes,21,opt,name=result,proto3,oneof" json:"result,omitempty"`
}

func (*Acknowledgement_Result) MarshalTo

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

func (*Acknowledgement_Result) MarshalToSizedBuffer

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

func (*Acknowledgement_Result) Size

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

type CSMessageResponseType

type CSMessageResponseType int64
const (
	SUCCESS   CSMessageResponseType = 0
	FAILURE   CSMessageResponseType = -1
	IBC_ERROR CSMessageResponseType = -2
)

type CallServiceMessage

type CallServiceMessage struct {
	MessageType CallServiceMessageType
	Payload     []byte
}

func RlpDecode

func RlpDecode(raw_data []byte) (CallServiceMessage, error)

type CallServiceMessageRequest

type CallServiceMessageRequest struct {
	From       string `json:"from"`
	To         string `json:"to"`
	SequenceNo uint64 `json:"sequence_no"`
	Rollback   bool   `json:"rollback"`
	Data       []byte `json:"data"`
}

func (*CallServiceMessageRequest) RlpEncode

func (cr *CallServiceMessageRequest) RlpEncode() ([]byte, error)

type CallServiceMessageResponse

type CallServiceMessageResponse struct {
	SequenceNo uint64
	Code       CSMessageResponseType
	Msg        string
}

func (*CallServiceMessageResponse) RlpEncode

func (csr *CallServiceMessageResponse) RlpEncode() ([]byte, error)

type CallServiceMessageType

type CallServiceMessageType int64
const (
	CallServiceRequest  CallServiceMessageType = 0
	CallServiceResponse CallServiceMessageType = 1
)

type Channel

type Channel struct {
	// current state of the channel end
	State State `protobuf:"varint,1,opt,name=state,proto3,enum=ibc.core.channel.v1.State" json:"state,omitempty"`
	// whether the channel is ordered or unordered
	Ordering Order `protobuf:"varint,2,opt,name=ordering,proto3,enum=ibc.core.channel.v1.Order" json:"ordering,omitempty"`
	// counterparty channel end
	Counterparty 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 `protobuf:"bytes,4,rep,name=connection_hops,json=connectionHops,proto3" json:"connection_hops,omitempty"`
	// 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 CosmosLocalnet

type CosmosLocalnet struct {
	*cosmos.CosmosChain

	IBCAddresses map[string]string     `json:"addresses"`
	Wallets      map[string]ibc.Wallet `json:"wallets"`
	// contains filtered or unexported fields
}

func (*CosmosLocalnet) BackupConfig

func (c *CosmosLocalnet) BackupConfig() ([]byte, error)

func (*CosmosLocalnet) BuildWallet

func (c *CosmosLocalnet) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)

func (*CosmosLocalnet) BuildWallets

func (c *CosmosLocalnet) BuildWallets(ctx context.Context, keyName string) (ibc.Wallet, error)

func (*CosmosLocalnet) CheckForTimeout

func (c *CosmosLocalnet) CheckForTimeout(ctx context.Context, target chains.Chain, params map[string]interface{}, listener chains.EventListener) (context.Context, error)

func (*CosmosLocalnet) Config

func (c *CosmosLocalnet) Config() ibc.ChainConfig

func (*CosmosLocalnet) ConfigureBaseConnection

func (c *CosmosLocalnet) ConfigureBaseConnection(ctx context.Context, connection chains.XCallConnection) (context.Context, error)

func (*CosmosLocalnet) DeployContract

func (c *CosmosLocalnet) DeployContract(ctx context.Context, keyName string) (context.Context, error)

func (*CosmosLocalnet) DeployXCallMockApp

func (c *CosmosLocalnet) DeployXCallMockApp(ctx context.Context, connection chains.XCallConnection) error

func (*CosmosLocalnet) EOAXCall

func (c *CosmosLocalnet) EOAXCall(ctx context.Context, targetChain chains.Chain, keyName, _to string, data []byte, sources, destinations []string) (string, string, string, error)

func (*CosmosLocalnet) ExecuteCall

func (c *CosmosLocalnet) ExecuteCall(ctx context.Context, reqId, data string) (context.Context, error)

func (*CosmosLocalnet) ExecuteContract

func (c *CosmosLocalnet) ExecuteContract(ctx context.Context, contractAddress, keyName, methodName string, params map[string]interface{}) (context.Context, error)

func (*CosmosLocalnet) ExecuteRollback

func (c *CosmosLocalnet) ExecuteRollback(ctx context.Context, sn string) (context.Context, error)

func (*CosmosLocalnet) FindCallMessage

func (c *CosmosLocalnet) FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error)

func (*CosmosLocalnet) FindCallResponse

func (c *CosmosLocalnet) FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error)

func (*CosmosLocalnet) FindEvent

func (c *CosmosLocalnet) FindEvent(ctx context.Context, startHeight uint64, contract, index string) (*ctypes.ResultEvent, error)

func (*CosmosLocalnet) FindTargetXCallMessage

func (c *CosmosLocalnet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error)

FindTargetXCallMessage returns the request id and the data of the message sent to the target chain

func (*CosmosLocalnet) FindTxs

func (c *CosmosLocalnet) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx, error)

func (*CosmosLocalnet) GetAndFundTestUser

func (c *CosmosLocalnet) GetAndFundTestUser(
	ctx context.Context,
	keyNamePrefix string,
	mnemonic string,
	amount int64,
) (ibc.Wallet, error)

func (*CosmosLocalnet) GetBlockByHeight

func (c *CosmosLocalnet) GetBlockByHeight(ctx context.Context) (context.Context, error)

func (*CosmosLocalnet) GetChannel

func (c *CosmosLocalnet) GetChannel(ctx context.Context, connectionPrefix int, portID string) (*chantypes.Channel, error)

GetChannel returns the next sequence number for the client

func (*CosmosLocalnet) GetClientName

func (c *CosmosLocalnet) GetClientName(suffix int) string

func (*CosmosLocalnet) GetClientState

func (c *CosmosLocalnet) GetClientState(ctx context.Context, clientSuffix int) (any, error)

func (*CosmosLocalnet) GetClientsCount

func (c *CosmosLocalnet) GetClientsCount(ctx context.Context) (int, error)

GetClientsCount returns the next sequence number for the client

func (*CosmosLocalnet) GetCommonArgs

func (c *CosmosLocalnet) GetCommonArgs() []string

func (*CosmosLocalnet) GetConnectionState

func (c *CosmosLocalnet) GetConnectionState(ctx context.Context, connectionPrefix int) (*conntypes.ConnectionEnd, error)

GetConnectionState returns the next sequence number for the client

func (*CosmosLocalnet) GetIBCAddress

func (c *CosmosLocalnet) GetIBCAddress(key string) string

func (*CosmosLocalnet) GetLastBlock

func (c *CosmosLocalnet) GetLastBlock(ctx context.Context) (context.Context, error)

func (*CosmosLocalnet) GetNextChannelSequence

func (c *CosmosLocalnet) GetNextChannelSequence(ctx context.Context) (int, error)

GetNextChannelSequence returns the next sequence number for the client

func (*CosmosLocalnet) GetNextConnectionSequence

func (c *CosmosLocalnet) GetNextConnectionSequence(ctx context.Context) (int, error)

GetNextConnectionSequence returns the next sequence number for the client

func (*CosmosLocalnet) GetQueryParam

func (c *CosmosLocalnet) GetQueryParam(method string, params map[string]interface{}) Query

func (*CosmosLocalnet) InitEventListener

func (c *CosmosLocalnet) InitEventListener(ctx context.Context, contract string) chains.EventListener

func (*CosmosLocalnet) IsPacketReceived

func (c *CosmosLocalnet) IsPacketReceived(ctx context.Context, params map[string]interface{}, order ibc.Order) bool

IsPacketReceived returns the receipt of the packet sent to the target chain

func (*CosmosLocalnet) OverrideConfig

func (c *CosmosLocalnet) OverrideConfig(key string, value any)

func (*CosmosLocalnet) PauseNode

func (c *CosmosLocalnet) PauseNode(ctx context.Context) error

PauseNode halts a node

func (*CosmosLocalnet) PreGenesis

func (c *CosmosLocalnet) PreGenesis() error

func (*CosmosLocalnet) QueryContract

func (c *CosmosLocalnet) QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error)

func (*CosmosLocalnet) RestoreConfig

func (c *CosmosLocalnet) RestoreConfig(backup []byte) error

func (*CosmosLocalnet) SendPacketMockDApp

func (c *CosmosLocalnet) SendPacketMockDApp(ctx context.Context, targetChain chains.Chain, keyName string, params map[string]interface{}) (chains.PacketTransferResponse, error)

func (*CosmosLocalnet) SendPacketXCall

func (c *CosmosLocalnet) SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)

func (*CosmosLocalnet) SetAdminParams

func (c *CosmosLocalnet) SetAdminParams(ctx context.Context, keyName string) (context.Context, string, error)

func (*CosmosLocalnet) SetupIBC

func (c *CosmosLocalnet) SetupIBC(ctx context.Context, keyName string) (context.Context, error)

func (*CosmosLocalnet) SetupXCall

func (c *CosmosLocalnet) SetupXCall(ctx context.Context, portId string, keyName string) error

func (*CosmosLocalnet) UnpauseNode

func (c *CosmosLocalnet) UnpauseNode(ctx context.Context) error

UnpauseNode restarts a node

func (*CosmosLocalnet) UpdateAdminParams

func (c *CosmosLocalnet) UpdateAdminParams(ctx context.Context, keyName string) (context.Context, string, error)

func (*CosmosLocalnet) XCall

func (c *CosmosLocalnet) XCall(ctx context.Context, targetChain chains.Chain, keyName, to string, data, rollback []byte) (*chains.XCallResponse, error)

type CosmosTestnet

type CosmosTestnet struct {
	Client  rpcclient.Client
	ChainID string
	// contains filtered or unexported fields
}

func (*CosmosTestnet) DeployXCallMockApp

func (it *CosmosTestnet) DeployXCallMockApp(ctx context.Context, connection chains.XCallConnection) error

func (*CosmosTestnet) GetIBCAddress

func (c *CosmosTestnet) GetIBCAddress(key string) string

func (*CosmosTestnet) SetupXCall

func (c *CosmosTestnet) SetupXCall(ctx context.Context, portId, keyName string) error

type Counterparty

type 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"`
	// channel end on the counterparty chain
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
}

Counterparty defines a channel end counterparty

func (*Counterparty) Descriptor

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

func (*Counterparty) Marshal

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

func (*Counterparty) MarshalTo

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

func (*Counterparty) MarshalToSizedBuffer

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

func (*Counterparty) ProtoMessage

func (*Counterparty) ProtoMessage()

func (*Counterparty) Reset

func (m *Counterparty) Reset()

func (*Counterparty) Size

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

func (*Counterparty) String

func (m *Counterparty) String() string

func (*Counterparty) Unmarshal

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

func (*Counterparty) XXX_DiscardUnknown

func (m *Counterparty) XXX_DiscardUnknown()

func (*Counterparty) XXX_Marshal

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

func (*Counterparty) XXX_Merge

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

func (*Counterparty) XXX_Size

func (m *Counterparty) XXX_Size() int

func (*Counterparty) XXX_Unmarshal

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

type DappInit

type DappInit struct {
	Address string `json:"address"`
}

type GetAdmin

type GetAdmin struct{}

type GetProtocolFee

type GetProtocolFee struct{}

type IdentifiedChannel

type IdentifiedChannel struct {
	// current state of the channel end
	State State `protobuf:"varint,1,opt,name=state,proto3,enum=ibc.core.channel.v1.State" json:"state,omitempty"`
	// whether the channel is ordered or unordered
	Ordering Order `protobuf:"varint,2,opt,name=ordering,proto3,enum=ibc.core.channel.v1.Order" json:"ordering,omitempty"`
	// counterparty channel end
	Counterparty 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 `protobuf:"bytes,4,rep,name=connection_hops,json=connectionHops,proto3" json:"connection_hops,omitempty"`
	// 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 (*IdentifiedChannel) Descriptor

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

func (*IdentifiedChannel) Marshal

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

func (*IdentifiedChannel) MarshalTo

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

func (*IdentifiedChannel) MarshalToSizedBuffer

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

func (*IdentifiedChannel) ProtoMessage

func (*IdentifiedChannel) ProtoMessage()

func (*IdentifiedChannel) Reset

func (m *IdentifiedChannel) Reset()

func (*IdentifiedChannel) Size

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

func (*IdentifiedChannel) String

func (m *IdentifiedChannel) String() string

func (*IdentifiedChannel) Unmarshal

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

func (*IdentifiedChannel) XXX_DiscardUnknown

func (m *IdentifiedChannel) XXX_DiscardUnknown()

func (*IdentifiedChannel) XXX_Marshal

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

func (*IdentifiedChannel) XXX_Merge

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

func (*IdentifiedChannel) XXX_Size

func (m *IdentifiedChannel) XXX_Size() int

func (*IdentifiedChannel) XXX_Unmarshal

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

type MockAppInit

type MockAppInit struct {
	IBCHost int    `json:"ibc_host"`
	PortId  string `json:"port_id"`
	Order   string `json:"order"`
	Denom   string `json:"denom"`
}

type Order

type Order int32

Order defines if a channel is ORDERED or UNORDERED

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

func (Order) EnumDescriptor

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

func (Order) String

func (x Order) 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"`
	// 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 types.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

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 PacketId

type PacketId struct {
	// channel port identifier
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"`
	// channel unique identifier
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	// packet sequence
	Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"`
}

PacketId is an identifer for a unique Packet Source chains refer to packets by source port/channel Destination chains refer to packets by destination port/channel

func (*PacketId) Descriptor

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

func (*PacketId) Marshal

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

func (*PacketId) MarshalTo

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

func (*PacketId) MarshalToSizedBuffer

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

func (*PacketId) ProtoMessage

func (*PacketId) ProtoMessage()

func (*PacketId) Reset

func (m *PacketId) Reset()

func (*PacketId) Size

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

func (*PacketId) String

func (m *PacketId) String() string

func (*PacketId) Unmarshal

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

func (*PacketId) XXX_DiscardUnknown

func (m *PacketId) XXX_DiscardUnknown()

func (*PacketId) XXX_Marshal

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

func (*PacketId) XXX_Merge

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

func (*PacketId) XXX_Size

func (m *PacketId) XXX_Size() int

func (*PacketId) XXX_Unmarshal

func (m *PacketId) 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"`
	// channel unique identifier.
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	// 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

type Query

type Query struct {
	GetClientState            *map[string]interface{} `json:"get_client_state,omitempty"`
	GetAdmin                  *GetAdmin               `json:"get_admin,omitempty"`
	GetProtocolFee            *GetProtocolFee         `json:"get_protocol_fee,omitempty"`
	GetNextClientSequence     *map[string]interface{} `json:"get_next_client_sequence,omitempty"`
	HasPacketReceipt          *map[string]interface{} `json:"has_packet_receipt,omitempty"`
	GetNextSequenceReceive    *map[string]interface{} `json:"get_next_sequence_receive,omitempty"`
	GetConnection             *map[string]interface{} `json:"get_connection,omitempty"`
	GetChannel                *map[string]interface{} `json:"get_channel,omitempty"`
	GetNextConnectionSequence *map[string]interface{} `json:"get_next_connection_sequence,omitempty"`
	GetNextChannelSequence    *map[string]interface{} `json:"get_next_channel_sequence,omitempty"`
}

type Result

type Result struct {
	NodeInfo struct {
		ProtocolVersion struct {
			P2P   string `json:"p2p"`
			Block string `json:"block"`
			App   string `json:"app"`
		} `json:"protocol_version"`
		ID         string `json:"id"`
		ListenAddr string `json:"listen_addr"`
		Network    string `json:"network"`
		Version    string `json:"version"`
		Channels   string `json:"channels"`
		Moniker    string `json:"moniker"`
		Other      struct {
			TxIndex    string `json:"tx_index"`
			RPCAddress string `json:"rpc_address"`
		} `json:"other"`
	} `json:"NodeInfo"`
	SyncInfo struct {
		LatestBlockHash     string    `json:"latest_block_hash"`
		LatestAppHash       string    `json:"latest_app_hash"`
		LatestBlockHeight   string    `json:"latest_block_height"`
		LatestBlockTime     time.Time `json:"latest_block_time"`
		EarliestBlockHash   string    `json:"earliest_block_hash"`
		EarliestAppHash     string    `json:"earliest_app_hash"`
		EarliestBlockHeight string    `json:"earliest_block_height"`
		EarliestBlockTime   time.Time `json:"earliest_block_time"`
		CatchingUp          bool      `json:"catching_up"`
	} `json:"SyncInfo"`
	ValidatorInfo struct {
		Address string `json:"Address"`
		PubKey  struct {
			Type  string `json:"type"`
			Value string `json:"value"`
		} `json:"PubKey"`
		VotingPower string `json:"VotingPower"`
	} `json:"ValidatorInfo"`
}

type SetAdmin

type SetAdmin struct {
	SetAdmin struct {
		Address string `json:"address"`
	} `json:"set_admin"`
}

type State

type State int32

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

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

func (State) EnumDescriptor

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

func (State) String

func (x State) String() string

type TxResul

type TxResul struct {
	Height    string        `json:"height"`
	Txhash    string        `json:"txhash"`
	Codespace string        `json:"codespace"`
	Code      int           `json:"code"`
	Data      string        `json:"data"`
	RawLog    string        `json:"raw_log"`
	Logs      []interface{} `json:"logs"`
	Info      string        `json:"info"`
	GasWanted string        `json:"gas_wanted"`
	GasUsed   string        `json:"gas_used"`
	Tx        interface{}   `json:"tx"`
	Timestamp string        `json:"timestamp"`
	Events    []struct {
		Type       string `json:"type"`
		Attributes []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
			Index bool   `json:"index"`
		} `json:"attributes"`
	} `json:"events"`
}

type UpdateAdmin

type UpdateAdmin struct {
	UpdateAdmin struct {
		Address string `json:"address"`
	} `json:"update_admin"`
}

type WebSocketListener

type WebSocketListener struct {
	Shutdown chan struct{}
	Events   []map[string][]string
	// contains filtered or unexported fields
}

func NewCosmosEventListener

func NewCosmosEventListener(c *CosmosLocalnet, contract string, timeout time.Duration) *WebSocketListener

func (*WebSocketListener) FindEvent

func (w *WebSocketListener) FindEvent(filters chains.Filter) (chains.Event, error)

func (*WebSocketListener) Start

func (w *WebSocketListener) Start()

func (*WebSocketListener) Stop

func (w *WebSocketListener) Stop()

type XcallInit

type XcallInit struct {
	TimeoutHeight int    `json:"timeout_height"`
	IbcHost       string `json:"ibc_host"`
}

Jump to

Keyboard shortcuts

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