keeper

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

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

This section is empty.

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, snapshotter types.Snapshotter, staking types.StakingKeeper, rewarder types.Rewarder) Keeper

NewKeeper - keeper constructor

func (Keeper) GetDefaultVotingThreshold

func (k Keeper) GetDefaultVotingThreshold(ctx sdk.Context) utils.Threshold

GetDefaultVotingThreshold returns the default voting power threshold that must be reached to decide a poll

func (Keeper) GetPoll

func (k Keeper) GetPoll(ctx sdk.Context, pollKey exported.PollKey) exported.Poll

GetPoll returns an existing poll to record votes

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) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetDefaultVotingThreshold

func (k Keeper) SetDefaultVotingThreshold(ctx sdk.Context, threshold utils.Threshold)

SetDefaultVotingThreshold sets the default voting power threshold that must be reached to decide a poll

Jump to

Keyboard shortcuts

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