types

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeKeyClientID   = "client_id"
	AttributeKeyClientType = "client_type"
)

IBC client events

View Source
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
)
View Source
const (
	QueryAllClients     = "client_states"
	QueryClientState    = "client_state"
	QueryConsensusState = "consensus_state"
)

query routes supported by the IBC client Querier

Variables

View Source
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 block 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

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

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

IBC client events vars

View Source
var SubModuleCdc *codec.Codec

SubModuleCdc defines the IBC client codec.

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the IBC client interfaces and types

func SetSubModuleCodec

func SetSubModuleCodec(cdc *codec.Codec)

Types

type ClientConsensusStates

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

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

NewClientConsensusStates creates a new ClientConsensusStates instance.

type ConsensusStateResponse

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

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

NewConsensusStateResponse creates a new ConsensusStateResponse instance.

type GenesisState

type GenesisState struct {
	Clients          []exported.ClientState  `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

func DefaultGenesisState() GenesisState

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

func NewGenesisState

func NewGenesisState(
	clients []exported.ClientState, clientsConsensus []ClientConsensusStates, createLocalhost bool,
) GenesisState

NewGenesisState creates a GenesisState instance.

func (GenesisState) Validate

func (gs GenesisState) Validate() error

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

type QueryAllClientsParams

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

func NewQueryAllClientsParams(page, limit int) QueryAllClientsParams

NewQueryAllClientsParams creates a new QueryAllClientsParams instance.

type StakingKeeper

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

StakingKeeper expected staking keeper

type StateResponse

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

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

NewClientStateResponse creates a new StateResponse instance.

Jump to

Keyboard shortcuts

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