Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func NewQueryServerImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) AddVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress, ...) error
- func (k Keeper) CloseProposal(ctx sdk.Context, proposal types.Proposal, outcome types.ProposalOutcome)
- func (k Keeper) DeleteCommittee(ctx sdk.Context, committeeID uint64)
- func (k Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64)
- func (k Keeper) DeleteProposalAndVotes(ctx sdk.Context, proposalID uint64)
- func (k Keeper) DeleteVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress)
- func (k Keeper) GetCommittee(ctx sdk.Context, committeeID uint64) (types.Committee, bool)
- func (k Keeper) GetCommittees(ctx sdk.Context) types.Committees
- func (k Keeper) GetMemberCommitteeProposalResult(ctx sdk.Context, proposalID uint64, committee types.Committee) bool
- func (k Keeper) GetNextProposalID(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (types.Proposal, bool)
- func (k Keeper) GetProposalResult(ctx sdk.Context, proposalID uint64, committee types.Committee) bool
- func (k Keeper) GetProposalTallyResponse(ctx sdk.Context, proposalID uint64) (*types.QueryTallyResponse, bool)
- func (k Keeper) GetProposals(ctx sdk.Context) types.Proposals
- func (k Keeper) GetProposalsByCommittee(ctx sdk.Context, committeeID uint64) types.Proposals
- func (k Keeper) GetTokenCommitteeProposalResult(ctx sdk.Context, proposalID uint64, committee *types.TokenCommittee) bool
- func (k Keeper) GetVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress) (types.Vote, bool)
- func (k Keeper) GetVotes(ctx sdk.Context) []types.Vote
- func (k Keeper) GetVotesByProposal(ctx sdk.Context, proposalID uint64) []types.Vote
- func (k Keeper) IncrementNextProposalID(ctx sdk.Context) error
- func (k Keeper) IterateCommittees(ctx sdk.Context, cb func(committee types.Committee) (stop bool))
- func (k Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool))
- func (k Keeper) IterateVotes(ctx sdk.Context, cb func(vote types.Vote) (stop bool))
- func (k Keeper) ProcessProposals(ctx sdk.Context)
- func (k Keeper) SetCommittee(ctx sdk.Context, committee types.Committee)
- func (k Keeper) SetNextProposalID(ctx sdk.Context, id uint64)
- func (k Keeper) SetProposal(ctx sdk.Context, proposal types.Proposal)
- func (k Keeper) SetVote(ctx sdk.Context, vote types.Vote)
- func (k Keeper) StoreNewProposal(ctx sdk.Context, pubProposal types.PubProposal, committeeID uint64, ...) (uint64, error)
- func (k Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, committeeID uint64, ...) (uint64, error)
- func (k Keeper) TallyMemberCommitteeVotes(ctx sdk.Context, proposalID uint64) (totalVotes sdk.Dec)
- func (k Keeper) TallyTokenCommitteeVotes(ctx sdk.Context, proposalID uint64, tallyDenom string) (yesVotes, noVotes, totalVotes, possibleVotes sdk.Dec)
- func (k Keeper) ValidatePubProposal(ctx sdk.Context, pubProposal types.PubProposal) (returnErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the committee MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier creates a new gov Querier instance
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) types.QueryServer
NewQueryServerImpl creates a new server for handling gRPC queries.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey, router govtypes.Router, paramKeeper types.ParamKeeper, ak types.AccountKeeper, sk types.BankKeeper, ) Keeper
func (Keeper) AddVote ¶
func (k Keeper) AddVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress, voteType types.VoteType) error
AddVote submits a vote on a proposal.
func (Keeper) CloseProposal ¶
func (k Keeper) CloseProposal(ctx sdk.Context, proposal types.Proposal, outcome types.ProposalOutcome)
CloseProposal deletes proposals and their votes, emitting an event denoting the final status of the proposal
func (Keeper) DeleteCommittee ¶
DeleteCommittee removes a committee from the store.
func (Keeper) DeleteProposal ¶
DeleteProposal removes a proposal from the store.
func (Keeper) DeleteProposalAndVotes ¶
DeleteProposalAndVotes removes a proposal and its associated votes.
func (Keeper) DeleteVote ¶
DeleteVote removes a Vote from the store.
func (Keeper) GetCommittee ¶
GetCommittee gets a committee from the store.
func (Keeper) GetCommittees ¶
func (k Keeper) GetCommittees(ctx sdk.Context) types.Committees
GetCommittees returns all stored committees.
func (Keeper) GetMemberCommitteeProposalResult ¶
func (k Keeper) GetMemberCommitteeProposalResult(ctx sdk.Context, proposalID uint64, committee types.Committee) bool
GetMemberCommitteeProposalResult gets the result of a member committee proposal
func (Keeper) GetNextProposalID ¶
GetNextProposalID reads the next available global ID from store
func (Keeper) GetProposal ¶
GetProposal gets a proposal from the store.
func (Keeper) GetProposalResult ¶
func (Keeper) GetProposalTallyResponse ¶
func (k Keeper) GetProposalTallyResponse(ctx sdk.Context, proposalID uint64) (*types.QueryTallyResponse, bool)
GetProposalTallyResponse returns the tally results of a proposal.
func (Keeper) GetProposals ¶
GetProposals returns all stored proposals.
func (Keeper) GetProposalsByCommittee ¶
GetProposalsByCommittee returns all proposals for one committee.
func (Keeper) GetTokenCommitteeProposalResult ¶
func (k Keeper) GetTokenCommitteeProposalResult(ctx sdk.Context, proposalID uint64, committee *types.TokenCommittee) bool
GetTokenCommitteeProposalResult gets the result of a token committee proposal
func (Keeper) GetVote ¶
func (k Keeper) GetVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress) (types.Vote, bool)
GetVote gets a vote from the store.
func (Keeper) GetVotesByProposal ¶
GetVotesByProposal returns all votes for one proposal.
func (Keeper) IncrementNextProposalID ¶
IncrementNextProposalID increments the next proposal ID in the store by 1.
func (Keeper) IterateCommittees ¶
IterateCommittees provides an iterator over all stored committees. For each committee, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) IterateProposals ¶
IterateProposals provides an iterator over all stored proposals. For each proposal, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) IterateVotes ¶
IterateVotes provides an iterator over all stored votes. For each vote, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) ProcessProposals ¶
func (Keeper) SetCommittee ¶
SetCommittee puts a committee into the store.
func (Keeper) SetNextProposalID ¶
SetNextProposalID stores an ID to be used for the next created proposal
func (Keeper) SetProposal ¶
SetProposal puts a proposal into the store.
func (Keeper) StoreNewProposal ¶
func (k Keeper) StoreNewProposal(ctx sdk.Context, pubProposal types.PubProposal, committeeID uint64, deadline time.Time) (uint64, error)
StoreNewProposal stores a proposal, adding a new ID
func (Keeper) SubmitProposal ¶
func (k Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, committeeID uint64, pubProposal types.PubProposal) (uint64, error)
SubmitProposal adds a proposal to a committee so that it can be voted on.
func (Keeper) TallyMemberCommitteeVotes ¶
TallyMemberCommitteeVotes returns the polling status of a member committee vote
func (Keeper) TallyTokenCommitteeVotes ¶
func (k Keeper) TallyTokenCommitteeVotes(ctx sdk.Context, proposalID uint64, tallyDenom string, ) (yesVotes, noVotes, totalVotes, possibleVotes sdk.Dec)
TallyMemberCommitteeVotes returns the polling status of a token committee vote. Returns yes votes, total current votes, total possible votes (equal to token supply), vote threshold (yes vote ratio required for proposal to pass), and quorum (votes tallied at this percentage).
func (Keeper) ValidatePubProposal ¶
func (k Keeper) ValidatePubProposal(ctx sdk.Context, pubProposal types.PubProposal) (returnErr error)
ValidatePubProposal checks if a pubproposal is valid.