cosmos-sdk: Index | Files

package keeper

import ""


Package Files

client.go keeper.go querier.go

func QuerierClients Uses

func QuerierClients(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc codec.JSONMarshaler) ([]byte, error)

QuerierClients defines the sdk.Querier to query all the light client states.

type Keeper Uses

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 Uses

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.StakingKeeper) Keeper

NewKeeper creates a new NewKeeper instance

func (Keeper) CheckMisbehaviourAndUpdateState Uses

func (k Keeper) CheckMisbehaviourAndUpdateState(ctx sdk.Context, misbehaviour exported.Misbehaviour) error

CheckMisbehaviourAndUpdateState checks for client misbehaviour and freezes the client if so.

func (Keeper) ClientStore Uses

func (k Keeper) ClientStore(ctx sdk.Context, clientID string) sdk.KVStore

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) CreateClient Uses

func (k Keeper) CreateClient(
    ctx sdk.Context, clientID string, clientState exported.ClientState, consensusState exported.ConsensusState,
) (exported.ClientState, error)

CreateClient creates a new client state and populates it with a given consensus state as defined in

CONTRACT: ClientState was constructed correctly from given initial consensusState

func (Keeper) GetAllClients Uses

func (k Keeper) GetAllClients(ctx sdk.Context) (states []exported.ClientState)

GetAllClients returns all stored light client State objects.

func (Keeper) GetAllConsensusStates Uses

func (k Keeper) GetAllConsensusStates(ctx sdk.Context) (clientConsStates []types.ClientConsensusStates)

GetAllConsensusStates returns all stored client consensus states. NOTE: non deterministic.

func (Keeper) GetAllGenesisClients Uses

func (k Keeper) GetAllGenesisClients(ctx sdk.Context) (genClients []types.GenesisClientState)

GetAllGenesisClients returns all the clients in state with their client ids returned as GenesisClientState

func (Keeper) GetClientConsensusState Uses

func (k Keeper) GetClientConsensusState(ctx sdk.Context, clientID string, height uint64) (exported.ConsensusState, bool)

GetClientConsensusState gets the stored consensus state from a client at a given height.

func (Keeper) GetClientConsensusStateLTE Uses

func (k Keeper) GetClientConsensusStateLTE(ctx sdk.Context, clientID string, maxHeight uint64) (exported.ConsensusState, bool)

GetClientConsensusStateLTE will get the latest ConsensusState of a particular client at the latest height less than or equal to the given height

func (Keeper) GetClientState Uses

func (k Keeper) GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool)

GetClientState gets a particular client from the store

func (Keeper) GetClientType Uses

func (k Keeper) GetClientType(ctx sdk.Context, clientID string) (exported.ClientType, bool)

GetClientType gets the consensus type for a specific client

func (Keeper) GetLatestClientConsensusState Uses

func (k Keeper) GetLatestClientConsensusState(ctx sdk.Context, clientID string) (exported.ConsensusState, bool)

GetLatestClientConsensusState gets the latest ConsensusState stored for a given client

func (Keeper) GetSelfConsensusState Uses

func (k Keeper) GetSelfConsensusState(ctx sdk.Context, height uint64) (exported.ConsensusState, bool)

GetSelfConsensusState introspects the (self) past historical info at a given height and returns the expected consensus state at that height.

func (Keeper) HasClientConsensusState Uses

func (k Keeper) HasClientConsensusState(ctx sdk.Context, clientID string, height uint64) bool

HasClientConsensusState returns if keeper has a ConsensusState for a particular client at the given height

func (Keeper) IterateClients Uses

func (k Keeper) IterateClients(ctx sdk.Context, cb func(clientID string, cs exported.ClientState) bool)

IterateClients 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 Uses

func (k Keeper) IterateConsensusStates(ctx sdk.Context, cb func(clientID string, cs exported.ConsensusState) 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) Logger Uses

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) SetClientConsensusState Uses

func (k Keeper) SetClientConsensusState(ctx sdk.Context, clientID string, height uint64, consensusState exported.ConsensusState)

SetClientConsensusState sets a ConsensusState to a particular client at the given height

func (Keeper) SetClientState Uses

func (k Keeper) SetClientState(ctx sdk.Context, clientID string, clientState exported.ClientState)

SetClientState sets a particular Client to the store

func (Keeper) SetClientType Uses

func (k Keeper) SetClientType(ctx sdk.Context, clientID string, clientType exported.ClientType)

SetClientType sets the specific client consensus type to the provable store

func (Keeper) UpdateClient Uses

func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, header exported.Header) (exported.ClientState, error)

UpdateClient updates the consensus state and the state root from a provided header

Package keeper imports 18 packages (graph) and is imported by 2 packages. Updated 2020-08-05. Refresh now. Tools for package owners.