Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type CombinedTallyResults
- type Keeper
- func (k Keeper) AppendMember(ctx sdk.Context, address sdk.AccAddress, newMember types.Member)
- func (k Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64)
- func (k Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64)
- func (k Keeper) GetGovParams(ctx sdk.Context) (params govtypes_v1.Params)
- func (k Keeper) GetGuardianAddresses(ctx sdk.Context) []sdk.AccAddress
- func (k Keeper) GetGuardianWhitelist(ctx sdk.Context) (res string)
- func (k Keeper) GetGuardians(ctx sdk.Context) []*types.Member
- func (k Keeper) GetMemberAccount(ctx sdk.Context, address sdk.AccAddress) (types.Member, bool)
- func (k Keeper) GetMemberCount(ctx sdk.Context) uint64
- func (k Keeper) GetMemberStatusCount(ctx sdk.Context, s types.MembershipStatus) uint64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetTotalVotingWeight(ctx sdk.Context) (res sdk.Dec)
- func (k *Keeper) GovHooks() govtypes.GovHooks
- func (k *Keeper) GovRouter() *baseapp.MsgServiceRouter
- func (k Keeper) Guardians(goCtx context.Context, req *types.QueryGuardiansRequest) (*types.QueryGuardiansResponse, error)
- func (k Keeper) IsLegitimateProposal(ctx sdk.Context, proposal govtypes_v1.Proposal) bool
- func (k Keeper) IsMember(ctx sdk.Context, address sdk.AccAddress) bool
- func (k Keeper) IsMemberByBech32Address(ctx sdk.Context, bech32Address string) bool
- func (k Keeper) IsWhitelistedGuardian(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, ...)
- func (k Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, ...)
- func (k Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote govtypes_v1.Vote) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Member(goCtx context.Context, req *types.QueryMemberRequest) (*types.QueryMemberResponse, error)
- func (k Keeper) Members(goCtx context.Context, req *types.QueryMembersRequest) (*types.QueryMembersResponse, error)
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64)
- func (k Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
- func (k Keeper) SetMemberCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetMemberStatusCount(ctx sdk.Context, s types.MembershipStatus, count uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetProposal(ctx sdk.Context, proposal govtypes_v1.Proposal)
- func (k Keeper) Tally(ctx sdk.Context, proposal govtypes_v1.Proposal) (passes bool, burnDeposits bool, tallyResults govtypes_v1.TallyResult)
- func (k Keeper) UpdateMemberStatus(ctx sdk.Context, target sdk.AccAddress, s types.MembershipStatus) error
- type VoteOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type CombinedTallyResults ¶
type CombinedTallyResults struct {
// contains filtered or unexported fields
}
CombinedTallyResults is a struct containing the results of a tally of both guardian and regular member votes
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, ak types.AccountKeeper, gk types.GovKeeper, ) *Keeper
func (Keeper) AppendMember ¶
func (Keeper) DeleteAndBurnDeposits ¶
DeleteAndBurnDeposits deletes and burns all the deposits on a specific proposal.
func (Keeper) DeleteProposal ¶
DeleteProposal deletes a proposal from store. Panics if the proposal doesn't exist.
func (Keeper) GetGovParams ¶
func (k Keeper) GetGovParams(ctx sdk.Context) (params govtypes_v1.Params)
GetGovParams gets the governance parameters from the global param store
func (Keeper) GetGuardianAddresses ¶
func (k Keeper) GetGuardianAddresses(ctx sdk.Context) []sdk.AccAddress
GetGuardianAddresses returns all guardian addresses
func (Keeper) GetGuardianWhitelist ¶
Returns the guardian addresses defined in param NOTE: these addresses must still be validated against the electorate
func (Keeper) GetGuardians ¶
GetGuardians returns all guardians of the electorate NOTE: Only valid members with membership status of MemberElectorate are returned
func (Keeper) GetMemberAccount ¶
func (Keeper) GetMemberStatusCount ¶
func (Keeper) GetTotalVotingWeight ¶
func (*Keeper) GovRouter ¶
func (k *Keeper) GovRouter() *baseapp.MsgServiceRouter
Router returns the gov keeper's router
func (Keeper) Guardians ¶
func (k Keeper) Guardians(goCtx context.Context, req *types.QueryGuardiansRequest) (*types.QueryGuardiansResponse, error)
func (Keeper) IsLegitimateProposal ¶
IsLegitimateProposal returns true if this proposal was created by an electorate member
func (Keeper) IsMemberByBech32Address ¶
func (Keeper) IsWhitelistedGuardian ¶
IsGuardian check if the given address is a whitelisted guardian NOTE: It does not check if this address represents a member or if the member has a status of MemberElectorate
func (Keeper) IterateActiveProposalsQueue ¶
func (k Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal govtypes_v1.Proposal) (stop bool))
IterateActiveProposalsQueue cycle through proposals that have ended their voting period
func (Keeper) IterateInactiveProposalsQueue ¶
func (k Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal govtypes_v1.Proposal) (stop bool))
IterateInactiveProposalsQueue iterates over the proposals in the inactive proposal queue and performs a callback function
func (Keeper) IterateVotes ¶
func (k Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote govtypes_v1.Vote) (stop bool))
IterateVotes iterates over the all the proposals votes and performs a callback function
func (Keeper) Member ¶
func (k Keeper) Member(goCtx context.Context, req *types.QueryMemberRequest) (*types.QueryMemberResponse, error)
func (Keeper) Members ¶
func (k Keeper) Members(goCtx context.Context, req *types.QueryMembersRequest) (*types.QueryMembersResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RefundAndDeleteDeposits ¶
RefundAndDeleteDeposits refunds and deletes all the deposits on a specific proposal.
func (Keeper) RemoveFromActiveProposalQueue ¶
func (k Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)
RemoveFromActiveProposalQueue removes a proposalID from the Active Proposal Queue
func (Keeper) SetMemberStatusCount ¶
func (Keeper) SetProposal ¶
func (k Keeper) SetProposal(ctx sdk.Context, proposal govtypes_v1.Proposal)
SetProposal writes the updated proposal to the store
func (Keeper) Tally ¶
func (k Keeper) Tally(ctx sdk.Context, proposal govtypes_v1.Proposal) (passes bool, burnDeposits bool, tallyResults govtypes_v1.TallyResult)
Tally iterates over the votes and updates the tally of a proposal based on the voting power of the voters
func (Keeper) UpdateMemberStatus ¶
func (k Keeper) UpdateMemberStatus(ctx sdk.Context, target sdk.AccAddress, s types.MembershipStatus) error
type VoteOptions ¶
type VoteOptions map[govtypes_v1.VoteOption]math.Int
VoteOptions is a map of vote options to the number of votes for that option
func NewEmptyVoteOptions ¶
func NewEmptyVoteOptions() VoteOptions
makeResultMap returns a map with all the vote options set to 0