Documentation ¶
Index ¶
- func EmitUpgradeChainEvent(ctx sdk.Context, height int64)
- type Keeper
- func (k Keeper) ClientParams(c context.Context, _ *types.QueryClientParamsRequest) (*types.QueryClientParamsResponse, error)
- func (k Keeper) ClientState(c context.Context, req *types.QueryClientStateRequest) (*types.QueryClientStateResponse, error)
- func (k Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequest) (*types.QueryClientStatesResponse, error)
- func (k Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequest) (*types.QueryClientStatusResponse, error)
- func (k Keeper) ClientStore(ctx sdk.Context, clientID string) storetypes.KVStore
- func (k Keeper) ConsensusState(c context.Context, req *types.QueryConsensusStateRequest) (*types.QueryConsensusStateResponse, error)
- func (k Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsensusStateHeightsRequest) (*types.QueryConsensusStateHeightsResponse, error)
- func (k Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStatesRequest) (*types.QueryConsensusStatesResponse, error)
- func (k Keeper) CreateClient(ctx sdk.Context, clientState exported.ClientState, ...) (string, error)
- func (k Keeper) CreateLocalhostClient(ctx sdk.Context) error
- func (k Keeper) GenerateClientIdentifier(ctx sdk.Context, clientType string) string
- func (k Keeper) GetAllClientMetadata(ctx sdk.Context, genClients []types.IdentifiedClientState) ([]types.IdentifiedGenesisMetadata, error)
- func (k Keeper) GetAllClients(ctx sdk.Context) []exported.ClientState
- func (k Keeper) GetAllConsensusStates(ctx sdk.Context) types.ClientsConsensusStates
- func (k Keeper) GetAllGenesisClients(ctx sdk.Context) types.IdentifiedClientStates
- func (k Keeper) GetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) (exported.ConsensusState, bool)
- func (k Keeper) GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool)
- func (k Keeper) GetClientStatus(ctx sdk.Context, clientState exported.ClientState, clientID string) exported.Status
- func (k Keeper) GetLatestClientConsensusState(ctx sdk.Context, clientID string) (exported.ConsensusState, bool)
- func (k Keeper) GetNextClientSequence(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetSelfConsensusState(ctx sdk.Context, height exported.Height) (exported.ConsensusState, error)
- func (k Keeper) GetUpgradePlan(ctx sdk.Context) (upgradetypes.Plan, error)
- func (k Keeper) GetUpgradedClient(ctx sdk.Context, planHeight int64) ([]byte, error)
- func (k Keeper) GetUpgradedConsensusState(ctx sdk.Context, planHeight int64) ([]byte, error)
- func (k Keeper) HasClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) bool
- func (k Keeper) IterateClientStates(ctx sdk.Context, storeprefix []byte, ...)
- func (k Keeper) IterateConsensusStates(ctx sdk.Context, ...)
- func (Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustMarshalClientState(clientState exported.ClientState) []byte
- func (k Keeper) MustMarshalConsensusState(consensusState exported.ConsensusState) []byte
- func (k Keeper) MustUnmarshalClientState(bz []byte) exported.ClientState
- func (k Keeper) MustUnmarshalConsensusState(bz []byte) exported.ConsensusState
- func (k Keeper) RecoverClient(ctx sdk.Context, subjectClientID, substituteClientID string) error
- func (k Keeper) ScheduleIBCSoftwareUpgrade(ctx sdk.Context, plan upgradetypes.Plan, ...) error
- func (k Keeper) SetAllClientMetadata(ctx sdk.Context, genMetadata []types.IdentifiedGenesisMetadata)
- func (k Keeper) SetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height, ...)
- func (k Keeper) SetClientState(ctx sdk.Context, clientID string, clientState exported.ClientState)
- func (k *Keeper) SetConsensusHost(consensusHost types.ConsensusHost)
- func (k Keeper) SetNextClientSequence(ctx sdk.Context, sequence uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetUpgradedConsensusState(ctx sdk.Context, planHeight int64, bz []byte) error
- func (k Keeper) UnmarshalClientState(bz []byte) (exported.ClientState, error)
- func (k Keeper) UnmarshalConsensusState(bz []byte) (exported.ConsensusState, error)
- func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error
- func (k Keeper) UpdateLocalhostClient(ctx sdk.Context, clientState exported.ClientState) []exported.Height
- func (k Keeper) UpgradeClient(ctx sdk.Context, clientID string, upgradedClient exported.ClientState, ...) error
- func (k Keeper) UpgradedClientState(c context.Context, req *types.QueryUpgradedClientStateRequest) (*types.QueryUpgradedClientStateResponse, error)
- func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
- func (k Keeper) ValidateSelfClient(ctx sdk.Context, clientState exported.ClientState) error
- func (k Keeper) VerifyMembership(c context.Context, req *types.QueryVerifyMembershipRequest) (*types.QueryVerifyMembershipResponse, error)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitUpgradeChainEvent ¶
EmitUpgradeChainEvent emits an upgrade chain event.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper represents a type that grants read and write permissions to any client state information
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace types.ParamSubspace, sk types.StakingKeeper, uk types.UpgradeKeeper) Keeper
NewKeeper creates a new NewKeeper instance
func (Keeper) ClientParams ¶
func (k Keeper) ClientParams(c context.Context, _ *types.QueryClientParamsRequest) (*types.QueryClientParamsResponse, error)
ClientParams implements the Query/ClientParams gRPC method
func (Keeper) ClientState ¶
func (k Keeper) ClientState(c context.Context, req *types.QueryClientStateRequest) (*types.QueryClientStateResponse, error)
ClientState implements the Query/ClientState gRPC method
func (Keeper) ClientStates ¶
func (k Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequest) (*types.QueryClientStatesResponse, error)
ClientStates implements the Query/ClientStates gRPC method
func (Keeper) ClientStatus ¶
func (k Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequest) (*types.QueryClientStatusResponse, error)
ClientStatus implements the Query/ClientStatus gRPC method
func (Keeper) ClientStore ¶
ClientStore returns isolated prefix store for each client so they can read/write in separate namespace without being able to read/write other client's data
func (Keeper) ConsensusState ¶
func (k Keeper) ConsensusState(c context.Context, req *types.QueryConsensusStateRequest) (*types.QueryConsensusStateResponse, error)
ConsensusState implements the Query/ConsensusState gRPC method
func (Keeper) ConsensusStateHeights ¶
func (k Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsensusStateHeightsRequest) (*types.QueryConsensusStateHeightsResponse, error)
ConsensusStateHeights implements the Query/ConsensusStateHeights gRPC method
func (Keeper) ConsensusStates ¶
func (k Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStatesRequest) (*types.QueryConsensusStatesResponse, error)
ConsensusStates implements the Query/ConsensusStates gRPC method
func (Keeper) CreateClient ¶
func (k Keeper) CreateClient( ctx sdk.Context, clientState exported.ClientState, consensusState exported.ConsensusState, ) (string, error)
CreateClient generates a new client identifier and isolated prefix store for the provided client state. The client state is responsible for setting any client-specific data in the store via the Initialize method. This includes the client state, initial consensus state and any associated metadata.
func (Keeper) CreateLocalhostClient ¶
CreateLocalhostClient initialises the 09-localhost client state and sets it in state.
func (Keeper) GenerateClientIdentifier ¶
GenerateClientIdentifier returns the next client identifier.
func (Keeper) GetAllClientMetadata ¶
func (k Keeper) GetAllClientMetadata(ctx sdk.Context, genClients []types.IdentifiedClientState) ([]types.IdentifiedGenesisMetadata, error)
GetAllClientMetadata will take a list of IdentifiedClientState and return a list of IdentifiedGenesisMetadata necessary for exporting and importing client metadata into the client store.
func (Keeper) GetAllClients ¶
func (k Keeper) GetAllClients(ctx sdk.Context) []exported.ClientState
GetAllClients returns all stored light client State objects.
func (Keeper) GetAllConsensusStates ¶
func (k Keeper) GetAllConsensusStates(ctx sdk.Context) types.ClientsConsensusStates
GetAllConsensusStates returns all stored client consensus states.
func (Keeper) GetAllGenesisClients ¶
func (k Keeper) GetAllGenesisClients(ctx sdk.Context) types.IdentifiedClientStates
GetAllGenesisClients returns all the clients in state with their client ids returned as IdentifiedClientState
func (Keeper) GetClientConsensusState ¶
func (k Keeper) GetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) (exported.ConsensusState, bool)
GetClientConsensusState gets the stored consensus state from a client at a given height.
func (Keeper) GetClientState ¶
GetClientState gets a particular client from the store
func (Keeper) GetClientStatus ¶
func (k Keeper) GetClientStatus(ctx sdk.Context, clientState exported.ClientState, clientID string) exported.Status
GetClientStatus returns the status for a given clientState. If the client type is not in the allowed clients param field, Unauthorized is returned, otherwise the client state status is returned.
func (Keeper) GetLatestClientConsensusState ¶
func (k Keeper) GetLatestClientConsensusState(ctx sdk.Context, clientID string) (exported.ConsensusState, bool)
GetLatestClientConsensusState gets the latest ConsensusState stored for a given client
func (Keeper) GetNextClientSequence ¶
GetNextClientSequence gets the next client sequence from the store.
func (Keeper) GetSelfConsensusState ¶
func (k Keeper) GetSelfConsensusState(ctx sdk.Context, height exported.Height) (exported.ConsensusState, error)
GetSelfConsensusState introspects the (self) past historical info at a given height and returns the expected consensus state at that height. For now, can only retrieve self consensus states for the current revision
func (Keeper) GetUpgradePlan ¶
GetUpgradePlan executes the upgrade keeper GetUpgradePlan function.
func (Keeper) GetUpgradedClient ¶
GetUpgradedClient executes the upgrade keeper GetUpgradeClient function.
func (Keeper) GetUpgradedConsensusState ¶
GetUpgradedConsensusState returns the upgraded consensus state
func (Keeper) HasClientConsensusState ¶
func (k Keeper) HasClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) bool
HasClientConsensusState returns if keeper has a ConsensusState for a particular client at the given height
func (Keeper) IterateClientStates ¶
func (k Keeper) IterateClientStates(ctx sdk.Context, storeprefix []byte, cb func(clientID string, cs exported.ClientState) bool)
IterateClientStates provides an iterator over all stored light client State objects. For each State object, cb will be called. If the cb returns true, the iterator will close and stop.
func (Keeper) IterateConsensusStates ¶
func (k Keeper) IterateConsensusStates(ctx sdk.Context, cb func(clientID string, cs types.ConsensusStateWithHeight) bool)
IterateConsensusStates provides an iterator over all stored consensus states. objects. For each State object, cb will be called. If the cb returns true, the iterator will close and stop.
func (Keeper) MustMarshalClientState ¶
func (k Keeper) MustMarshalClientState(clientState exported.ClientState) []byte
MustMarshalClientState attempts to encode an ClientState object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustMarshalConsensusState ¶
func (k Keeper) MustMarshalConsensusState(consensusState exported.ConsensusState) []byte
MustMarshalConsensusState attempts to encode an ConsensusState object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalClientState ¶
func (k Keeper) MustUnmarshalClientState(bz []byte) exported.ClientState
MustUnmarshalClientState attempts to decode and return an ClientState object from raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalConsensusState ¶
func (k Keeper) MustUnmarshalConsensusState(bz []byte) exported.ConsensusState
MustUnmarshalConsensusState attempts to decode and return an ConsensusState object from raw encoded bytes. It panics on error.
func (Keeper) RecoverClient ¶
RecoverClient will retrieve the subject and substitute client. A callback will occur to the subject client state with the client prefixed store being provided for both the subject and the substitute client. The IBC client implementations are responsible for validating the parameters of the substitute (ensuring they match the subject's parameters) as well as copying the necessary consensus states from the substitute to the subject client store. The substitute must be Active and the subject must not be Active.
func (Keeper) ScheduleIBCSoftwareUpgrade ¶
func (k Keeper) ScheduleIBCSoftwareUpgrade(ctx sdk.Context, plan upgradetypes.Plan, upgradedClientState exported.ClientState) error
ScheduleIBCSoftwareUpgrade schedules an upgrade for the IBC client.
func (Keeper) SetAllClientMetadata ¶
func (k Keeper) SetAllClientMetadata(ctx sdk.Context, genMetadata []types.IdentifiedGenesisMetadata)
SetAllClientMetadata takes a list of IdentifiedGenesisMetadata and stores all of the metadata in the client store at the appropriate paths.
func (Keeper) SetClientConsensusState ¶
func (k Keeper) SetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height, consensusState exported.ConsensusState)
SetClientConsensusState sets a ConsensusState to a particular client at the given height
func (Keeper) SetClientState ¶
SetClientState sets a particular Client to the store
func (*Keeper) SetConsensusHost ¶ added in v8.3.0
func (k *Keeper) SetConsensusHost(consensusHost types.ConsensusHost)
SetConsensusHost sets a custom ConsensusHost for self client state and consensus state validation.
func (Keeper) SetNextClientSequence ¶
SetNextClientSequence sets the next client sequence to the store.
func (Keeper) SetUpgradedConsensusState ¶
SetUpgradedConsensusState executes the upgrade keeper SetUpgradedConsensusState function.
func (Keeper) UnmarshalClientState ¶
func (k Keeper) UnmarshalClientState(bz []byte) (exported.ClientState, error)
UnmarshalClientState attempts to decode and return an ClientState object from raw encoded bytes.
func (Keeper) UnmarshalConsensusState ¶
func (k Keeper) UnmarshalConsensusState(bz []byte) (exported.ConsensusState, error)
UnmarshalConsensusState attempts to decode and return an ConsensusState object from raw encoded bytes.
func (Keeper) UpdateClient ¶
func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error
UpdateClient updates the consensus state and the state root from a provided header.
func (Keeper) UpdateLocalhostClient ¶
func (k Keeper) UpdateLocalhostClient(ctx sdk.Context, clientState exported.ClientState) []exported.Height
UpdateLocalhostClient updates the 09-localhost client to the latest block height and chain ID.
func (Keeper) UpgradeClient ¶
func (k Keeper) UpgradeClient(ctx sdk.Context, clientID string, upgradedClient exported.ClientState, upgradedConsState exported.ConsensusState, upgradeClientProof, upgradeConsensusStateProof []byte, ) error
UpgradeClient upgrades the client to a new client state if this new client was committed to by the old client at the specified upgrade height
func (Keeper) UpgradedClientState ¶
func (k Keeper) UpgradedClientState(c context.Context, req *types.QueryUpgradedClientStateRequest) (*types.QueryUpgradedClientStateResponse, error)
UpgradedClientState implements the Query/UpgradedClientState gRPC method
func (Keeper) UpgradedConsensusState ¶
func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
UpgradedConsensusState implements the Query/UpgradedConsensusState gRPC method
func (Keeper) ValidateSelfClient ¶
ValidateSelfClient validates the client parameters for a client of the running chain. This function is only used to validate the client state the counterparty stores for this chain. NOTE: If the client type is not of type Tendermint then delegate to a custom client validator function. This allows support for non-Tendermint clients, for example 08-wasm clients.
func (Keeper) VerifyMembership ¶ added in v8.3.0
func (k Keeper) VerifyMembership(c context.Context, req *types.QueryVerifyMembershipRequest) (*types.QueryVerifyMembershipResponse, error)
VerifyMembership implements the Query/VerifyMembership gRPC method NOTE: Any state changes made within this handler are discarded by leveraging a cached context. Gas is consumed for underlying state access. This gRPC method is intended to be used within the context of the state machine and delegates to light clients to verify proofs.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) Migrate2to3 ¶
Migrate2to3 migrates from consensus version 2 to 3. This migration - migrates solo machine client states from v2 to v3 protobuf definition - prunes solo machine consensus states - removes the localhost client - asserts that existing tendermint clients are properly registered on the chain codec
func (Migrator) Migrate3to4 ¶
Migrate3to4 migrates from consensus version 3 to 4. This migration enables the localhost client.