types

package
v0.0.0-...-aa3d8a7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName defines the interchain price module name
	ModuleName = "interchainprice"

	// PortID is the default port id that the interchain price module binds to
	PortID = "interchain-price"

	// VersionPrefix defines the current version for interchain accounts
	VersionPrefix = "ics27-1"

	// Delimiter is the delimiter used for the interchain price version string
	Delimiter = "."
)
View Source
const (
	// ControllerPortFormat is the expected port identifier format to which controller chains must conform
	// See (TODO: Link to spec when updated)
	ControllerPortFormat = "<app-version>.<controller-conn-seq>.<host-conn-seq>.<owner>"
)

Variables

View Source
var (
	ErrUnknownDataType             = sdkerrors.Register(ModuleName, 2, "unknown data type")
	ErrAccountAlreadyExist         = sdkerrors.Register(ModuleName, 3, "account already exist")
	ErrPortAlreadyBound            = sdkerrors.Register(ModuleName, 4, "port is already bound")
	ErrInvalidChannelFlow          = sdkerrors.Register(ModuleName, 5, "invalid message sent to channel end")
	ErrInvalidOutgoingData         = sdkerrors.Register(ModuleName, 6, "invalid outgoing data")
	ErrInvalidRoute                = sdkerrors.Register(ModuleName, 7, "invalid route")
	ErrInterchainAccountNotFound   = sdkerrors.Register(ModuleName, 8, "interchain account not found")
	ErrInterchainAccountAlreadySet = sdkerrors.Register(ModuleName, 9, "interchain account is already set")
	ErrActiveChannelNotFound       = sdkerrors.Register(ModuleName, 10, "no active channel for this owner")
	ErrInvalidVersion              = sdkerrors.Register(ModuleName, 11, "invalid interchain accounts version")
	ErrInvalidAccountAddress       = sdkerrors.Register(ModuleName, 12, "invalid account address")
	ErrUnsupported                 = sdkerrors.Register(ModuleName, 13, "interchain account does not support this action")
)

Functions

func ParseControllerConnSequence

func ParseControllerConnSequence(portID string) (uint64, error)

ParseControllerConnSequence attempts to parse the controller connection sequence from the provided port identifier The port identifier must match the controller chain format outlined in (TODO: link spec), otherwise an empty string is returned

func ParseHostConnSequence

func ParseHostConnSequence(portID string) (uint64, error)

ParseHostConnSequence attempts to parse the host connection sequence from the provided port identifier The port identifier must match the controller chain format outlined in (TODO: link spec), otherwise an empty string is returned

func ValidateVersion

func ValidateVersion(version string) error

ValidateVersion performs basic validation of the provided ics27 version string. An ics27 version string may include an optional account address as per [TODO: Add spec when available] ValidateVersion first attempts to split the version string using the standard delimiter, then asserts a supported version prefix is included, followed by additional checks which enforce constraints on the account address.

Types

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)
	CounterpartyHops(ctx sdk.Context, channel channeltypes.Channel) ([]string, bool)
}

ChannelKeeper defines the expected IBC channel keeper

type PortKeeper

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

PortKeeper defines the expected IBC port keeper

Jump to

Keyboard shortcuts

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