Documentation
¶
Index ¶
- Constants
- func BuildQueryDepositPath(pid uint64, depositAddr string) string
- func BuildQueryDepositsPath(pid uint64) string
- func BuildQueryModuleParamsPath(module string) string
- func BuildQueryParamPath(module string, key string) string
- func BuildQueryParamsPath() string
- func BuildQueryProposalPath(pid uint64) string
- func BuildQueryProposalsPath() string
- func BuildQueryTallyPath(pid uint64) string
- func BuildQueryVotePath(pid uint64, voterAddr string) string
- func BuildQueryVotesPath(pid uint64) string
- func DepositInvariant(module string) qtypes.Invariant
- func Query(ctx context.Context, route []string, req abci.RequestQuery) (res []byte, err btypes.Error)
- func Tally(ctx context.Context, mapper *Mapper, proposal gtypes.Proposal) (passes gtypes.ProposalResult, tallyResults gtypes.TallyResult, ...)
- type Mapper
- func (mapper Mapper) ActiveProposalQueueIterator(endTime time.Time) store.Iterator
- func (mapper Mapper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr btypes.Address, ...) (btypes.Error, bool)
- func (mapper Mapper) AddVote(proposalID uint64, voterAddr btypes.Address, option types.VoteOption) btypes.Error
- func (mapper *Mapper) Copy() mapper.IMapper
- func (mapper Mapper) DeleteDeposits(ctx context.Context, proposalID uint64)
- func (mapper Mapper) DeleteProposal(proposalID uint64)
- func (mapper Mapper) DeleteValidatorSet(proposalID uint64)
- func (mapper Mapper) DeleteVotes(proposalID uint64)
- func (mapper Mapper) GetDeposit(proposalID uint64, depositorAddr btypes.Address) (deposit types.Deposit, exists bool)
- func (mapper Mapper) GetDeposits(proposalID uint64) store.Iterator
- func (mapper Mapper) GetLastProposalID() (proposalID uint64)
- func (mapper Mapper) GetParams(ctx context.Context) types.Params
- func (mapper Mapper) GetProposal(proposalID uint64) (proposal types.Proposal, ok bool)
- func (mapper Mapper) GetProposals() []types.Proposal
- func (mapper Mapper) GetProposalsFiltered(ctx context.Context, voterAddr btypes.Address, depositorAddr btypes.Address, ...) []types.Proposal
- func (mapper Mapper) GetValidatorSet(proposalID uint64) (validators []btypes.Address, exists bool)
- func (mapper Mapper) GetVote(proposalID uint64, voterAddr btypes.Address) (vote types.Vote, exists bool)
- func (mapper Mapper) GetVotes(proposalID uint64) store.Iterator
- func (mapper Mapper) InactiveProposalQueueIterator(endTime time.Time) store.Iterator
- func (mapper Mapper) InsertActiveProposalQueue(endTime time.Time, proposalID uint64)
- func (mapper Mapper) InsertInactiveProposalQueue(endTime time.Time, proposalID uint64)
- func (mapper Mapper) PeekCurrentProposalID() (proposalID uint64, err btypes.Error)
- func (mapper Mapper) RefundDeposits(ctx context.Context, proposalID uint64, deductDeposit bool)
- func (mapper Mapper) RemoveFromActiveProposalQueue(endTime time.Time, proposalID uint64)
- func (mapper Mapper) RemoveFromInactiveProposalQueue(endTime time.Time, proposalID uint64)
- func (mapper Mapper) SetDeposit(proposalID uint64, depositorAddr btypes.Address, deposit types.Deposit)
- func (mapper Mapper) SetInitialProposalID(proposalID uint64) btypes.Error
- func (mapper Mapper) SetParams(ctx context.Context, p types.Params)
- func (mapper Mapper) SetProposal(proposal types.Proposal)
- func (mapper Mapper) SetVote(proposalID uint64, voterAddr btypes.Address, vote types.Vote)
- func (mapper Mapper) SubmitProposal(ctx context.Context, content types.ProposalContent) (proposal types.Proposal, err btypes.Error)
- type QueryProposalsParam
Constants ¶
const ( GOV = "gov" Proposals = "proposals" Proposal = "proposal" Votes = "votes" Vote = "vote" Deposits = "deposits" Deposit = "deposit" TallyQuery = "tally" ParamsPath = "params" )
nolint
const (
MapperName = "governance"
)
Variables ¶
This section is empty.
Functions ¶
func BuildQueryDepositPath ¶
nolint
func DepositInvariant ¶
func Query ¶
func Query(ctx context.Context, route []string, req abci.RequestQuery) (res []byte, err btypes.Error)
nolint
func Tally ¶
func Tally(ctx context.Context, mapper *Mapper, proposal gtypes.Proposal) (passes gtypes.ProposalResult, tallyResults gtypes.TallyResult, validators map[string]bool, deductOption gtypes.DeductOption)
Types ¶
type Mapper ¶
type Mapper struct {
*mapper.BaseMapper
}
func (Mapper) ActiveProposalQueueIterator ¶
Returns an iterator for all the proposals in the Active Queue that expire by endTime
func (Mapper) AddDeposit ¶
func (mapper Mapper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr btypes.Address, depositAmount uint64) (btypes.Error, bool)
Adds or updates a deposit of a specific depositor on a specific proposal Activates voting period when appropriate
func (Mapper) AddVote ¶
func (mapper Mapper) AddVote(proposalID uint64, voterAddr btypes.Address, option types.VoteOption) btypes.Error
Adds a vote on a specific proposal
func (Mapper) DeleteDeposits ¶
Deletes all the deposits on a specific proposal without refunding them
func (Mapper) DeleteProposal ¶
Delete proposal
func (Mapper) DeleteValidatorSet ¶
func (Mapper) GetDeposit ¶
func (mapper Mapper) GetDeposit(proposalID uint64, depositorAddr btypes.Address) (deposit types.Deposit, exists bool)
Gets the deposit of a specific depositor on a specific proposal
func (Mapper) GetDeposits ¶
Gets all the deposits on a specific proposal as an sdk.Iterator
func (Mapper) GetLastProposalID ¶
Get the last used proposal ID
func (Mapper) GetProposal ¶
Get Proposal from store by ProposalID
func (Mapper) GetProposals ¶
func (Mapper) GetProposalsFiltered ¶
func (mapper Mapper) GetProposalsFiltered(ctx context.Context, voterAddr btypes.Address, depositorAddr btypes.Address, status types.ProposalStatus, numLatest uint64) []types.Proposal
Get Proposal from store by ProposalID voterAddr will filter proposals by whether or not that address has voted on them depositorAddr will filter proposals by whether or not that address has deposited to them status will filter proposals by status numLatest will fetch a specified number of the most recent proposals, or 0 for all proposals
func (Mapper) GetValidatorSet ¶
func (Mapper) GetVote ¶
func (mapper Mapper) GetVote(proposalID uint64, voterAddr btypes.Address) (vote types.Vote, exists bool)
Gets the vote of a specific voter on a specific proposal
func (Mapper) InactiveProposalQueueIterator ¶
Returns an iterator for all the proposals in the Inactive Queue that expire by endTime
func (Mapper) InsertActiveProposalQueue ¶
Inserts a ProposalID into the active proposal queue at endTime
func (Mapper) InsertInactiveProposalQueue ¶
Inserts a ProposalID into the inactive proposal queue at endTime
func (Mapper) PeekCurrentProposalID ¶
Peeks the next available ProposalID without incrementing it
func (Mapper) RefundDeposits ¶
Refunds and deletes all the deposits on a specific proposal
func (Mapper) RemoveFromActiveProposalQueue ¶
removes a proposalID from the Active Proposal Queue
func (Mapper) RemoveFromInactiveProposalQueue ¶
removes a proposalID from the Inactive Proposal Queue
func (Mapper) SetDeposit ¶
func (Mapper) SetInitialProposalID ¶
Set the initial proposal ID
func (Mapper) SetProposal ¶
Update proposal
type QueryProposalsParam ¶
type QueryProposalsParam struct {
Depositor btypes.Address `json:"depositor"`
Voter btypes.Address `json:"voter"`
Status types.ProposalStatus `json:"status"`
Limit uint64 `json:"limit"`
}
nolint