Documentation ¶
Overview ¶
Package keeper manages second layer voting. It caches votes until they are sent out in a batch and tallies the results.
Index ¶
- func GetMigrationHandler(k Keeper) func(ctx sdk.Context) error
- func MigrateVoteData(cdc codec.BinaryCodec, chain nexus.ChainName, data *codectypes.Any, ...) *codectypes.Any
- func NewMsgServerImpl(keeper Keeper) types.MsgServiceServer
- type Keeper
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPoll(ctx sdk.Context, pollKey exported.PollKey) exported.Poll
- func (k Keeper) GetPollQueue(ctx sdk.Context) utils.KVQueue
- func (k Keeper) GetVoteRouter() types.VoteRouter
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k Keeper) InitializePoll(ctx sdk.Context, key exported.PollKey, voterAddresses []sdk.ValAddress, ...) error
- func (k Keeper) InitializePollWithSnapshot(ctx sdk.Context, key exported.PollKey, snapshotSeqNo int64, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetVoteRouter(router types.VoteRouter)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMigrationHandler ¶ added in v0.18.0
GetMigrationHandler returns the handler that performs in-place store migrations from v0.17 to v0.18. The migration includes: - delete all pending polls - migrate all completed polls
func MigrateVoteData ¶ added in v0.18.0
func MigrateVoteData(cdc codec.BinaryCodec, chain nexus.ChainName, data *codectypes.Any, logger log.Logger) *codectypes.Any
MigrateVoteData migrates vote results from an Any slice to a single Any value
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) 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) GetPollQueue ¶ added in v0.18.0
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, key exported.PollKey, voterAddresses []sdk.ValAddress, pollProperties ...exported.PollProperty) error
InitializePoll initializes a new poll with the given validators
func (Keeper) InitializePollWithSnapshot ¶
func (k Keeper) InitializePollWithSnapshot(ctx sdk.Context, key exported.PollKey, snapshotSeqNo int64, pollProperties ...exported.PollProperty) error
InitializePollWithSnapshot initializes a new poll with the given snapshot sequence number
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