Versions in this module Expand all Collapse all v0 v0.20.0 Jul 10, 2018 Changes in this version + const CodeAddressNotStaked + const CodeAlreadyActiveProposal + const CodeAlreadyFinishedProposal + const CodeInactiveProposal + const CodeInvalidDescription + const CodeInvalidGenesis + const CodeInvalidProposalType + const CodeInvalidTitle + const CodeInvalidVote + const CodeUnknownProposal + const DefaultCodespace + const MsgType + const ProposalTypeParameterChange + const ProposalTypeSoftwareUpgrade + const ProposalTypeText + const StatusDepositPeriod + const StatusPassed + const StatusRejected + const StatusVotingPeriod + 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, strProposalType string) sdk.Error + func ErrInvalidTitle(codespace sdk.CodespaceType, title string) sdk.Error + func ErrInvalidVote(codespace sdk.CodespaceType, strOption string) 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 ProposalTypeToString(proposalType ProposalKind) string + func RegisterWire(cdc *wire.Codec) + func SortAddresses(addrs []sdk.AccAddress) + func SortByteArrays(src [][]byte) [][]byte + func StatusToString(status VoteStatus) string + func VoteOptionToString(option VoteOption) string + type Deposit struct + Amount sdk.Coins + Depositer sdk.AccAddress + ProposalID int64 + type DepositProcedure struct + MaxDepositPeriod int64 + MinDeposit sdk.Coins + type DepositRest struct + Amount sdk.Coins + Depositer sdk.AccAddress + ProposalID int64 + func DepositToRest(deposit Deposit) DepositRest + 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 byte) 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() VoteStatus + GetSubmitBlock func() int64 + GetTitle func() string + GetTotalDeposit func() sdk.Coins + GetVotingStartBlock func() int64 + SetDescription func(string) + SetProposalID func(int64) + SetProposalType func(ProposalKind) + SetStatus func(VoteStatus) + SetSubmitBlock func(int64) + SetTitle func(string) + SetTotalDeposit func(sdk.Coins) + SetVotingStartBlock func(int64) + type ProposalKind = byte + func StringToProposalType(str string) (ProposalKind, sdk.Error) + type ProposalQueue []int64 + type ProposalRest struct + Description string + ProposalID int64 + ProposalType string + Status string + SubmitBlock int64 + Title string + TotalDeposit sdk.Coins + VotingStartBlock int64 + func ProposalToRest(proposal Proposal) ProposalRest + type TallyingProcedure struct + GovernancePenalty sdk.Rat + Threshold sdk.Rat + Veto sdk.Rat + type TextProposal struct + Description string + ProposalID int64 + ProposalType ProposalKind + Status VoteStatus + 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 VoteStatus) + 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() VoteStatus + 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 StringToVoteOption(str string) (VoteOption, sdk.Error) + type VoteRest struct + Option string + ProposalID int64 + Voter sdk.AccAddress + func VoteToRest(vote Vote) VoteRest + type VoteStatus = byte + func StringToStatus(status string) VoteStatus + type VotingProcedure struct + VotingPeriod int64