Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories:
Index ¶
- Constants
- Variables
- func AllInvariants(keeper Keeper) sdk.Invariant
- func CreateGenAccounts(numAccs int, genCoins types.Coins) (genAccs []auth.Account, addrs []types.AccAddress, pubKeys []crypto.PubKey, ...)
- func EndBlocker(ctx sdk.Context, keeper Keeper)
- func GenDepositParamsDepositPeriod(r *rand.Rand) time.Duration
- func GenDepositParamsMinDeposit(r *rand.Rand) sdk.Coins
- func GenTallyParamsQuorum(r *rand.Rand) sdk.Dec
- func GenTallyParamsThreshold(r *rand.Rand) sdk.Dec
- func GenTallyParamsVeto(r *rand.Rand) sdk.Dec
- func GenVotingParamsVotingPeriod(r *rand.Rand) time.Duration
- func InitGenesis(ctx sdk.Context, k Keeper, supplyKeeper SupplyKeeper, data GenesisState)
- func ModuleAccountInvariant(keeper Keeper) sdk.Invariant
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func ParamChanges(r *rand.Rand) []simtypes.ParamChange
- func ProposalContents() []simtypes.WeightedProposalContent
- func RandomizedGenState(simState *module.SimulationState)
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func SimulateMsgDeposit(ak AccountKeeper, k Keeper) simtypes.Operation
- func SimulateMsgVote(ak AccountKeeper, k Keeper) simtypes.Operation
- func SimulateSubmitProposal(ak AccountKeeper, k Keeper, contentSim simtypes.ContentSimulatorFn) simtypes.Operation
- func SimulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content
- func WeightedOperations(appParams simtypes.AppParams, cdc *codec.Codec, ak AccountKeeper, k Keeper, ...) simulation.WeightedOperations
- type AccountKeeper
- type AddrKeys
- type AddrKeysSlice
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) GenerateGenesisState(simState *module.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent
- func (AppModule) QuerierRoute() string
- func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (AppModule) Route() string
- func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation
- func (am *AppModule) WithAccountKeeper(ak AccountKeeper) *AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (a AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type Content
- type Deposit
- type DepositParams
- type Deposits
- type GenesisState
- type Handler
- type Keeper
- func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, ...) (bool, error)
- func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) error
- func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits Deposits)
- func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes Votes)
- func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit Deposit, found bool)
- func (keeper Keeper) GetDepositParams(ctx sdk.Context) DepositParams
- func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits Deposits)
- func (keeper Keeper) GetDepositsIterator(ctx sdk.Context, proposalID uint64) sdk.Iterator
- func (keeper Keeper) GetGovernanceAccount(ctx sdk.Context) exported.ModuleAccountI
- func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (proposal Proposal, ok bool)
- func (keeper Keeper) GetProposalID(ctx sdk.Context) (proposalID uint64, err error)
- func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals Proposals)
- func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, voterAddr sdk.AccAddress, depositorAddr sdk.AccAddress, ...) []Proposal
- func (keeper Keeper) GetTallyParams(ctx sdk.Context) TallyParams
- func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote Vote, found bool)
- func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes Votes)
- func (keeper Keeper) GetVotesIterator(ctx sdk.Context, proposalID uint64) sdk.Iterator
- func (keeper Keeper) GetVotingParams(ctx sdk.Context) VotingParams
- func (keeper Keeper) Getcdc() *codec.Codec
- func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
- func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
- func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, ...)
- func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))
- func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) (stop bool))
- func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit types.Deposit) (stop bool))
- func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, ...)
- func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool))
- func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.Vote) (stop bool))
- func (keeper Keeper) Logger(ctx sdk.Context) log.Logger
- func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
- func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
- func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal)
- func (keeper *Keeper) SetRouter(rtr Router)
- func (keeper Keeper) SetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, vote Vote)
- func (keeper Keeper) SoftwareUpgradeClear(ctx sdk.Context)
- func (keeper Keeper) SoftwareUpgradeProposalExist(ctx sdk.Context) bool
- func (keeper Keeper) SoftwareUpgradeSet(ctx sdk.Context)
- func (keeper Keeper) SubmitProposal(ctx sdk.Context, content Content, proposer sdk.AccAddress) (Proposal, error)
- type MsgDeposit
- type MsgSubmitProposal
- type MsgVote
- type ParamSubspace
- type Params
- type Proposal
- type ProposalQueue
- type ProposalStatus
- type Proposals
- type QueryDepositParams
- type QueryProposalParams
- type QueryProposalsParams
- type QueryVoteParams
- type Router
- type SoftwareUpgradeProposal
- type StakingKeeper
- type SupplyKeeper
- type TallyParams
- type TallyResult
- type TextProposal
- type Vote
- type VoteOption
- type Votes
- type VotingParams
Constants ¶
const ( MaxDescriptionLength = types.MaxDescriptionLength MaxTitleLength = types.MaxTitleLength ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute DefaultParamspace = types.DefaultParamspace TypeMsgDeposit = types.TypeMsgDeposit TypeMsgVote = types.TypeMsgVote TypeMsgSubmitProposal = types.TypeMsgSubmitProposal StatusNil = types.StatusNil StatusDepositPeriod = types.StatusDepositPeriod StatusVotingPeriod = types.StatusVotingPeriod StatusPassed = types.StatusPassed StatusRejected = types.StatusRejected StatusFailed = types.StatusFailed ProposalTypeText = types.ProposalTypeText ProposalTypeSoftwareUpgrade = types.ProposalTypeSoftwareUpgrade QueryParams = types.QueryParams QueryProposals = types.QueryProposals QueryProposal = types.QueryProposal QueryDeposits = types.QueryDeposits QueryDeposit = types.QueryDeposit QueryVotes = types.QueryVotes QueryVote = types.QueryVote QueryTally = types.QueryTally ParamDeposit = types.ParamDeposit ParamVoting = types.ParamVoting ParamTallying = types.ParamTallying OptionEmpty = types.OptionEmpty OptionYes = types.OptionYes OptionAbstain = types.OptionAbstain OptionNo = types.OptionNo OptionNoWithVeto = types.OptionNoWithVeto )
const ( DepositParamsMinDeposit = "deposit_params_min_deposit" DepositParamsDepositPeriod = "deposit_params_deposit_period" VotingParamsVotingPeriod = "voting_params_voting_period" TallyParamsQuorum = "tally_params_quorum" TallyParamsThreshold = "tally_params_threshold" TallyParamsVeto = "tally_params_veto" )
Simulation parameter constants
const ( OpWeightMsgDeposit = "op_weight_msg_deposit" OpWeightMsgVote = "op_weight_msg_vote" )
Simulation operation weights constants
const OpWeightSubmitTextProposal = "op_weight_submit_text_proposal"
OpWeightSubmitTextProposal app params key for text proposal
Variables ¶
var ( // functions aliases RegisterCodec = types.RegisterCodec RegisterProposalTypeCodec = types.RegisterProposalTypeCodec ValidateAbstract = types.ValidateAbstract NewDeposit = types.NewDeposit ErrUnknownProposal = types.ErrUnknownProposal ErrInactiveProposal = types.ErrInactiveProposal ErrAlreadyActiveProposal = types.ErrAlreadyActiveProposal ErrInvalidProposalContent = types.ErrInvalidProposalContent ErrInvalidProposalType = types.ErrInvalidProposalType ErrInvalidVote = types.ErrInvalidVote ErrInvalidGenesis = types.ErrInvalidGenesis ErrNoProposalHandlerExists = types.ErrNoProposalHandlerExists DefaultGenesisState = types.DefaultGenesisState NewGenesisState = types.NewGenesisState ValidateGenesis = types.ValidateGenesis ProposalKey = types.ProposalKey ActiveProposalByTimeKey = types.ActiveProposalByTimeKey ActiveProposalQueueKey = types.ActiveProposalQueueKey InactiveProposalByTimeKey = types.InactiveProposalByTimeKey InactiveProposalQueueKey = types.InactiveProposalQueueKey DepositsKey = types.DepositsKey DepositKey = types.DepositKey VotesKey = types.VotesKey VoteKey = types.VoteKey SplitProposalKey = types.SplitProposalKey SplitActiveProposalQueueKey = types.SplitActiveProposalQueueKey SplitInactiveProposalQueueKey = types.SplitInactiveProposalQueueKey SplitKeyDeposit = types.SplitKeyDeposit SplitKeyVote = types.SplitKeyVote NewMsgSubmitProposal = types.NewMsgSubmitProposal NewMsgDeposit = types.NewMsgDeposit NewMsgVote = types.NewMsgVote ParamKeyTable = types.ParamKeyTable NewDepositParams = types.NewDepositParams NewTallyParams = types.NewTallyParams NewVotingParams = types.NewVotingParams NewParams = types.NewParams NewProposal = types.NewProposal ProposalStatusFromString = types.ProposalStatusFromString ValidProposalStatus = types.ValidProposalStatus NewTallyResult = types.NewTallyResult NewTallyResultFromMap = types.NewTallyResultFromMap EmptyTallyResult = types.EmptyTallyResult NewTextProposal = types.NewTextProposal RegisterProposalType = types.RegisterProposalType ContentFromProposalType = types.ContentFromProposalType IsValidProposalType = types.IsValidProposalType NewQueryProposalParams = types.NewQueryProposalParams NewQueryDepositParams = types.NewQueryDepositParams NewQueryVoteParams = types.NewQueryVoteParams NewQueryProposalsParams = types.NewQueryProposalsParams NewVote = types.NewVote VoteOptionFromString = types.VoteOptionFromString ValidVoteOption = types.ValidVoteOption // variable aliases ModuleCdc = types.ModuleCdc ProposalsKeyPrefix = types.ProposalsKeyPrefix ActiveProposalQueuePrefix = types.ActiveProposalQueuePrefix InactiveProposalQueuePrefix = types.InactiveProposalQueuePrefix ProposalIDKey = types.ProposalIDKey DepositsKeyPrefix = types.DepositsKeyPrefix VotesKeyPrefix = types.VotesKeyPrefix ParamStoreKeyDepositParams = types.ParamStoreKeyDepositParams ParamStoreKeyVotingParams = types.ParamStoreKeyVotingParams ParamStoreKeyTallyParams = types.ParamStoreKeyTallyParams )
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the governance module
func CreateGenAccounts ¶
func CreateGenAccounts(numAccs int, genCoins types.Coins) ( genAccs []auth.Account, addrs []types.AccAddress, pubKeys []crypto.PubKey, privKeys []crypto.PrivKey)
CreateGenAccounts generates genesis accounts loaded with coins, and returns their addresses, pubkeys, and privkeys.
func EndBlocker ¶
EndBlocker called every block, process inflation, update validator set.
func GenDepositParamsDepositPeriod ¶
GenDepositParamsDepositPeriod randomized DepositParamsDepositPeriod
func GenDepositParamsMinDeposit ¶
GenDepositParamsMinDeposit randomized DepositParamsMinDeposit
func GenTallyParamsQuorum ¶
GenTallyParamsQuorum randomized TallyParamsQuorum
func GenTallyParamsThreshold ¶
GenTallyParamsThreshold randomized TallyParamsThreshold
func GenTallyParamsVeto ¶
GenTallyParamsVeto randomized TallyParamsVeto
func GenVotingParamsVotingPeriod ¶
GenVotingParamsVotingPeriod randomized VotingParamsVotingPeriod
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, supplyKeeper SupplyKeeper, data GenesisState)
InitGenesis - store genesis parameters
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the module account coins reflects the sum of deposit amounts held on store
func NewHandler ¶
func NewQuerier ¶
func ParamChanges ¶
func ParamChanges(r *rand.Rand) []simtypes.ParamChange
ParamChanges defines the parameters that can be modified by param change proposals on the simulation
func ProposalContents ¶
func ProposalContents() []simtypes.WeightedProposalContent
ProposalContents defines the module weighted proposals' contents
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for gov
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all governance invariants
func SimulateMsgDeposit ¶
func SimulateMsgDeposit(ak AccountKeeper, k Keeper) simtypes.Operation
SimulateMsgDeposit generates a MsgDeposit with random values.
func SimulateMsgVote ¶
func SimulateMsgVote(ak AccountKeeper, k Keeper) simtypes.Operation
SimulateMsgVote generates a MsgVote with random values.
func SimulateSubmitProposal ¶
func SimulateSubmitProposal(ak AccountKeeper, k Keeper, contentSim simtypes.ContentSimulatorFn) simtypes.Operation
SimulateSubmitProposal simulates creating a msg Submit Proposal voting on the proposal, and subsequently slashing the proposal. It is implemented using future operations.
func SimulateTextProposalContent ¶
func SimulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content
SimulateTextProposalContent returns a random text proposal content.
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, cdc *codec.Codec, ak AccountKeeper, k Keeper, wContents []simtypes.WeightedProposalContent) simulation.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}
AccountKeeper defines the expected account keeper (noalias)
type AddrKeys ¶
AddrKeys Type that combines an Address with the privKey and pubKey to that address
func NewAddrKeys ¶
NewAddrKeys constructor of AddrKeys
type AddrKeysSlice ¶
type AddrKeysSlice []AddrKeys
AddrKeysSlice implement `Interface` in sort package.
func (AddrKeysSlice) Len ¶
func (b AddrKeysSlice) Len() int
func (AddrKeysSlice) Less ¶
func (b AddrKeysSlice) Less(i, j int) bool
Less Sorts lexographically by Address
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ AppModule implements an application module for the gov module.
func NewAppModule ¶
func NewAppModule(keeper Keeper, supplyKeeper SupplyKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock performs a no-op.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the gov module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the gov module.
func (AppModule) GenerateGenesisState ¶
func (am AppModule) GenerateGenesisState(simState *module.SimulationState)
for simulation GenerateGenesisState creates a randomized GenState of the gov module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the gov module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the gov module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns no sdk.Querier.
func (AppModule) ProposalContents ¶
func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent
ProposalContents returns all the gov content functions used to simulate governance proposals.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the gov module's querier route name.
func (AppModule) RandomizedParams ¶
func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange
RandomizedParams creates randomized gov param changes for the simulator.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants registers module invariants
func (AppModule) WeightedOperations ¶
func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation
WeightedOperations returns the all the gov module operations with their respective weights.
func (*AppModule) WithAccountKeeper ¶
func (am *AppModule) WithAccountKeeper(ak AccountKeeper) *AppModule
type AppModuleBasic ¶
type AppModuleBasic struct {
// contains filtered or unexported fields
}
AppModuleBasic defines the basic application module used by the gov module.
func NewAppModuleBasic ¶
func NewAppModuleBasic(proposalHandlers ...client.ProposalHandler) AppModuleBasic
NewAppModuleBasic creates a new AppModuleBasic object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the gov module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the gov module.
func (AppModuleBasic) GetTxCmd ¶
func (a AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the gov module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the gov module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the gov module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the gov module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the gov module.
type DepositParams ¶
type DepositParams = types.DepositParams
type GenesisState ¶
type GenesisState = types.GenesisState
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis - output genesis parameters
type Handler ¶
func NewGovProposalHandler ¶
NewGovProposalHandler returns an sdk.Handler for gov proposal
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the governance module Keeper
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, key sdk.StoreKey, paramSpace ParamSubspace, supplyKeeper SupplyKeeper, sk StakingKeeper, gk guardian.Keeper, pk sdk.ProtocolKeeper, ) 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. 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.
CONTRACT: the parameter Subspace must have the param key table already initialized
func (Keeper) ActivateVotingPeriod ¶
ActivateVotingPeriod - active voting period
func (Keeper) ActiveProposalQueueIterator ¶
ActiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Active Queue that expire by endTime
func (Keeper) AddDeposit ¶
func (keeper 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 Activates voting period when appropriate
func (Keeper) AddVote ¶
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, option VoteOption) error
AddVote Adds a vote on a specific proposal
func (Keeper) DeleteDeposits ¶
DeleteDeposits deletes all the deposits on a specific proposal without refunding them
func (Keeper) DeleteProposal ¶
DeleteProposal deletes a proposal from store
func (Keeper) GetAllDeposits ¶
GetAllDeposits returns all the deposits from the store
func (Keeper) GetAllVotes ¶
GetAllVotes returns all the votes from the store
func (Keeper) GetDeposit ¶
func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit Deposit, found bool)
GetDeposit gets the deposit of a specific depositor on a specific proposal
func (Keeper) GetDepositParams ¶
func (keeper Keeper) GetDepositParams(ctx sdk.Context) DepositParams
Returns the current DepositParams from the global param store
func (Keeper) GetDeposits ¶
GetDeposits returns all the deposits from a proposal
func (Keeper) GetDepositsIterator ¶
GetDepositsIterator gets all the deposits on a specific proposal as an sdk.Iterator
func (Keeper) GetGovernanceAccount ¶
func (keeper Keeper) GetGovernanceAccount(ctx sdk.Context) exported.ModuleAccountI
GetGovernanceAccount returns the governance ModuleAccount
func (Keeper) GetProposal ¶
GetProposal get Proposal from store by ProposalID
func (Keeper) GetProposalID ¶
GetProposalID gets the highest proposal ID
func (Keeper) GetProposals ¶
GetProposals returns all the proposals from store
func (Keeper) GetProposalsFiltered ¶
func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, voterAddr sdk.AccAddress, depositorAddr sdk.AccAddress, status ProposalStatus, numLatest uint64) []Proposal
GetProposalsFiltered get Proposals from store by ProposalID voterAddr will filter proposals by whether or not that address has voted on them depositorAddr will filter proposals by whether or not that address has deposited to them status will filter proposals by status numLatest will fetch a specified number of the most recent proposals, or 0 for all proposals
func (Keeper) GetTallyParams ¶
func (keeper Keeper) GetTallyParams(ctx sdk.Context) TallyParams
Returns the current TallyParam from the global param store
func (Keeper) GetVote ¶
func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote Vote, found bool)
GetVote gets the vote from an address on a specific proposal
func (Keeper) GetVotesIterator ¶
GetVotesIterator gets all the votes on a specific proposal as an sdk.Iterator
func (Keeper) GetVotingParams ¶
func (keeper Keeper) GetVotingParams(ctx sdk.Context) VotingParams
Returns the current VotingParams from the global param store
func (Keeper) InactiveProposalQueueIterator ¶
InactiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Inactive Queue that expire by endTime
func (Keeper) InsertActiveProposalQueue ¶
func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
InsertActiveProposalQueue inserts a ProposalID into the active proposal queue at endTime
func (Keeper) InsertInactiveProposalQueue ¶
func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
InsertInactiveProposalQueue Inserts a ProposalID into the inactive proposal queue at endTime
func (Keeper) IterateActiveProposalsQueue ¶
func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool))
IterateActiveProposalsQueue iterates over the proposals in the active proposal queue and performs a callback function
func (Keeper) IterateAllDeposits ¶
func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))
IterateAllDeposits iterates over the all the stored deposits and performs a callback function
func (Keeper) IterateAllVotes ¶
IterateAllVotes iterates over the all the stored votes and performs a callback function
func (Keeper) IterateDeposits ¶
func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit types.Deposit) (stop bool))
IterateDeposits iterates over the all the proposals deposits and performs a callback function
func (Keeper) IterateInactiveProposalsQueue ¶
func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool))
IterateInactiveProposalsQueue iterates over the proposals in the inactive proposal queue and performs a callback function
func (Keeper) IterateProposals ¶
func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool))
IterateProposals iterates over the all the proposals and performs a callback function
func (Keeper) IterateVotes ¶
func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.Vote) (stop bool))
IterateVotes iterates over the all the proposals votes and performs a callback function
func (Keeper) RefundDeposits ¶
RefundDeposits refunds and deletes all the deposits on a specific proposal
func (Keeper) RemoveFromActiveProposalQueue ¶
func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
RemoveFromActiveProposalQueue removes a proposalID from the Active Proposal Queue
func (Keeper) RemoveFromInactiveProposalQueue ¶
func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
RemoveFromInactiveProposalQueue removes a proposalID from the Inactive Proposal Queue
func (Keeper) SetProposal ¶
SetProposal set a proposal to store
func (Keeper) SoftwareUpgradeClear ¶
func (Keeper) SoftwareUpgradeProposalExist ¶
func (Keeper) SoftwareUpgradeSet ¶
func (Keeper) SubmitProposal ¶
func (keeper Keeper) SubmitProposal(ctx sdk.Context, content Content, proposer sdk.AccAddress) (Proposal, error)
SubmitProposal create new proposal given a content
type MsgDeposit ¶
type MsgDeposit = types.MsgDeposit
type MsgSubmitProposal ¶
type MsgSubmitProposal = types.MsgSubmitProposal
type ParamSubspace ¶
type ParamSubspace interface { Get(ctx sdk.Context, key []byte, ptr interface{}) Set(ctx sdk.Context, key []byte, param interface{}) }
ParamSubspace defines the expected Subspace interface for parameters (noalias)
type ProposalQueue ¶
type ProposalQueue = types.ProposalQueue
type ProposalStatus ¶
type ProposalStatus = types.ProposalStatus
type QueryDepositParams ¶
type QueryDepositParams = types.QueryDepositParams
type QueryProposalParams ¶
type QueryProposalParams = types.QueryProposalParams
type QueryProposalsParams ¶
type QueryProposalsParams = types.QueryProposalsParams
type QueryVoteParams ¶
type QueryVoteParams = types.QueryVoteParams
type Router ¶
type Router interface { AddRoute(r string, h Handler) (rtr Router) HasRoute(r string) bool GetRoute(path string) (h Handler) Seal() }
Router implements a governance Handler router.
TODO: Use generic router (ref #3976).
type SoftwareUpgradeProposal ¶
type SoftwareUpgradeProposal = types.SoftwareUpgradeProposal
type StakingKeeper ¶
type StakingKeeper interface { // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingexported.ValidatorI) (stop bool)) TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingexported.DelegationI) (stop bool)) }
StakingKeeper expected staking keeper (Validator and Delegator sets)
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
SupplyKeeper defines the supply Keeper for module accounts
type TallyParams ¶
type TallyParams = types.TallyParams
type TallyResult ¶
type TallyResult = types.TallyResult
type TextProposal ¶
type TextProposal = types.TextProposal
type VoteOption ¶
type VoteOption = types.VoteOption
type VotingParams ¶
type VotingParams = types.VotingParams