cosmos-sdk: Index | Files

package types

import ""


Package Files

codec.go errors.go events.go expected_keepers.go genesis.go keys.go querier.go


const (
    AttributeKeyClientID        = "client_id"
    AttributeKeyClientType      = "client_type"
    AttributeKeyConsensusHeight = "consensus_height"

IBC client events

const (
    // SubModuleName defines the IBC client name
    SubModuleName string = "client"

    // RouterKey is the message route for IBC client
    RouterKey string = SubModuleName

    // QuerierRoute is the querier route for IBC client
    QuerierRoute string = SubModuleName
const (
    QueryAllClients = "client_states"

query routes supported by the IBC client Querier


var (
    ErrClientExists                           = sdkerrors.Register(SubModuleName, 2, "light client already exists")
    ErrClientNotFound                         = sdkerrors.Register(SubModuleName, 3, "light client not found")
    ErrClientFrozen                           = sdkerrors.Register(SubModuleName, 4, "light client is frozen due to misbehaviour")
    ErrConsensusStateNotFound                 = sdkerrors.Register(SubModuleName, 5, "consensus state not found")
    ErrInvalidConsensus                       = sdkerrors.Register(SubModuleName, 6, "invalid consensus state")
    ErrClientTypeNotFound                     = sdkerrors.Register(SubModuleName, 7, "client type not found")
    ErrInvalidClientType                      = sdkerrors.Register(SubModuleName, 8, "invalid client type")
    ErrRootNotFound                           = sdkerrors.Register(SubModuleName, 9, "commitment root not found")
    ErrInvalidHeader                          = sdkerrors.Register(SubModuleName, 10, "invalid client header")
    ErrInvalidEvidence                        = sdkerrors.Register(SubModuleName, 11, "invalid light client misbehaviour evidence")
    ErrFailedClientConsensusStateVerification = sdkerrors.Register(SubModuleName, 12, "client consensus state verification failed")
    ErrFailedConnectionStateVerification      = sdkerrors.Register(SubModuleName, 13, "connection state verification failed")
    ErrFailedChannelStateVerification         = sdkerrors.Register(SubModuleName, 14, "channel state verification failed")
    ErrFailedPacketCommitmentVerification     = sdkerrors.Register(SubModuleName, 15, "packet commitment verification failed")
    ErrFailedPacketAckVerification            = sdkerrors.Register(SubModuleName, 16, "packet acknowledgement verification failed")
    ErrFailedPacketAckAbsenceVerification     = sdkerrors.Register(SubModuleName, 17, "packet acknowledgement absence verification failed")
    ErrFailedNextSeqRecvVerification          = sdkerrors.Register(SubModuleName, 18, "next sequence receive verification failed")
    ErrSelfConsensusStateNotFound             = sdkerrors.Register(SubModuleName, 19, "self consensus state not found")

IBC client sentinel errors

var (
    EventTypeCreateClient       = "create_client"
    EventTypeUpdateClient       = "update_client"
    EventTypeSubmitMisbehaviour = "client_misbehaviour"

    AttributeValueCategory = fmt.Sprintf("%s_%s", host.ModuleName, SubModuleName)

IBC client events vars

var SubModuleCdc *codec.Codec

SubModuleCdc defines the IBC client codec.

func RegisterCodec Uses

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the IBC client interfaces and types

type ClientConsensusStates Uses

type ClientConsensusStates struct {
    ClientID        string                    `json:"client_id" yaml:"client_id"`
    ConsensusStates []exported.ConsensusState `json:"consensus_states" yaml:"consensus_states"`

ClientConsensusStates defines all the stored consensus states for a given client.

func NewClientConsensusStates Uses

func NewClientConsensusStates(id string, states []exported.ConsensusState) ClientConsensusStates

NewClientConsensusStates creates a new ClientConsensusStates instance.

type ConsensusStateResponse Uses

type ConsensusStateResponse struct {
    ConsensusState exported.ConsensusState     `json:"consensus_state" yaml:"consensus_state"`
    Proof          commitmenttypes.MerkleProof `json:"proof,omitempty" yaml:"proof,omitempty"`
    ProofPath      commitmenttypes.MerklePath  `json:"proof_path,omitempty" yaml:"proof_path,omitempty"`
    ProofHeight    uint64                      `json:"proof_height,omitempty" yaml:"proof_height,omitempty"`

ConsensusStateResponse defines the client response for a Consensus state query. It includes the commitment proof and the height of the proof.

func NewConsensusStateResponse Uses

func NewConsensusStateResponse(
    clientID string, cs exported.ConsensusState, proof *merkle.Proof, height int64,
) ConsensusStateResponse

NewConsensusStateResponse creates a new ConsensusStateResponse instance.

type GenesisClientState Uses

type GenesisClientState struct {
    ClientID    string               `json:"client_id" yaml:"client_id"`
    ClientState exported.ClientState `json:"client_state" yaml:"client_state"`

func NewGenesisClientState Uses

func NewGenesisClientState(id string, cs exported.ClientState) GenesisClientState

type GenesisState Uses

type GenesisState struct {
    Clients          []GenesisClientState    `json:"clients" yaml:"clients"`
    ClientsConsensus []ClientConsensusStates `json:"clients_consensus" yaml:"clients_consensus"`
    CreateLocalhost  bool                    `json:"create_localhost" yaml:"create_localhost"`

GenesisState defines the ibc client submodule's genesis state.

func DefaultGenesisState Uses

func DefaultGenesisState() GenesisState

DefaultGenesisState returns the ibc client submodule's default genesis state.

func NewGenesisState Uses

func NewGenesisState(
    clients []GenesisClientState, clientsConsensus []ClientConsensusStates, createLocalhost bool,
) GenesisState

NewGenesisState creates a GenesisState instance.

func (GenesisState) Validate Uses

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

type QueryAllClientsParams Uses

type QueryAllClientsParams struct {
    Page  int `json:"page" yaml:"page"`
    Limit int `json:"limit" yaml:"limit"`

QueryAllClientsParams defines the parameters necessary for querying for all light client states.

func NewQueryAllClientsParams Uses

func NewQueryAllClientsParams(page, limit int) QueryAllClientsParams

NewQueryAllClientsParams creates a new QueryAllClientsParams instance.

type StakingKeeper Uses

type StakingKeeper interface {
    GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
    UnbondingTime(ctx sdk.Context) time.Duration

StakingKeeper expected staking keeper

type StateResponse Uses

type StateResponse struct {
    ClientState exported.ClientState        `json:"client_state" yaml:"client_state"`
    Proof       commitmenttypes.MerkleProof `json:"proof,omitempty" yaml:"proof,omitempty"`
    ProofPath   commitmenttypes.MerklePath  `json:"proof_path,omitempty" yaml:"proof_path,omitempty"`
    ProofHeight uint64                      `json:"proof_height,omitempty" yaml:"proof_height,omitempty"`

StateResponse defines the client response for a client state query. It includes the commitment proof and the height of the proof.

func NewClientStateResponse Uses

func NewClientStateResponse(
    clientID string, clientState exported.ClientState, proof *merkle.Proof, height int64,
) StateResponse

NewClientStateResponse creates a new StateResponse instance.

Package types imports 12 packages (graph) and is imported by 14 packages. Updated 2020-08-05. Refresh now. Tools for package owners.