Versions in this module Expand all Collapse all v0 v0.39.3 Sep 4, 2021 Changes in this version + const AttributeKeyOption + const AttributeKeyProposalID + const AttributeKeyProposalResult + const AttributeKeyProposalType + const AttributeKeyVotingPeriodStart + const AttributeValueCategory + const AttributeValueProposalDropped + const AttributeValueProposalFailed + const AttributeValueProposalPassed + const AttributeValueProposalRejected + const DefaultParamspace + const DefaultPeriod + const DefaultStartingProposalID + const EventTypeActiveProposal + const EventTypeInactiveProposal + const EventTypeProposalDeposit + const EventTypeProposalVote + const EventTypeSubmitProposal + const MaxDescriptionLength + const MaxTitleLength + const ModuleName + const ParamDeposit + const ParamTallying + const ParamVoting + const ProposalTypeText + const QuerierRoute + const QueryDeposit + const QueryDeposits + const QueryParams + const QueryProposal + const QueryProposals + const QueryTally + const QueryVote + const QueryVotes + const RouterKey + const StoreKey + const TypeMsgDeposit + const TypeMsgSubmitProposal + const TypeMsgVote + var ActiveProposalQueuePrefix = []byte + var DefaultMinDepositTokens = sdk.TokensFromConsensusPower(10) + var DefaultQuorum = sdk.NewDecWithPrec(334, 3) + var DefaultThreshold = sdk.NewDecWithPrec(5, 1) + var DefaultVeto = sdk.NewDecWithPrec(334, 3) + var DepositsKeyPrefix = []byte + var ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 3, "proposal already active") + var ErrInactiveProposal = sdkerrors.Register(ModuleName, 2, "inactive proposal") + var ErrInvalidGenesis = sdkerrors.Register(ModuleName, 7, "invalid genesis state") + var ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 4, "invalid proposal content") + var ErrInvalidProposalType = sdkerrors.Register(ModuleName, 5, "invalid proposal type") + var ErrInvalidVote = sdkerrors.Register(ModuleName, 6, "invalid vote option") + var ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 8, "no handler exists for proposal type") + var ErrUnknownProposal = sdkerrors.Register(ModuleName, 1, "unknown proposal") + var InactiveProposalQueuePrefix = []byte + var ModuleCdc = codec.New() + var ParamStoreKeyDepositParams = []byte("depositparams") + var ParamStoreKeyTallyParams = []byte("tallyparams") + var ParamStoreKeyVotingParams = []byte("votingparams") + var ProposalIDKey = []byte + var ProposalsKeyPrefix = []byte + var VotesKeyPrefix = []byte + func ActiveProposalByTimeKey(endTime time.Time) []byte + func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte + func DepositKey(proposalID uint64, depositorAddr sdk.AccAddress) []byte + func DepositsKey(proposalID uint64) []byte + func GetProposalIDBytes(proposalID uint64) (proposalIDBz []byte) + func GetProposalIDFromBytes(bz []byte) (proposalID uint64) + func InactiveProposalByTimeKey(endTime time.Time) []byte + func InactiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte + func IsValidProposalType(ty string) bool + func ParamKeyTable() params.KeyTable + func ProposalHandler(_ sdk.Context, c Content) error + func ProposalKey(proposalID uint64) []byte + func RegisterCodec(cdc *codec.Codec) + func RegisterProposalType(ty string) + func RegisterProposalTypeCodec(o interface{}, name string) + func SplitActiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time) + func SplitInactiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time) + func SplitKeyDeposit(key []byte) (proposalID uint64, depositorAddr sdk.AccAddress) + func SplitKeyVote(key []byte) (proposalID uint64, voterAddr sdk.AccAddress) + func SplitProposalKey(key []byte) (proposalID uint64) + func ValidProposalStatus(status ProposalStatus) bool + func ValidVoteOption(option VoteOption) bool + func ValidateAbstract(c Content) error + func ValidateGenesis(data GenesisState) error + func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte + func VotesKey(proposalID uint64) []byte + type AccountKeeper interface + GetAccount func(ctx sdk.Context, addr sdk.AccAddress) authexported.Account + type Content interface + GetDescription func() string + GetTitle func() string + ProposalRoute func() string + ProposalType func() string + String func() string + ValidateBasic func() error + func ContentFromProposalType(title, desc, ty string) Content + func NewTextProposal(title, description string) Content + type Deposit struct + Amount sdk.Coins + Depositor sdk.AccAddress + ProposalID uint64 + func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit + func (d Deposit) Empty() bool + func (d Deposit) Equals(comp Deposit) bool + func (d Deposit) String() string + type DepositParams struct + MaxDepositPeriod time.Duration + MinDeposit sdk.Coins + func DefaultDepositParams() DepositParams + func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams + func (dp DepositParams) Equal(dp2 DepositParams) bool + func (dp DepositParams) String() string + type Deposits []Deposit + func (d Deposits) String() string + type GenesisState struct + DepositParams DepositParams + Deposits Deposits + Proposals Proposals + StartingProposalID uint64 + TallyParams TallyParams + Votes Votes + VotingParams VotingParams + func DefaultGenesisState() GenesisState + func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) GenesisState + func (data GenesisState) Equal(data2 GenesisState) bool + func (data GenesisState) IsEmpty() bool + type Handler func(ctx sdk.Context, content Content) error + type MsgDeposit struct + Amount sdk.Coins + Depositor sdk.AccAddress + ProposalID uint64 + func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) MsgDeposit + func (msg MsgDeposit) GetSignBytes() []byte + func (msg MsgDeposit) GetSigners() []sdk.AccAddress + func (msg MsgDeposit) Route() string + func (msg MsgDeposit) String() string + func (msg MsgDeposit) Type() string + func (msg MsgDeposit) ValidateBasic() error + type MsgSubmitProposal struct + Content Content + InitialDeposit sdk.Coins + Proposer sdk.AccAddress + func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) MsgSubmitProposal + func (msg MsgSubmitProposal) GetSignBytes() []byte + func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress + func (msg MsgSubmitProposal) Route() string + func (msg MsgSubmitProposal) String() string + func (msg MsgSubmitProposal) Type() string + func (msg MsgSubmitProposal) ValidateBasic() error + type MsgVote struct + Option VoteOption + ProposalID uint64 + Voter sdk.AccAddress + func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) MsgVote + func (msg MsgVote) GetSignBytes() []byte + func (msg MsgVote) GetSigners() []sdk.AccAddress + func (msg MsgVote) Route() string + func (msg MsgVote) String() string + func (msg MsgVote) Type() string + func (msg MsgVote) ValidateBasic() error + type ParamSubspace interface + Get func(ctx sdk.Context, key []byte, ptr interface{}) + Set func(ctx sdk.Context, key []byte, param interface{}) + type Params struct + DepositParams DepositParams + TallyParams TallyParams + VotingParams VotingParams + func DefaultParams() Params + func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params + func (gp Params) String() string + type Proposal struct + DepositEndTime time.Time + FinalTallyResult TallyResult + ProposalID uint64 + Status ProposalStatus + SubmitTime time.Time + TotalDeposit sdk.Coins + VotingEndTime time.Time + VotingStartTime time.Time + func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Time) Proposal + func (p Proposal) String() string + type ProposalQueue []uint64 + type ProposalStatus byte + const StatusDepositPeriod + const StatusFailed + const StatusNil + const StatusPassed + const StatusRejected + const StatusVotingPeriod + func ProposalStatusFromString(str string) (ProposalStatus, error) + func (status *ProposalStatus) Unmarshal(data []byte) error + func (status *ProposalStatus) UnmarshalJSON(data []byte) error + func (status ProposalStatus) Format(s fmt.State, verb rune) + func (status ProposalStatus) Marshal() ([]byte, error) + func (status ProposalStatus) MarshalJSON() ([]byte, error) + func (status ProposalStatus) String() string + type Proposals []Proposal + func (p Proposals) String() string + type QueryDepositParams struct + Depositor sdk.AccAddress + ProposalID uint64 + func NewQueryDepositParams(proposalID uint64, depositor sdk.AccAddress) QueryDepositParams + type QueryProposalParams struct + ProposalID uint64 + func NewQueryProposalParams(proposalID uint64) QueryProposalParams + type QueryProposalVotesParams struct + Limit int + Page int + ProposalID uint64 + func NewQueryProposalVotesParams(proposalID uint64, page, limit int) QueryProposalVotesParams + type QueryProposalsParams struct + Depositor sdk.AccAddress + Limit int + Page int + ProposalStatus ProposalStatus + Voter sdk.AccAddress + func NewQueryProposalsParams(page, limit int, status ProposalStatus, voter, depositor sdk.AccAddress) QueryProposalsParams + type QueryVoteParams struct + ProposalID uint64 + Voter sdk.AccAddress + func NewQueryVoteParams(proposalID uint64, voter sdk.AccAddress) QueryVoteParams + type Router interface + AddRoute func(r string, h Handler) (rtr Router) + GetRoute func(path string) (h Handler) + HasRoute func(r string) bool + Seal func() + func NewRouter() Router + type StakingKeeper interface + IterateBondedValidatorsByPower func(sdk.Context, ...) + IterateDelegations func(ctx sdk.Context, delegator sdk.AccAddress, ...) + TotalBondedTokens func(sdk.Context) sdk.Int + type SupplyKeeper interface + BurnCoins func(ctx sdk.Context, name string, amt sdk.Coins) error + GetModuleAccount func(ctx sdk.Context, name string) supplyexported.ModuleAccountI + GetModuleAddress func(name string) sdk.AccAddress + SendCoinsFromAccountToModule func(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error + SendCoinsFromModuleToAccount func(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error + SetModuleAccount func(sdk.Context, supplyexported.ModuleAccountI) + type TallyParams struct + Quorum sdk.Dec + Threshold sdk.Dec + Veto sdk.Dec + func DefaultTallyParams() TallyParams + func NewTallyParams(quorum, threshold, veto sdk.Dec) TallyParams + func (tp TallyParams) String() string + type TallyResult struct + Abstain sdk.Int + No sdk.Int + NoWithVeto sdk.Int + Yes sdk.Int + func EmptyTallyResult() TallyResult + func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult + func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult + func (tr TallyResult) Equals(comp TallyResult) bool + func (tr TallyResult) String() string + type TextProposal struct + Description string + Title string + func (tp TextProposal) GetDescription() string + func (tp TextProposal) GetTitle() string + func (tp TextProposal) ProposalRoute() string + func (tp TextProposal) ProposalType() string + func (tp TextProposal) String() string + func (tp TextProposal) ValidateBasic() error + type ValidatorGovInfo struct + Address sdk.ValAddress + BondedTokens sdk.Int + DelegatorDeductions sdk.Dec + DelegatorShares sdk.Dec + Vote VoteOption + func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, ...) ValidatorGovInfo + type Vote struct + Option VoteOption + ProposalID uint64 + Voter sdk.AccAddress + func NewVote(proposalID uint64, voter sdk.AccAddress, option VoteOption) Vote + func (v Vote) Empty() bool + func (v Vote) Equals(comp Vote) bool + func (v Vote) String() string + type VoteOption byte + const OptionAbstain + const OptionEmpty + const OptionNo + const OptionNoWithVeto + const OptionYes + func VoteOptionFromString(str string) (VoteOption, error) + func (vo *VoteOption) Unmarshal(data []byte) error + func (vo *VoteOption) UnmarshalJSON(data []byte) error + func (vo VoteOption) Format(s fmt.State, verb rune) + func (vo VoteOption) Marshal() ([]byte, error) + func (vo VoteOption) MarshalJSON() ([]byte, error) + func (vo VoteOption) String() string + type Votes []Vote + func (v Votes) String() string + type VotingParams struct + VotingPeriod time.Duration + func DefaultVotingParams() VotingParams + func NewVotingParams(votingPeriod time.Duration) VotingParams + func (vp VotingParams) String() string v0.39.3-sdk Sep 5, 2021 v0.39.3-rename Sep 5, 2021 v0.39.3-ledger-fix Sep 6, 2021 v0.39.3-fix Sep 5, 2021 v0.39.3-f Sep 5, 2021 v0.39.3-aphrename-fix Sep 6, 2021 v0.39.3-aphrename.mod Sep 6, 2021 v0.33.9-fix Sep 5, 2021