Versions in this module Expand all Collapse all v0 v0.2.0 Nov 8, 2019 Changes in this version + const AttributeKeyOption + const AttributeKeyProposalID + const AttributeKeyProposalResult + const AttributeKeyVotingPeriodStart + const AttributeValueCategory + const AttributeValueProposalDropped + const AttributeValueProposalFailed + const AttributeValueProposalPassed + const AttributeValueProposalRejected + const CodeAddressNotStaked + const CodeAlreadyActiveProposal + const CodeAlreadyFinishedProposal + const CodeInactiveProposal + const CodeInvalidContent + const CodeInvalidGenesis + const CodeInvalidProposalStatus + const CodeInvalidProposalType + const CodeInvalidVote + const CodeProposalHandlerNotExists + const CodeUnknownProposal + const DefaultCodespace + const DefaultParamspace + const EventTypeActiveProposal + const EventTypeInactiveProposal + const EventTypeProposalDeposit + const EventTypeProposalVote + const EventTypeSubmitProposal + const MaxDescriptionLength + const MaxTitleLength + const ModuleName + const ParamDeposit + const ParamTallying + const ParamVoting + const ProposalTypeSoftwareUpgrade + 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 DepositsKeyPrefix = []byte + 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 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 ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error + func ErrInvalidProposalContent(cs sdk.CodespaceType, msg string) sdk.Error + func ErrInvalidProposalType(codespace sdk.CodespaceType, proposalType string) sdk.Error + func ErrInvalidVote(codespace sdk.CodespaceType, voteOption VoteOption) sdk.Error + func ErrNoProposalHandlerExists(codespace sdk.CodespaceType, content interface{}) sdk.Error + func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error + 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) sdk.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(codespace sdk.CodespaceType, c Content) sdk.Error + func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte + func VotesKey(proposalID uint64) []byte + type Content interface + GetDescription func() string + GetTitle func() string + ProposalRoute func() string + ProposalType func() string + String func() string + ValidateBasic func() sdk.Error + func ContentFromProposalType(title, desc, ty string) Content + func NewSoftwareUpgradeProposal(title, description string) Content + func NewTextProposal(title, description string) Content + type Deposit struct + Amount sdk.Tokens + Depositor sdk.AccAddress + ProposalID uint64 + func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Tokens) 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.Tokens + func NewDepositParams(minDeposit sdk.Tokens, 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 Handler func(ctx sdk.Context, content Content) sdk.Error + type MsgDeposit struct + Amount sdk.Tokens + Depositor sdk.AccAddress + ProposalID uint64 + func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Tokens) 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 + Content Content + InitialDeposit sdk.Tokens + Proposer sdk.AccAddress + func NewMsgSubmitProposal(content Content, initialDeposit sdk.Tokens, 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 struct + DepositEndTime time.Time + FinalTallyResult TallyResult + ProposalID uint64 + Status ProposalStatus + SubmitTime time.Time + TotalDeposit sdk.Tokens + 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 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 SoftwareUpgradeProposal struct + Description string + Title string + func (sup SoftwareUpgradeProposal) GetDescription() string + func (sup SoftwareUpgradeProposal) GetTitle() string + func (sup SoftwareUpgradeProposal) ProposalRoute() string + func (sup SoftwareUpgradeProposal) ProposalType() string + func (sup SoftwareUpgradeProposal) String() string + func (sup SoftwareUpgradeProposal) ValidateBasic() sdk.Error + type TallyParams struct + Quorum sdk.Dec + Threshold sdk.Dec + Veto sdk.Dec + 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() sdk.Error + 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 NewVotingParams(votingPeriod time.Duration) VotingParams + func (vp VotingParams) String() string