host

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the IBC module
	ModuleName = "ibc"

	// StoreKey is the string store representation
	StoreKey string = ModuleName

	// QuerierRoute is the querier route for the IBC module
	QuerierRoute string = ModuleName

	// RouterKey is the msg router key for the IBC module
	RouterKey string = ModuleName
)
View Source
const (
	KeyChannelPrefix           = "channelEnds"
	KeyChannelCapabilityPrefix = "capabilities"
	KeyNextSeqSendPrefix       = "seqSends"
	KeyNextSeqRecvPrefix       = "seqRecvs"
	KeyPacketCommitmentPrefix  = "commitments"
	KeyPacketAckPrefix         = "acks"
)

KVStore key prefixes for IBC

View Source
const SubModuleName = "host"

SubModuleName defines the ICS 24 host

Variables

View Source
var (
	ErrInvalidID     = sdkerrors.Register(SubModuleName, 2, "invalid identifier")
	ErrInvalidPath   = sdkerrors.Register(SubModuleName, 3, "invalid path")
	ErrInvalidPacket = sdkerrors.Register(SubModuleName, 4, "invalid packet")
)

IBC client sentinel errors

View Source
var (
	KeyClientStorePrefix = []byte("clients")
	KeyConnectionPrefix  = []byte("connections")
)

KVStore key prefixes for IBC

Functions

func ChannelCapabilityPath

func ChannelCapabilityPath(portID, channelID string) string

ChannelCapabilityPath defines the path under which capability keys associated with a channel are stored

func ChannelPath

func ChannelPath(portID, channelID string) string

ChannelPath defines the path under which channels are stored

func ClientConnectionsPath

func ClientConnectionsPath(clientID string) string

ClientConnectionsPath defines a reverse mapping from clients to a set of connections

func ClientStatePath

func ClientStatePath() string

ClientStatePath takes an Identifier and returns a Path under which to store a particular client state

func ClientTypePath

func ClientTypePath() string

ClientTypePath takes an Identifier and returns Path under which to store the type of a particular client.

func ConnectionPath

func ConnectionPath(connectionID string) string

ConnectionPath defines the path under which connection paths are stored

func ConsensusStatePath

func ConsensusStatePath(height uint64) string

ConsensusStatePath takes an Identifier and returns a Path under which to store the consensus state of a client.

func DefaultChannelIdentifierValidator

func DefaultChannelIdentifierValidator(id string) error

DefaultChannelIdentifierValidator is the default validator function for Channel identifiers A valid Identifier must be between 10-20 characters and only contain lowercase alphabetic characters,

func DefaultClientIdentifierValidator

func DefaultClientIdentifierValidator(id string) error

DefaultClientIdentifierValidator is the default validator function for Client identifiers A valid Identifier must be between 9-20 characters and only contain lowercase alphabetic characters,

func DefaultConnectionIdentifierValidator

func DefaultConnectionIdentifierValidator(id string) error

DefaultConnectionIdentifierValidator is the default validator function for Connection identifiers A valid Identifier must be between 10-20 characters and only contain lowercase alphabetic characters,

func DefaultPathValidator

func DefaultPathValidator(path string) error

DefaultPathValidator takes in path string and validates with default identifier rules. This is optimized by simply checking that all path elements are alphanumeric

func DefaultPortIdentifierValidator

func DefaultPortIdentifierValidator(id string) error

DefaultPortIdentifierValidator is the default validator function for Port identifiers A valid Identifier must be between 2-20 characters and only contain lowercase alphabetic characters,

func GetChannelPortsKeysPrefix

func GetChannelPortsKeysPrefix(prefix int) []byte

GetChannelPortsKeysPrefix returns the prefix bytes for ICS04 and ICS05 iterators

func KeyChannel

func KeyChannel(portID, channelID string) []byte

KeyChannel returns the store key for a particular channel

func KeyClientConnections

func KeyClientConnections(clientID string) []byte

KeyClientConnections returns the store key for the connectios of a given client

func KeyClientState

func KeyClientState() []byte

KeyClientState returns the store key for a particular client state

func KeyClientType

func KeyClientType() []byte

KeyClientType returns the store key for type of a particular client

func KeyConnection

func KeyConnection(connectionID string) []byte

KeyConnection returns the store key for a particular connection

func KeyConsensusState

func KeyConsensusState(height uint64) []byte

KeyConsensusState returns the store key for the consensus state of a particular client

func KeyNextSequenceRecv

func KeyNextSequenceRecv(portID, channelID string) []byte

KeyNextSequenceRecv returns the store key for the receive sequence of a particular channel binded to a specific port

func KeyNextSequenceSend

func KeyNextSequenceSend(portID, channelID string) []byte

KeyNextSequenceSend returns the store key for the send sequence of a particular channel binded to a specific port

func KeyPacketAcknowledgement

func KeyPacketAcknowledgement(portID, channelID string, sequence uint64) []byte

KeyPacketAcknowledgement returns the store key of under which a packet acknowledgement is stored

func KeyPacketCommitment

func KeyPacketCommitment(portID, channelID string, sequence uint64) []byte

KeyPacketCommitment returns the store key of under which a packet commitment is stored

func KeyPort

func KeyPort(portID string) []byte

KeyPort returns the store key for a particular port

func KeyPrefixBytes

func KeyPrefixBytes(prefix int) []byte

KeyPrefixBytes return the key prefix bytes from a URL string format

func MustParseChannelPath

func MustParseChannelPath(path string) (string, string)

func NextSequenceRecvPath

func NextSequenceRecvPath(portID, channelID string) string

NextSequenceRecvPath defines the next receive sequence counter store path

func NextSequenceSendPath

func NextSequenceSendPath(portID, channelID string) string

NextSequenceSendPath defines the next send sequence counter store path

func PacketAcknowledgementPath

func PacketAcknowledgementPath(portID, channelID string, sequence uint64) string

PacketAcknowledgementPath defines the packet acknowledgement store path

func PacketCommitmentPath

func PacketCommitmentPath(portID, channelID string, sequence uint64) string

PacketCommitmentPath defines the commitments to packet data fields store path

func PortPath

func PortPath(portID string) string

PortPath defines the path under which ports paths are stored

func RemovePath

func RemovePath(paths []string, path string) ([]string, bool)

RemovePath is an util function to remove a path from a set.

Types

type ValidateFn

type ValidateFn func(string) error

ValidateFn function type to validate path and identifier bytestrings

func NewPathValidator

func NewPathValidator(idValidator ValidateFn) ValidateFn

NewPathValidator takes in a Identifier Validator function and returns a Path Validator function which requires path only has valid identifiers alphanumeric character strings, and "/" separators

Jump to

Keyboard shortcuts

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