Documentation ¶
Index ¶
- func EmitUpgradeChainEvent(ctx sdk.Context, height int64)
- func NewQueryServer(k *Keeper) types.QueryServer
- type Keeper
- func (k *Keeper) AddRoute(clientType string, module exported.LightClientModule)
- func (k *Keeper) ClientStore(ctx sdk.Context, clientID string) storetypes.KVStore
- func (k *Keeper) Codec() codec.BinaryCodec
- func (k *Keeper) CreateClient(ctx sdk.Context, clientType string, clientState, consensusState []byte) (string, 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) GetClientLatestHeight(ctx sdk.Context, clientID string) types.Height
- func (k *Keeper) GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool)
- func (k *Keeper) GetClientStatus(ctx sdk.Context, clientID string) exported.Status
- func (k *Keeper) GetClientTimestampAtHeight(ctx sdk.Context, clientID string, height exported.Height) (uint64, error)
- 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) GetStoreProvider() types.StoreProvider
- 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) RecoverClient(ctx sdk.Context, subjectClientID, substituteClientID string) error
- func (k *Keeper) Route(ctx sdk.Context, clientID string) (exported.LightClientModule, 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) 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) UpdateClient(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error
- func (k *Keeper) UpgradeClient(ctx sdk.Context, clientID string, ...) error
- func (k *Keeper) VerifyMembership(ctx sdk.Context, clientID string, height exported.Height, ...) error
- func (k *Keeper) VerifyNonMembership(ctx sdk.Context, clientID string, height exported.Height, ...) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitUpgradeChainEvent ¶
EmitUpgradeChainEvent emits an upgrade chain event.
func NewQueryServer ¶
func NewQueryServer(k *Keeper) types.QueryServer
NewQueryServer returns a new 02-client types.QueryServer implementation.
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, uk types.UpgradeKeeper) *Keeper
NewKeeper creates a new NewKeeper instance
func (*Keeper) AddRoute ¶
func (k *Keeper) AddRoute(clientType string, module exported.LightClientModule)
AddRoute adds a new route to the underlying router.
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) Codec ¶
func (k *Keeper) Codec() codec.BinaryCodec
Codec returns the IBC Client module codec.
func (*Keeper) CreateClient ¶
func (k *Keeper) CreateClient(ctx sdk.Context, clientType string, clientState, consensusState []byte) (string, error)
CreateClient generates a new client identifier and invokes the associated light client module in order to initialize a new client. An isolated prefixed store will be reserved for this client using the generated client identifier. The light client module 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. The generated client identifier will be returned if a client was successfully initialized.
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) GetClientLatestHeight ¶
GetClientLatestHeight returns the latest height of a client state for a given client identifier. If the client type is not in the allowed clients param field, a zero value height is returned, otherwise the client state latest height is returned.
func (*Keeper) GetClientState ¶
GetClientState gets a particular client from the store
func (*Keeper) GetClientStatus ¶
GetClientStatus returns the status for a client state given a client identifier. If the client type is not in the allowed clients param field, Unauthorized is returned, otherwise the client state status is returned.
func (*Keeper) GetClientTimestampAtHeight ¶
func (k *Keeper) GetClientTimestampAtHeight(ctx sdk.Context, clientID string, height exported.Height) (uint64, error)
GetClientTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height.
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) GetStoreProvider ¶
func (k *Keeper) GetStoreProvider() types.StoreProvider
GetStoreProvider returns the light client store provider.
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 ibc ClientState objects using the provided store prefix. For each ClientState 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) RecoverClient ¶
RecoverClient will invoke the light client module associated with the subject clientID requesting it to recover the subject client given a substitute client identifier. The light client implementation is 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) SetNextClientSequence ¶
SetNextClientSequence sets the next client sequence to the store.
func (*Keeper) SetUpgradedConsensusState ¶
SetUpgradedConsensusState executes the upgrade keeper SetUpgradedConsensusState function.
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) UpgradeClient ¶
func (k *Keeper) UpgradeClient( ctx sdk.Context, clientID string, upgradedClient, upgradedConsState, 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) VerifyMembership ¶
func (k *Keeper) VerifyMembership(ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte) error
VerifyMembership retrieves the light client module for the clientID and verifies the proof of the existence of a key-value pair at a specified height.
func (*Keeper) VerifyNonMembership ¶
func (k *Keeper) VerifyNonMembership(ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path) error
VerifyNonMembership retrieves the light client module for the clientID and verifies the absence of a given key at a specified height.
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) MigrateParams ¶
MigrateParams migrates from consensus version 4 to 5. This migration takes the parameters that are currently stored and managed by x/params and stores them directly in the ibc module's state.