Documentation ¶
Overview ¶
Package keeper specifies the keeper for the gov module.
Index ¶
- func NewCustomQueryServer(k *Keeper) typesv1.CustomQueryServer
- func NewLegacyMsgServerImpl(govAcct string, v1Server govtypesv1.MsgServer, k Keeper) govtypesv1beta1.MsgServer
- func NewMsgServerImpl(keeper Keeper) govtypesv1.MsgServer
- func SecurityTally(ctx context.Context, k Keeper, proposal govtypesv1.Proposal) (bool, bool, govtypesv1.TallyResult)
- type Keeper
- func (k Keeper) AddCertifierVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) error
- func (k Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) error
- func (k Keeper) CertifierVoteIsRequired(ctx context.Context, proposalID uint64) (bool, error)
- func (k Keeper) DeleteVotes(ctx context.Context, proposalID uint64) error
- func (k Keeper) GetCertifierVoted(ctx context.Context, proposalID uint64) (bool, error)
- func (k Keeper) GetCustomParams(ctx context.Context) (customParams typesv1.CustomParams, err error)
- func (k Keeper) IsCertifier(ctx context.Context, addr sdk.AccAddress) (bool, error)
- func (k Keeper) SetCertVote(ctx context.Context, proposalID uint64) error
- func (k Keeper) SetCertifierVoted(ctx context.Context, proposalID uint64) error
- func (k Keeper) SetCustomParams(ctx context.Context, customAddParams typesv1.CustomParams) error
- func (k Keeper) Tally(ctx context.Context, proposal govtypesv1.Proposal) (passes, burnDeposits bool, tallyResults govtypesv1.TallyResult, err error)
- type Migrator
- type TallyHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCustomQueryServer ¶ added in v2.13.0
func NewCustomQueryServer(k *Keeper) typesv1.CustomQueryServer
func NewLegacyMsgServerImpl ¶ added in v2.10.0
func NewLegacyMsgServerImpl(govAcct string, v1Server govtypesv1.MsgServer, k Keeper) govtypesv1beta1.MsgServer
NewLegacyMsgServerImpl returns an implementation of the v1beta1 legacy MsgServer interface. It wraps around the current MsgServer
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper Keeper) govtypesv1.MsgServer
NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.
func SecurityTally ¶
func SecurityTally(ctx context.Context, k Keeper, proposal govtypesv1.Proposal) (bool, bool, govtypesv1.TallyResult)
SecurityTally only gets called if the proposal is a software upgrade or certifier update and if it is the certifier round. If the proposal passes, we set up the validator voting round and the calling function EndBlocker continues to the next iteration. If it fails, the proposal is removed by the logic in EndBlocker.
Types ¶
type Keeper ¶
Keeper implements keeper for the governance module.
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeService store.KVStoreService, bankKeeper govtypes.BankKeeper, stakingKeeper types.StakingKeeper, certKeeper types.CertKeeper, authKeeper govtypes.AccountKeeper, distrKeeper types.DistributionKeeper, legacyRouter v1beta1.Router, router baseapp.MessageRouter, config govtypes.Config, authority string, ) Keeper
NewKeeper returns a governance keeper. It handles: - submitting governance proposals - depositing funds into proposals, and activating upon sufficient funds being deposited - users voting on proposals, with weight proportional to stake in the system - and tallying the result of the vote.
func (Keeper) AddCertifierVote ¶ added in v2.7.0
func (k Keeper) AddCertifierVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, options govtypesv1.WeightedVoteOptions) error
AddCertifierVote add a certifier vote
func (Keeper) AddVote ¶
func (k Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, options govtypesv1.WeightedVoteOptions, metadata string) error
AddVote Adds a vote on a specific proposal.
func (Keeper) CertifierVoteIsRequired ¶ added in v2.10.0
func (Keeper) DeleteVotes ¶ added in v2.12.0
DeleteVotes deletes all the votes from a given proposalID.
func (Keeper) GetCertifierVoted ¶ added in v2.7.0
GetCertifierVoted determine cert vote for custom proposal types have finished
func (Keeper) GetCustomParams ¶ added in v2.7.0
GetCustomParams returns the current CustomParams from the global param store.
func (Keeper) IsCertifier ¶
IsCertifier checks if the input address is a certifier.
func (Keeper) SetCertVote ¶ added in v2.7.0
SetCertVote sets a cert vote to the gov store
func (Keeper) SetCertifierVoted ¶ added in v2.7.0
func (Keeper) SetCustomParams ¶ added in v2.7.0
SetCustomParams sets parameters space for custom.
func (Keeper) Tally ¶
func (k Keeper) Tally(ctx context.Context, proposal govtypesv1.Proposal) (passes, burnDeposits bool, tallyResults govtypesv1.TallyResult, err error)
Tally iterates over the votes and updates the tally of a proposal based on the voting power of the voters
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
func NewMigrator(keeper Keeper, legacySubspace exported.ParamSubspace) Migrator
NewMigrator returns a new Migrator.
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
func (Migrator) Migrate2to3 ¶ added in v2.7.0
Migrate2to3 migrates from version 2 to 3.
func (Migrator) Migrate3to4 ¶ added in v2.10.0
Migrate3to4 migrates from version 3 to 4.
func (Migrator) Migrate4to5 ¶ added in v2.11.0
Migrate4to5 migrates from version 4 to 5.
type TallyHelper ¶
type TallyHelper struct {
// contains filtered or unexported fields
}
TallyHelper reduces number of arguments passed to passAndVetoStakeResult.