Versions in this module Expand all Collapse all v0 v0.33.2 Apr 3, 2019 Changes in this version + const CodeAddressNotStaked + const CodeAlreadyActiveProposal + const CodeAlreadyFinishedProposal + const CodeInactiveProposal + const CodeInvalidDescription + const CodeInvalidGenesis + const CodeInvalidProposalStatus + const CodeInvalidProposalType + const CodeInvalidTitle + const CodeInvalidVote + const CodeUnknownProposal + const DefaultCodespace + const DefaultParamspace + const DefaultPeriod + const MaxDescriptionLength + const MaxTitleLength + const ModuleName + const ParamDeposit + const ParamTallying + const ParamVoting + 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 BurnedDepositCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("govBurnedDepositCoins"))) + var DepositedCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("govDepositedCoins"))) + var KeyDelimiter = []byte(":") + var KeyNextProposalID = []byte("newProposalID") + var ParamStoreKeyDepositParams = []byte("depositparams") + var ParamStoreKeyTallyParams = []byte("tallyparams") + var ParamStoreKeyVotingParams = []byte("votingparams") + var PrefixActiveProposalQueue = []byte("activeProposalQueue") + var PrefixInactiveProposalQueue = []byte("inactiveProposalQueue") + func EndBlocker(ctx sdk.Context, keeper Keeper) sdk.Tags + func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error + func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error + func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error + func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error + func ErrInvalidDescription(codespace sdk.CodespaceType, errorMsg string) sdk.Error + func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error + func ErrInvalidProposalType(codespace sdk.CodespaceType, proposalType ProposalKind) sdk.Error + func ErrInvalidTitle(codespace sdk.CodespaceType, errorMsg string) sdk.Error + func ErrInvalidVote(codespace sdk.CodespaceType, voteOption VoteOption) sdk.Error + func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error + func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) + func KeyActiveProposalQueueProposal(endTime time.Time, proposalID uint64) []byte + func KeyDeposit(proposalID uint64, depositorAddr sdk.AccAddress) []byte + func KeyDepositsSubspace(proposalID uint64) []byte + func KeyInactiveProposalQueueProposal(endTime time.Time, proposalID uint64) []byte + func KeyProposal(proposalID uint64) []byte + func KeyVote(proposalID uint64, voterAddr sdk.AccAddress) []byte + func KeyVotesSubspace(proposalID uint64) []byte + func NewHandler(keeper Keeper) sdk.Handler + func NewQuerier(keeper Keeper) sdk.Querier + func ParamKeyTable() params.KeyTable + func PrefixActiveProposalQueueTime(endTime time.Time) []byte + func PrefixInactiveProposalQueueTime(endTime time.Time) []byte + func ProposalEqual(proposalA Proposal, proposalB Proposal) bool + func RegisterCodec(cdc *codec.Codec) + func SortAddresses(addrs []sdk.AccAddress) + func SortByteArrays(src [][]byte) [][]byte + func SortValAddresses(addrs []sdk.ValAddress) + func ValidateGenesis(data GenesisState) error + type BankKeeper interface + GetCoins func(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SendCoins func(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.Tags, sdk.Error) + SetSendEnabled func(ctx sdk.Context, enabled bool) + type Deposit struct + Amount sdk.Coins + Depositor sdk.AccAddress + ProposalID uint64 + 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 (dp DepositParams) Equal(dp2 DepositParams) bool + func (dp DepositParams) String() string + type DepositWithMetadata struct + Deposit Deposit + ProposalID uint64 + type Deposits []Deposit + func (d Deposits) String() string + type GenesisState struct + DepositParams DepositParams + Deposits []DepositWithMetadata + Proposals []Proposal + StartingProposalID uint64 + TallyParams TallyParams + Votes []VoteWithMetadata + VotingParams VotingParams + func DefaultGenesisState() GenesisState + func ExportGenesis(ctx sdk.Context, k Keeper) 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 Keeper struct + func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramsKeeper params.Keeper, ...) Keeper + func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator + func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, ...) (sdk.Error, bool) + func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) sdk.Error + func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID uint64) + func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) + func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (Deposit, bool) + func (keeper Keeper) GetDepositParams(ctx sdk.Context) DepositParams + func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) sdk.Iterator + func (keeper Keeper) GetLastProposalID(ctx sdk.Context) (proposalID uint64) + func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) Proposal + 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, bool) + func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) sdk.Iterator + func (keeper Keeper) GetVotingParams(ctx sdk.Context) VotingParams + func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator + func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64) + func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64) + func (keeper Keeper) NewTextProposal(ctx sdk.Context, title string, description string, proposalType ProposalKind) Proposal + func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID uint64) + func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64) + func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64) + func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal) + 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() sdk.Error + type MsgSubmitProposal struct + Description string + InitialDeposit sdk.Coins + ProposalType ProposalKind + Proposer sdk.AccAddress + Title string + func NewMsgSubmitProposal(title, description string, proposalType ProposalKind, 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() sdk.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() sdk.Error + type Params struct + DepositParams DepositParams + TallyParams TallyParams + VotingParams VotingParams + func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params + func (gp Params) String() string + type Proposal interface + GetDepositEndTime func() time.Time + GetDescription func() string + GetFinalTallyResult func() TallyResult + GetProposalID func() uint64 + GetProposalType func() ProposalKind + GetStatus func() ProposalStatus + GetSubmitTime func() time.Time + GetTitle func() string + GetTotalDeposit func() sdk.Coins + GetVotingEndTime func() time.Time + GetVotingStartTime func() time.Time + SetDepositEndTime func(time.Time) + SetDescription func(string) + SetFinalTallyResult func(TallyResult) + SetProposalID func(uint64) + SetProposalType func(ProposalKind) + SetStatus func(ProposalStatus) + SetSubmitTime func(time.Time) + SetTitle func(string) + SetTotalDeposit func(sdk.Coins) + SetVotingEndTime func(time.Time) + SetVotingStartTime func(time.Time) + String func() string + type ProposalKind byte + const ProposalTypeNil + const ProposalTypeParameterChange + const ProposalTypeSoftwareUpgrade + const ProposalTypeText + func ProposalTypeFromString(str string) (ProposalKind, error) + func (pt *ProposalKind) Unmarshal(data []byte) error + func (pt *ProposalKind) UnmarshalJSON(data []byte) error + func (pt ProposalKind) Format(s fmt.State, verb rune) + func (pt ProposalKind) Marshal() ([]byte, error) + func (pt ProposalKind) MarshalJSON() ([]byte, error) + func (pt ProposalKind) String() string + type ProposalQueue []uint64 + type ProposalStatus byte + const StatusDepositPeriod + 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 QueryProposalsParams struct + Depositor sdk.AccAddress + Limit uint64 + ProposalStatus ProposalStatus + Voter sdk.AccAddress + func NewQueryProposalsParams(status ProposalStatus, limit uint64, voter, depositor sdk.AccAddress) QueryProposalsParams + type QueryVoteParams struct + ProposalID uint64 + Voter sdk.AccAddress + func NewQueryVoteParams(proposalID uint64, voter sdk.AccAddress) QueryVoteParams + type TallyParams struct + Quorum sdk.Dec + Threshold sdk.Dec + Veto sdk.Dec + 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 + DepositEndTime time.Time + Description string + FinalTallyResult TallyResult + ProposalID uint64 + ProposalType ProposalKind + Status ProposalStatus + SubmitTime time.Time + Title string + TotalDeposit sdk.Coins + VotingEndTime time.Time + VotingStartTime time.Time + func (tp *TextProposal) SetDepositEndTime(depositEndTime time.Time) + func (tp *TextProposal) SetDescription(description string) + func (tp *TextProposal) SetFinalTallyResult(tallyResult TallyResult) + func (tp *TextProposal) SetProposalID(proposalID uint64) + func (tp *TextProposal) SetProposalType(proposalType ProposalKind) + func (tp *TextProposal) SetStatus(status ProposalStatus) + func (tp *TextProposal) SetSubmitTime(submitTime time.Time) + func (tp *TextProposal) SetTitle(title string) + func (tp *TextProposal) SetTotalDeposit(totalDeposit sdk.Coins) + func (tp *TextProposal) SetVotingEndTime(votingEndTime time.Time) + func (tp *TextProposal) SetVotingStartTime(votingStartTime time.Time) + func (tp TextProposal) GetDepositEndTime() time.Time + func (tp TextProposal) GetDescription() string + func (tp TextProposal) GetFinalTallyResult() TallyResult + func (tp TextProposal) GetProposalID() uint64 + func (tp TextProposal) GetProposalType() ProposalKind + func (tp TextProposal) GetStatus() ProposalStatus + func (tp TextProposal) GetSubmitTime() time.Time + func (tp TextProposal) GetTitle() string + func (tp TextProposal) GetTotalDeposit() sdk.Coins + func (tp TextProposal) GetVotingEndTime() time.Time + func (tp TextProposal) GetVotingStartTime() time.Time + func (tp TextProposal) String() string + type Vote struct + Option VoteOption + ProposalID uint64 + Voter sdk.AccAddress + 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 VoteWithMetadata struct + ProposalID uint64 + Vote Vote + type Votes []Vote + func (v Votes) String() string + type VotingParams struct + VotingPeriod time.Duration + func (vp VotingParams) String() string