keeper

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package keeper manages second layer voting. It caches votes until they are sent out in a batch and tallies the results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigrationHandler added in v0.18.0

func GetMigrationHandler(k Keeper) func(ctx sdk.Context) error

GetMigrationHandler returns the handler that performs in-place store migrations from v0.19 to v0.20. The migration includes: - delete all polls - add EndBlockerLimit parameter

func NewMsgServerImpl added in v0.17.0

func NewMsgServerImpl(keeper Keeper) types.MsgServiceServer

NewMsgServerImpl returns a new msg server instance

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper - the vote module's keeper

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, snapshotter types.Snapshotter, staking types.StakingKeeper, rewarder types.Rewarder) Keeper

NewKeeper - keeper constructor

func (Keeper) DeletePoll added in v0.21.0

func (k Keeper) DeletePoll(ctx sdk.Context, pollID exported.PollID)

DeletePoll deletes the poll with the given ID

func (Keeper) ExportGenesis added in v0.9.0

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis

func (Keeper) GetParams added in v0.9.0

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of reward parameters.

func (Keeper) GetPoll

func (k Keeper) GetPoll(ctx sdk.Context, id exported.PollID) (exported.Poll, bool)

GetPoll returns an existing poll to record votes

func (Keeper) GetPollQueue added in v0.18.0

func (k Keeper) GetPollQueue(ctx sdk.Context) utils.KVQueue

GetPollQueue returns the poll queue

func (Keeper) GetVoteRouter added in v0.17.0

func (k Keeper) GetVoteRouter() types.VoteRouter

GetVoteRouter returns the nexus router. If no router was set, it returns a (sealed) router with no handlers

func (Keeper) InitGenesis added in v0.9.0

func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)

InitGenesis initialize default parameters from the genesis state

func (Keeper) InitializePoll

func (k Keeper) InitializePoll(ctx sdk.Context, pollBuilder exported.PollBuilder) (exported.PollID, error)

InitializePoll creates a poll with the given poll builder

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetParams added in v0.9.0

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the total set of reward parameters.

func (*Keeper) SetVoteRouter added in v0.17.0

func (k *Keeper) SetVoteRouter(router types.VoteRouter)

SetVoteRouter sets the vote router. It will panic if called more than once

type Querier added in v0.34.0

type Querier struct {
	// contains filtered or unexported fields
}

Querier implements the grpc queries for the nexus module

func NewGRPCQuerier added in v0.34.0

func NewGRPCQuerier(k Keeper) Querier

NewGRPCQuerier creates a new nexus Querier

func (Querier) Params added in v0.34.0

Params returns the reward module params

Jump to

Keyboard shortcuts

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