keeper

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 23 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
	ProposalByProposerIndexPrefix    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

func TallyVotesInvariant

func TallyVotesInvariant(keeper Keeper) sdk.Invariant

TallyVotesInvariant checks that vote tally sums must never have less than the block before.

func TallyVotesInvariantHelper

func TallyVotesInvariantHelper(ctx sdk.Context, prevCtx sdk.Context, key storetypes.StoreKey, proposalTable orm.AutoUInt64Table) (string, bool)

func TallyVotesSumInvariant

func TallyVotesSumInvariant(keeper Keeper) sdk.Invariant

TallyVotesSumInvariant checks that proposal VoteState must correspond to the vote choice.

func TallyVotesSumInvariantHelper

func TallyVotesSumInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, groupTable orm.AutoUInt64Table, proposalTable orm.AutoUInt64Table, groupMemberTable orm.PrimaryKeyTable, voteByProposalIndex orm.Index, groupPolicyTable orm.PrimaryKeyTable) (string, bool)

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

func (Keeper) CreateGroup

func (Keeper) CreateGroupPolicy

func (Keeper) CreateProposal

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

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

Logger returns a module-specific logger.

func (Keeper) Proposal

func (Keeper) UpdateGroupAdmin

func (Keeper) UpdateGroupMembers

func (Keeper) Vote

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

func (Keeper) VotesByVoter

Jump to

Keyboard shortcuts

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