Versions in this module Expand all Collapse all v0 v0.23.1 Jul 27, 2018 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 MsgType + var KeyActiveProposalQueue = []byte("activeProposalQueue") + var KeyInactiveProposalQueue = []byte("inactiveProposalQueue") + var KeyNextProposalID = []byte("newProposalID") + func EndBlocker(ctx sdk.Context, keeper Keeper) (tags sdk.Tags, nonVotingVals []sdk.AccAddress) + func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error + func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error + func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error + func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error + func ErrInvalidDescription(codespace sdk.CodespaceType, description 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, title string) sdk.Error + func ErrInvalidVote(codespace sdk.CodespaceType, voteOption VoteOption) sdk.Error + func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error + func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) + func KeyDeposit(proposalID int64, depositerAddr sdk.AccAddress) []byte + func KeyDepositsSubspace(proposalID int64) []byte + func KeyProposal(proposalID int64) []byte + func KeyVote(proposalID int64, voterAddr sdk.AccAddress) []byte + func KeyVotesSubspace(proposalID int64) []byte + func NewHandler(keeper Keeper) sdk.Handler + func ProposalEqual(proposalA Proposal, proposalB Proposal) bool + func RegisterWire(cdc *wire.Codec) + func SortAddresses(addrs []sdk.AccAddress) + func SortByteArrays(src [][]byte) [][]byte + type Deposit struct + Amount sdk.Coins + Depositer sdk.AccAddress + ProposalID int64 + type DepositProcedure struct + MaxDepositPeriod int64 + MinDeposit sdk.Coins + type GenesisState struct + StartingProposalID int64 + func DefaultGenesisState() GenesisState + func NewGenesisState(startingProposalID int64) GenesisState + func WriteGenesis(ctx sdk.Context, k Keeper) GenesisState + type Keeper struct + func NewKeeper(cdc *wire.Codec, key sdk.StoreKey, ck bank.Keeper, ds sdk.DelegationSet, ...) Keeper + func (keeper Keeper) ActiveProposalQueuePeek(ctx sdk.Context) Proposal + func (keeper Keeper) ActiveProposalQueuePop(ctx sdk.Context) Proposal + func (keeper Keeper) ActiveProposalQueuePush(ctx sdk.Context, proposal Proposal) + func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress, ...) (sdk.Error, bool) + func (keeper Keeper) AddVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress, option VoteOption) sdk.Error + func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID int64) + func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposal Proposal) + func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress) (Deposit, bool) + func (keeper Keeper) GetDepositProcedure() DepositProcedure + func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID int64) sdk.Iterator + func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID int64) Proposal + func (keeper Keeper) GetTallyingProcedure() TallyingProcedure + func (keeper Keeper) GetVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress) (Vote, bool) + func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID int64) sdk.Iterator + func (keeper Keeper) GetVotingProcedure() VotingProcedure + func (keeper Keeper) InactiveProposalQueuePeek(ctx sdk.Context) Proposal + func (keeper Keeper) InactiveProposalQueuePop(ctx sdk.Context) Proposal + func (keeper Keeper) InactiveProposalQueuePush(ctx sdk.Context, proposal Proposal) + func (keeper Keeper) NewTextProposal(ctx sdk.Context, title string, description string, proposalType ProposalKind) Proposal + func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID int64) + func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal) + func (keeper Keeper) WireCodec() *wire.Codec + type MsgDeposit struct + Amount sdk.Coins + Depositer sdk.AccAddress + ProposalID int64 + func NewMsgDeposit(depositer sdk.AccAddress, proposalID int64, amount sdk.Coins) MsgDeposit + func (msg MsgDeposit) Get(key interface{}) (value interface{}) + func (msg MsgDeposit) GetSignBytes() []byte + func (msg MsgDeposit) GetSigners() []sdk.AccAddress + 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 string, description string, proposalType ProposalKind, ...) MsgSubmitProposal + func (msg MsgSubmitProposal) Get(key interface{}) (value interface{}) + func (msg MsgSubmitProposal) GetSignBytes() []byte + func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress + func (msg MsgSubmitProposal) String() string + func (msg MsgSubmitProposal) Type() string + func (msg MsgSubmitProposal) ValidateBasic() sdk.Error + type MsgVote struct + Option VoteOption + ProposalID int64 + Voter sdk.AccAddress + func NewMsgVote(voter sdk.AccAddress, proposalID int64, option VoteOption) MsgVote + func (msg MsgVote) Get(key interface{}) (value interface{}) + func (msg MsgVote) GetSignBytes() []byte + func (msg MsgVote) GetSigners() []sdk.AccAddress + func (msg MsgVote) String() string + func (msg MsgVote) Type() string + func (msg MsgVote) ValidateBasic() sdk.Error + type Proposal interface + GetDescription func() string + GetProposalID func() int64 + GetProposalType func() ProposalKind + GetStatus func() ProposalStatus + GetSubmitBlock func() int64 + GetTitle func() string + GetTotalDeposit func() sdk.Coins + GetVotingStartBlock func() int64 + SetDescription func(string) + SetProposalID func(int64) + SetProposalType func(ProposalKind) + SetStatus func(ProposalStatus) + SetSubmitBlock func(int64) + SetTitle func(string) + SetTotalDeposit func(sdk.Coins) + SetVotingStartBlock func(int64) + type ProposalKind byte + 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 []int64 + type ProposalStatus byte + const StatusDepositPeriod + 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 TallyingProcedure struct + GovernancePenalty sdk.Rat + Threshold sdk.Rat + Veto sdk.Rat + type TextProposal struct + Description string + ProposalID int64 + ProposalType ProposalKind + Status ProposalStatus + SubmitBlock int64 + Title string + TotalDeposit sdk.Coins + VotingStartBlock int64 + func (tp *TextProposal) SetDescription(description string) + func (tp *TextProposal) SetProposalID(proposalID int64) + func (tp *TextProposal) SetProposalType(proposalType ProposalKind) + func (tp *TextProposal) SetStatus(status ProposalStatus) + func (tp *TextProposal) SetSubmitBlock(submitBlock int64) + func (tp *TextProposal) SetTitle(title string) + func (tp *TextProposal) SetTotalDeposit(totalDeposit sdk.Coins) + func (tp *TextProposal) SetVotingStartBlock(votingStartBlock int64) + func (tp TextProposal) GetDescription() string + func (tp TextProposal) GetProposalID() int64 + func (tp TextProposal) GetProposalType() ProposalKind + func (tp TextProposal) GetStatus() ProposalStatus + func (tp TextProposal) GetSubmitBlock() int64 + func (tp TextProposal) GetTitle() string + func (tp TextProposal) GetTotalDeposit() sdk.Coins + func (tp TextProposal) GetVotingStartBlock() int64 + type Vote struct + Option VoteOption + ProposalID int64 + Voter sdk.AccAddress + 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 VotingProcedure struct + VotingPeriod int64