Documentation ¶
Overview ¶
Package keeper specifies the keeper for the gov module.
Index ¶
- func NewMsgServerImpl(keeper Keeper) govtypes.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func SecurityTally(ctx sdk.Context, k Keeper, proposal govtypes.Proposal) (bool, bool, govtypes.TallyResult)
- func Tally(ctx sdk.Context, k Keeper, proposal govtypes.Proposal) (pass bool, veto bool, tallyResults govtypes.TallyResult)
- type Keeper
- func (k Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal govtypes.Proposal)
- func (k Keeper) ActivateVotingPeriodCustom(ctx sdk.Context, proposal govtypes.Proposal, addr sdk.AccAddress) bool
- func (k Keeper) AddCertifierVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) error
- func (k Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, ...) (bool, error)
- func (k Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) error
- func (k Keeper) CertVoted(c context.Context, req *types.QueryCertVotedRequest) (*types.QueryCertVotedResponse, error)
- func (k Keeper) DeleteAllVotes(ctx sdk.Context, proposalID uint64)
- func (k Keeper) GetCertifierVoted(ctx sdk.Context, proposalID uint64) bool
- func (k Keeper) GetCustomParams(ctx sdk.Context) types.CustomParams
- func (k Keeper) GetVotesIteratorPaginated(ctx sdk.Context, proposalID uint64, page, limit uint) sdk.Iterator
- func (k Keeper) HasSecurityVoting(p govtypes.Proposal) bool
- func (k Keeper) IsCertifiedIdentity(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IsCertifier(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IsCouncilMember(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) Params(c context.Context, req *govtypes.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetCertVote(ctx sdk.Context, proposalID uint64)
- func (k Keeper) SetCertifierVoted(ctx sdk.Context, proposalID uint64)
- func (k Keeper) SetCustomParams(ctx sdk.Context, customAddParams types.CustomParams)
- func (k Keeper) SubmitProposal(ctx sdk.Context, content govtypes.Content) (govtypes.Proposal, error)
- func (k Keeper) Tally(ctx sdk.Context, proposal govtypes.Proposal) (passes bool, burnDeposits bool, tallyResults govtypes.TallyResult)
- func (k Keeper) TotalBondedByCertifiedIdentities(ctx sdk.Context) sdk.Int
- type Migrator
- type TallyHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier creates a new gov Querier instance.
func SecurityTally ¶
func SecurityTally(ctx sdk.Context, k Keeper, proposal govtypes.Proposal) (bool, bool, govtypes.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 setup 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 ¶
type Keeper struct { govkeeper.Keeper // the reference to get information about certifiers CertKeeper types.CertKeeper // the reference to get claim proposal parameters ShieldKeeper types.ShieldKeeper // contains filtered or unexported fields }
Keeper implements keeper for the governance module.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace types.ParamSubspace, bankKeeper govtypes.BankKeeper, stakingKeeper types.StakingKeeper, certKeeper types.CertKeeper, shieldKeeper types.ShieldKeeper, authKeeper govtypes.AccountKeeper, router govtypes.Router, ) 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) ActivateVotingPeriod ¶
func (Keeper) ActivateVotingPeriodCustom ¶ added in v2.7.0
func (k Keeper) ActivateVotingPeriodCustom(ctx sdk.Context, proposal govtypes.Proposal, addr sdk.AccAddress) bool
ActivateVotingPeriodCustom switches proposals to voting period for customization.
func (Keeper) AddCertifierVote ¶ added in v2.7.0
func (k Keeper) AddCertifierVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options govtypes.WeightedVoteOptions) error
AddCertifierVote add a certifier vote
func (Keeper) AddDeposit ¶
func (k Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (bool, error)
AddDeposit adds or updates a deposit of a specific depositor on a specific proposal. When the proposal type is ShieldClaim, it's not depositable. Activates voting period when appropriate.
func (Keeper) AddVote ¶
func (k Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options govtypes.WeightedVoteOptions) error
AddVote Adds a vote on a specific proposal.
func (Keeper) CertVoted ¶ added in v2.7.0
func (k Keeper) CertVoted(c context.Context, req *types.QueryCertVotedRequest) (*types.QueryCertVotedResponse, error)
CertVoted returns certifier voting
func (Keeper) DeleteAllVotes ¶
DeleteAllVotes deletes all votes for a proposal.
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
func (k Keeper) GetCustomParams(ctx sdk.Context) types.CustomParams
GetCustomParams returns the current CustomParams from the global param store.
func (Keeper) GetVotesIteratorPaginated ¶
func (k Keeper) GetVotesIteratorPaginated(ctx sdk.Context, proposalID uint64, page, limit uint) sdk.Iterator
GetVotesIteratorPaginated returns an iterator to go over votes on a given proposal based on pagination parameters.
func (Keeper) HasSecurityVoting ¶ added in v2.7.0
func (Keeper) IsCertifiedIdentity ¶
IsCertifiedIdentity checks if the input address is a certified identity.
func (Keeper) IsCertifier ¶
IsCertifier checks if the input address is a certifier.
func (Keeper) IsCouncilMember ¶
IsCouncilMember checks if the address is either a validator or a certifier.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *govtypes.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries all params
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
func (k Keeper) SetCustomParams(ctx sdk.Context, customAddParams types.CustomParams)
SetCustomParams sets parameters space for custom.
func (Keeper) SubmitProposal ¶
func (k Keeper) SubmitProposal(ctx sdk.Context, content govtypes.Content) (govtypes.Proposal, error)
SubmitProposal creates a new proposal with given content.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
type TallyHelper ¶
type TallyHelper struct {
// contains filtered or unexported fields
}
TallyHelper reduces number of arguments passed to passAndVetoStakeResult.