keeper

package
v0.0.0-...-a315113 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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

func GroupTotalWeightInvariant(keeper Keeper) sdk.Invariant

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 *authmiddleware.MsgServiceRouter, accKeeper group.AccountKeeper, config group.Config) Keeper

func (Keeper) CreateGroup

func (Keeper) CreateGroupPolicy

func (Keeper) Exec

func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecResponse, error)

Exec executes the messages from a proposal.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx types.Context, cdc codec.JSONCodec) *group.GenesisState

func (Keeper) GetGroupSequence

func (k Keeper) GetGroupSequence(ctx sdk.Context) uint64

GetGroupSequence returns the current value of the group table sequence

func (Keeper) GroupInfo

func (Keeper) GroupMembers

func (Keeper) GroupsByAdmin

func (Keeper) GroupsByMember

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx types.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate

func (Keeper) LeaveGroup

func (k Keeper) LeaveGroup(goCtx context.Context, req *group.MsgLeaveGroup) (*group.MsgLeaveGroupResponse, error)

LeaveGroup implements the MsgServer/LeaveGroup method.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) Proposal

func (Keeper) PruneProposals

func (k Keeper) PruneProposals(ctx sdk.Context) error

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 (Keeper) Tally

func (q Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group.TallyResult, error)

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) TallyResult

func (Keeper) UpdateGroupAdmin

func (Keeper) UpdateGroupMembers

func (Keeper) UpdateTallyOfVPEndProposals

func (k Keeper) UpdateTallyOfVPEndProposals(ctx sdk.Context) error

func (Keeper) Vote

func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteResponse, error)

func (Keeper) VotesByVoter

func (Keeper) WithdrawProposal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL