Documentation ¶
Index ¶
- Constants
- func GroupTotalWeightInvariant(keeper Keeper) sdk.Invariant
- func GroupTotalWeightInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, groupTable orm.AutoUInt64Table, ...) (string, bool)
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- type Keeper
- func (k Keeper) CreateGroup(goCtx context.Context, msg *group.MsgCreateGroup) (*group.MsgCreateGroupResponse, error)
- func (k Keeper) CreateGroupPolicy(goCtx context.Context, msg *group.MsgCreateGroupPolicy) (*group.MsgCreateGroupPolicyResponse, error)
- func (k Keeper) CreateGroupWithPolicy(ctx context.Context, msg *group.MsgCreateGroupWithPolicy) (*group.MsgCreateGroupWithPolicyResponse, error)
- func (k Keeper) Exec(goCtx context.Context, msg *group.MsgExec) (*group.MsgExecResponse, error)
- func (k Keeper) ExportGenesis(ctx types.Context, _ codec.JSONCodec) *group.GenesisState
- func (k Keeper) GetGroupPolicySeq(ctx sdk.Context) uint64
- func (k Keeper) GetGroupSequence(ctx sdk.Context) uint64
- func (k Keeper) GroupInfo(goCtx context.Context, request *group.QueryGroupInfoRequest) (*group.QueryGroupInfoResponse, error)
- func (k Keeper) GroupMembers(goCtx context.Context, request *group.QueryGroupMembersRequest) (*group.QueryGroupMembersResponse, error)
- func (k Keeper) GroupPoliciesByAdmin(goCtx context.Context, request *group.QueryGroupPoliciesByAdminRequest) (*group.QueryGroupPoliciesByAdminResponse, error)
- func (k Keeper) GroupPoliciesByGroup(goCtx context.Context, request *group.QueryGroupPoliciesByGroupRequest) (*group.QueryGroupPoliciesByGroupResponse, error)
- func (k Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error)
- func (k Keeper) Groups(goCtx context.Context, request *group.QueryGroupsRequest) (*group.QueryGroupsResponse, error)
- func (k Keeper) GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsByAdminRequest) (*group.QueryGroupsByAdminResponse, error)
- func (k Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroupsByMemberRequest) (*group.QueryGroupsByMemberResponse, error)
- func (k Keeper) InitGenesis(ctx types.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate
- func (k Keeper) LeaveGroup(goCtx context.Context, msg *group.MsgLeaveGroup) (*group.MsgLeaveGroupResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Proposal(goCtx context.Context, request *group.QueryProposalRequest) (*group.QueryProposalResponse, error)
- func (k Keeper) ProposalsByGroupPolicy(goCtx context.Context, request *group.QueryProposalsByGroupPolicyRequest) (*group.QueryProposalsByGroupPolicyResponse, error)
- func (k Keeper) PruneProposals(ctx sdk.Context) error
- func (k Keeper) SubmitProposal(goCtx context.Context, msg *group.MsgSubmitProposal) (*group.MsgSubmitProposalResponse, error)
- func (k Keeper) Tally(ctx sdk.Context, p group.Proposal, groupID uint64) (group.TallyResult, error)
- func (k Keeper) TallyProposalsAtVPEnd(ctx sdk.Context) error
- func (k Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResultRequest) (*group.QueryTallyResultResponse, error)
- func (k Keeper) UpdateGroupAdmin(goCtx context.Context, msg *group.MsgUpdateGroupAdmin) (*group.MsgUpdateGroupAdminResponse, error)
- func (k Keeper) UpdateGroupMembers(goCtx context.Context, msg *group.MsgUpdateGroupMembers) (*group.MsgUpdateGroupMembersResponse, error)
- func (k Keeper) UpdateGroupMetadata(goCtx context.Context, msg *group.MsgUpdateGroupMetadata) (*group.MsgUpdateGroupMetadataResponse, error)
- func (k Keeper) UpdateGroupPolicyAdmin(goCtx context.Context, msg *group.MsgUpdateGroupPolicyAdmin) (*group.MsgUpdateGroupPolicyAdminResponse, error)
- func (k Keeper) UpdateGroupPolicyDecisionPolicy(goCtx context.Context, msg *group.MsgUpdateGroupPolicyDecisionPolicy) (*group.MsgUpdateGroupPolicyDecisionPolicyResponse, error)
- func (k Keeper) UpdateGroupPolicyMetadata(goCtx context.Context, msg *group.MsgUpdateGroupPolicyMetadata) (*group.MsgUpdateGroupPolicyMetadataResponse, error)
- func (k Keeper) Vote(goCtx context.Context, msg *group.MsgVote) (*group.MsgVoteResponse, error)
- func (k Keeper) VoteByProposalVoter(goCtx context.Context, request *group.QueryVoteByProposalVoterRequest) (*group.QueryVoteByProposalVoterResponse, error)
- func (k Keeper) VotesByProposal(goCtx context.Context, request *group.QueryVotesByProposalRequest) (*group.QueryVotesByProposalResponse, error)
- func (k Keeper) VotesByVoter(goCtx context.Context, request *group.QueryVotesByVoterRequest) (*group.QueryVotesByVoterResponse, error)
- func (k Keeper) WithdrawProposal(goCtx context.Context, msg *group.MsgWithdrawProposal) (*group.MsgWithdrawProposalResponse, error)
- type Migrator
Constants ¶
const ( // Group Table GroupTablePrefix byte = 0x0 GroupTableSeqPrefix byte = 0x1 GroupByAdminIndexPrefix byte = 0x2 // Group Member Table GroupMemberTablePrefix byte = 0x10 GroupMemberByGroupIndexPrefix byte = 0x11 GroupMemberByMemberIndexPrefix byte = 0x12 // Group Policy Table GroupPolicyTablePrefix byte = 0x20 GroupPolicyTableSeqPrefix byte = 0x21 GroupPolicyByGroupIndexPrefix byte = 0x22 GroupPolicyByAdminIndexPrefix byte = 0x23 // Proposal Table ProposalTablePrefix byte = 0x30 ProposalTableSeqPrefix byte = 0x31 ProposalByGroupPolicyIndexPrefix byte = 0x32 ProposalsByVotingPeriodEndPrefix byte = 0x33 // Vote Table VoteTablePrefix byte = 0x40 VoteByProposalIndexPrefix byte = 0x41 VoteByVoterIndexPrefix byte = 0x42 )
Variables ¶
This section is empty.
Functions ¶
func GroupTotalWeightInvariant ¶
GroupTotalWeightInvariant checks that group's TotalWeight must be equal to the sum of its members.
func GroupTotalWeightInvariantHelper ¶
func GroupTotalWeightInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, groupTable orm.AutoUInt64Table, groupMemberByGroupIndex orm.Index) (string, bool)
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all group invariants.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(storeKey storetypes.StoreKey, cdc codec.Codec, router baseapp.MessageRouter, accKeeper group.AccountKeeper, config group.Config) Keeper
NewKeeper creates a new group keeper.
func (Keeper) CreateGroup ¶
func (k Keeper) CreateGroup(goCtx context.Context, msg *group.MsgCreateGroup) (*group.MsgCreateGroupResponse, error)
func (Keeper) CreateGroupPolicy ¶
func (k Keeper) CreateGroupPolicy(goCtx context.Context, msg *group.MsgCreateGroupPolicy) (*group.MsgCreateGroupPolicyResponse, error)
func (Keeper) CreateGroupWithPolicy ¶
func (k Keeper) CreateGroupWithPolicy(ctx context.Context, msg *group.MsgCreateGroupWithPolicy) (*group.MsgCreateGroupWithPolicyResponse, error)
func (Keeper) ExportGenesis ¶
ExportGenesis returns the group module's exported genesis.
func (Keeper) GetGroupPolicySeq ¶
GetGroupPolicySeq returns the current value of the group policy table sequence
func (Keeper) GetGroupSequence ¶
GetGroupSequence returns the current value of the group table sequence
func (Keeper) GroupInfo ¶
func (k Keeper) GroupInfo(goCtx context.Context, request *group.QueryGroupInfoRequest) (*group.QueryGroupInfoResponse, error)
GroupInfo queries info about a group.
func (Keeper) GroupMembers ¶
func (k Keeper) GroupMembers(goCtx context.Context, request *group.QueryGroupMembersRequest) (*group.QueryGroupMembersResponse, error)
GroupMembers queries all members of a group.
func (Keeper) GroupPoliciesByAdmin ¶
func (k Keeper) GroupPoliciesByAdmin(goCtx context.Context, request *group.QueryGroupPoliciesByAdminRequest) (*group.QueryGroupPoliciesByAdminResponse, error)
GroupPoliciesByAdmin queries all groups policies where a given address is admin.
func (Keeper) GroupPoliciesByGroup ¶
func (k Keeper) GroupPoliciesByGroup(goCtx context.Context, request *group.QueryGroupPoliciesByGroupRequest) (*group.QueryGroupPoliciesByGroupResponse, error)
GroupPoliciesByGroup queries all groups policies of a given group.
func (Keeper) GroupPolicyInfo ¶
func (k Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error)
GroupPolicyInfo queries info about a group policy.
func (Keeper) Groups ¶
func (k Keeper) Groups(goCtx context.Context, request *group.QueryGroupsRequest) (*group.QueryGroupsResponse, error)
Groups returns all the groups present in the state.
func (Keeper) GroupsByAdmin ¶
func (k Keeper) GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsByAdminRequest) (*group.QueryGroupsByAdminResponse, error)
GroupsByAdmin queries all groups where a given address is admin.
func (Keeper) GroupsByMember ¶
func (k Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroupsByMemberRequest) (*group.QueryGroupsByMemberResponse, error)
GroupsByMember queries all groups where the given address is a member of.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx types.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis initializes the group module's genesis state.
func (Keeper) LeaveGroup ¶
func (k Keeper) LeaveGroup(goCtx context.Context, msg *group.MsgLeaveGroup) (*group.MsgLeaveGroupResponse, error)
LeaveGroup implements the MsgServer/LeaveGroup method.
func (Keeper) Proposal ¶
func (k Keeper) Proposal(goCtx context.Context, request *group.QueryProposalRequest) (*group.QueryProposalResponse, error)
Proposal queries a proposal.
func (Keeper) ProposalsByGroupPolicy ¶
func (k Keeper) ProposalsByGroupPolicy(goCtx context.Context, request *group.QueryProposalsByGroupPolicyRequest) (*group.QueryProposalsByGroupPolicyResponse, error)
ProposalsByGroupPolicy queries all proposals of a group policy.
func (Keeper) PruneProposals ¶
PruneProposals prunes all proposals that are expired, i.e. whose `voting_period + max_execution_period` is greater than the current block time.
func (Keeper) SubmitProposal ¶
func (k Keeper) SubmitProposal(goCtx context.Context, msg *group.MsgSubmitProposal) (*group.MsgSubmitProposalResponse, error)
func (Keeper) Tally ¶
Tally is a function that tallies a proposal by iterating through its votes, and returns the tally result without modifying the proposal or any state.
func (Keeper) TallyProposalsAtVPEnd ¶
TallyProposalsAtVPEnd iterates over all proposals whose voting period has ended, tallies their votes, prunes them, and updates the proposal's `FinalTallyResult` field.
func (Keeper) TallyResult ¶
func (k Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResultRequest) (*group.QueryTallyResultResponse, error)
TallyResult computes the live tally result of a proposal.
func (Keeper) UpdateGroupAdmin ¶
func (k Keeper) UpdateGroupAdmin(goCtx context.Context, msg *group.MsgUpdateGroupAdmin) (*group.MsgUpdateGroupAdminResponse, error)
func (Keeper) UpdateGroupMembers ¶
func (k Keeper) UpdateGroupMembers(goCtx context.Context, msg *group.MsgUpdateGroupMembers) (*group.MsgUpdateGroupMembersResponse, error)
func (Keeper) UpdateGroupMetadata ¶
func (k Keeper) UpdateGroupMetadata(goCtx context.Context, msg *group.MsgUpdateGroupMetadata) (*group.MsgUpdateGroupMetadataResponse, error)
func (Keeper) UpdateGroupPolicyAdmin ¶
func (k Keeper) UpdateGroupPolicyAdmin(goCtx context.Context, msg *group.MsgUpdateGroupPolicyAdmin) (*group.MsgUpdateGroupPolicyAdminResponse, error)
func (Keeper) UpdateGroupPolicyDecisionPolicy ¶
func (k Keeper) UpdateGroupPolicyDecisionPolicy(goCtx context.Context, msg *group.MsgUpdateGroupPolicyDecisionPolicy) (*group.MsgUpdateGroupPolicyDecisionPolicyResponse, error)
func (Keeper) UpdateGroupPolicyMetadata ¶
func (k Keeper) UpdateGroupPolicyMetadata(goCtx context.Context, msg *group.MsgUpdateGroupPolicyMetadata) (*group.MsgUpdateGroupPolicyMetadataResponse, error)
func (Keeper) VoteByProposalVoter ¶
func (k Keeper) VoteByProposalVoter(goCtx context.Context, request *group.QueryVoteByProposalVoterRequest) (*group.QueryVoteByProposalVoterResponse, error)
VoteByProposalVoter queries a vote given a voter and a proposal ID.
func (Keeper) VotesByProposal ¶
func (k Keeper) VotesByProposal(goCtx context.Context, request *group.QueryVotesByProposalRequest) (*group.QueryVotesByProposalResponse, error)
VotesByProposal queries all votes on a proposal.
func (Keeper) VotesByVoter ¶
func (k Keeper) VotesByVoter(goCtx context.Context, request *group.QueryVotesByVoterRequest) (*group.QueryVotesByVoterResponse, error)
VotesByVoter queries all votes of a voter.
func (Keeper) WithdrawProposal ¶
func (k Keeper) WithdrawProposal(goCtx context.Context, msg *group.MsgWithdrawProposal) (*group.MsgWithdrawProposalResponse, error)