keeper

package
v0.0.0-...-0943177 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the stored MsgServer interface for the provided keeper

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all reactions invariants

func ValidReactionsInvariant

func ValidReactionsInvariant(k Keeper) sdk.Invariant

ValidReactionsInvariant checks that all the stored reactions are valid

func ValidReactionsParamsInvariant

func ValidReactionsParamsInvariant(k Keeper) sdk.Invariant

ValidReactionsParamsInvariant checks that all the stored reactions params are valid

func ValidRegisteredReactionsInvariant

func ValidRegisteredReactionsInvariant(k Keeper) sdk.Invariant

ValidRegisteredReactionsInvariant checks that all the stored registered reactions are valid

func ValidSubspacesInvariant

func ValidSubspacesInvariant(k Keeper) sdk.Invariant

ValidSubspacesInvariant checks that all the subspaces have a valid registered reaction id and reaction params

Types

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

func (Hooks) AfterAttachmentDeleted

func (h Hooks) AfterAttachmentDeleted(sdk.Context, uint64, uint64, uint32)

AfterAttachmentDeleted implements poststypes.PostsHooks

func (Hooks) AfterAttachmentSaved

func (h Hooks) AfterAttachmentSaved(sdk.Context, uint64, uint64, uint32)

AfterAttachmentSaved implements poststypes.PostsHooks

func (Hooks) AfterPollAnswerDeleted

func (h Hooks) AfterPollAnswerDeleted(sdk.Context, uint64, uint64, uint32, string)

AfterPollAnswerDeleted implements poststypes.PostsHooks

func (Hooks) AfterPollAnswerSaved

func (h Hooks) AfterPollAnswerSaved(sdk.Context, uint64, uint64, uint32, string)

AfterPollAnswerSaved implements poststypes.PostsHooks

func (Hooks) AfterPollVotingPeriodEnded

func (h Hooks) AfterPollVotingPeriodEnded(sdk.Context, uint64, uint64, uint32)

AfterPollVotingPeriodEnded implements poststypes.PostsHooks

func (Hooks) AfterPostDeleted

func (h Hooks) AfterPostDeleted(ctx sdk.Context, subspaceID uint64, postID uint64)

AfterPostDeleted implements poststypes.PostsHooks

func (Hooks) AfterPostSaved

func (h Hooks) AfterPostSaved(ctx sdk.Context, subspaceID uint64, postID uint64)

AfterPostSaved implements poststypes.PostsHooks

func (Hooks) AfterSubspaceDeleted

func (h Hooks) AfterSubspaceDeleted(ctx sdk.Context, subspaceID uint64)

AfterSubspaceDeleted implements subspacestypes.Hooks

func (Hooks) AfterSubspaceGroupDeleted

func (h Hooks) AfterSubspaceGroupDeleted(sdk.Context, uint64, uint32)

AfterSubspaceGroupDeleted implements subspacestypes.Hooks

func (Hooks) AfterSubspaceGroupMemberAdded

func (h Hooks) AfterSubspaceGroupMemberAdded(sdk.Context, uint64, uint32, string)

AfterSubspaceGroupMemberAdded implements subspacestypes.Hooks

func (Hooks) AfterSubspaceGroupMemberRemoved

func (h Hooks) AfterSubspaceGroupMemberRemoved(sdk.Context, uint64, uint32, string)

AfterSubspaceGroupMemberRemoved implements subspacestypes.Hooks

func (Hooks) AfterSubspaceGroupSaved

func (h Hooks) AfterSubspaceGroupSaved(sdk.Context, uint64, uint32)

AfterSubspaceGroupSaved implements subspacestypes.Hooks

func (Hooks) AfterSubspaceSaved

func (h Hooks) AfterSubspaceSaved(ctx sdk.Context, subspaceID uint64)

AfterSubspaceSaved implements subspacestypes.Hooks

func (Hooks) AfterSubspaceSectionDeleted

func (h Hooks) AfterSubspaceSectionDeleted(sdk.Context, uint64, uint32)

AfterSubspaceSectionDeleted implements subspacestypes.Hooks

func (Hooks) AfterSubspaceSectionSaved

func (h Hooks) AfterSubspaceSectionSaved(sdk.Context, uint64, uint32)

AfterSubspaceSectionSaved implements subspacestypes.Hooks

func (Hooks) AfterUserPermissionRemoved

func (h Hooks) AfterUserPermissionRemoved(sdk.Context, uint64, uint32, string)

AfterUserPermissionRemoved implements subspacestypes.Hooks

func (Hooks) AfterUserPermissionSet

func (h Hooks) AfterUserPermissionSet(sdk.Context, uint64, uint32, string, subspacestypes.Permissions)

AfterUserPermissionSet implements subspacestypes.Hooks

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

NewKeeper creates a new instance of the reactions Keeper.

func (Keeper) AfterReactionDeleted

func (k Keeper) AfterReactionDeleted(ctx sdk.Context, subspaceID uint64, reactionID uint32)

AfterReactionDeleted implements types.ReactionsHooks

func (Keeper) AfterReactionParamsSaved

func (k Keeper) AfterReactionParamsSaved(ctx sdk.Context, subspaceID uint64)

AfterReactionParamsSaved implements types.ReactionsHooks

func (Keeper) AfterReactionSaved

func (k Keeper) AfterReactionSaved(ctx sdk.Context, subspaceID uint64, reactionID uint32)

AfterReactionSaved implements types.ReactionsHooks

func (Keeper) AfterRegisteredReactionDeleted

func (k Keeper) AfterRegisteredReactionDeleted(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32)

AfterRegisteredReactionDeleted implements types.ReactionsHooks

func (Keeper) AfterRegisteredReactionSaved

func (k Keeper) AfterRegisteredReactionSaved(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32)

AfterRegisteredReactionSaved implements types.ReactionsHooks

func (Keeper) DeleteNextReactionID

func (k Keeper) DeleteNextReactionID(ctx sdk.Context, subspaceID uint64, postID uint64)

DeleteNextReactionID removes the next reaction id for the given subspace

func (Keeper) DeleteNextRegisteredReactionID

func (k Keeper) DeleteNextRegisteredReactionID(ctx sdk.Context, subspaceID uint64)

DeleteNextRegisteredReactionID removes the next registered reaction id for the given subspace

func (Keeper) DeleteReaction

func (k Keeper) DeleteReaction(ctx sdk.Context, subspaceID uint64, postID uint64, reactionID uint32)

DeleteReaction deletes the reaction having the given id from the store

func (Keeper) DeleteRegisteredReaction

func (k Keeper) DeleteRegisteredReaction(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32)

DeleteRegisteredReaction deletes the registered reaction having the given id from the store

func (Keeper) DeleteSubspaceReactionsParams

func (k Keeper) DeleteSubspaceReactionsParams(ctx sdk.Context, subspaceID uint64)

DeleteSubspaceReactionsParams deletes the reactions params for the given subspace

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the GenesisState associated with the given context

func (Keeper) GetNextReactionID

func (k Keeper) GetNextReactionID(ctx sdk.Context, subspaceID uint64, postID uint64) (reactionID uint32, err error)

GetNextReactionID gets the next reaction id for the given subspace

func (Keeper) GetNextRegisteredReactionID

func (k Keeper) GetNextRegisteredReactionID(ctx sdk.Context, subspaceID uint64) (registeredReactionID uint32, err error)

GetNextRegisteredReactionID gets the next registered reaction id for the given subspace

func (Keeper) GetPost

func (k Keeper) GetPost(ctx sdk.Context, subspaceID uint64, postID uint64) (poststypes.Post, bool)

GetPost returns the post associated with the given id

func (Keeper) GetReaction

func (k Keeper) GetReaction(ctx sdk.Context, subspaceID uint64, postID uint64, reactionID uint32) (reaction types.Reaction, found bool)

GetReaction returns the reaction associated with the given id. If there is no reaction with the given id the function will return an empty reaction and false.

func (Keeper) GetReactions

func (k Keeper) GetReactions(ctx sdk.Context) []types.Reaction

GetReactions returns all the stored reactions

func (Keeper) GetReactionsParams

func (k Keeper) GetReactionsParams(ctx sdk.Context) []types.SubspaceReactionsParams

GetReactionsParams returns all the stored reactions parameters

func (Keeper) GetRegisteredReaction

func (k Keeper) GetRegisteredReaction(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32) (registeredReaction types.RegisteredReaction, found bool)

GetRegisteredReaction returns the registered reaction associated with the given id. If there is no registered reaction with the given id the function will return an empty registered reaction and false.

func (Keeper) GetRegisteredReactions

func (k Keeper) GetRegisteredReactions(ctx sdk.Context) []types.RegisteredReaction

GetRegisteredReactions returns all the stored registered reactions

func (Keeper) GetSubspaceReactions

func (k Keeper) GetSubspaceReactions(ctx sdk.Context, subspaceID uint64) []types.Reaction

GetSubspaceReactions returns all the reactions associated to this subspace

func (Keeper) GetSubspaceReactionsParams

func (k Keeper) GetSubspaceReactionsParams(ctx sdk.Context, subspaceID uint64) (params types.SubspaceReactionsParams, err error)

GetSubspaceReactionsParams returns the reactions params for the given subspace

func (Keeper) GetSubspaceRegisteredReactions

func (k Keeper) GetSubspaceRegisteredReactions(ctx sdk.Context, subspaceID uint64) []types.RegisteredReaction

GetSubspaceRegisteredReactions returns all the subspaces registered reactions

func (Keeper) HasNextReactionID

func (k Keeper) HasNextReactionID(ctx sdk.Context, subspaceID uint64, postID uint64) bool

HasNextReactionID tells whether the next reaction id exists for the given subspace

func (Keeper) HasNextRegisteredReactionID

func (k Keeper) HasNextRegisteredReactionID(ctx sdk.Context, subspaceID uint64) bool

HasNextRegisteredReactionID tells whether the next registered reaction id exists for the given subspace

func (Keeper) HasPermission

func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, sectionID uint32, user string, permission subspacestypes.Permission) bool

HasPermission tells whether the given user has the provided permission inside the subspace with the specified id

func (Keeper) HasPost

func (k Keeper) HasPost(ctx sdk.Context, subspaceID uint64, postID uint64) bool

HasPost tells whether the given post exists or not

func (Keeper) HasProfile

func (k Keeper) HasProfile(ctx sdk.Context, user string) bool

HasProfile returns true iff the given user has a profile, or an error if something is wrong.

func (Keeper) HasReacted

func (k Keeper) HasReacted(ctx sdk.Context, subspaceID uint64, postID uint64, user string, value types.ReactionValue) bool

HasReacted tells whether the given user has already reacted with the same reaction value to the provided post

func (Keeper) HasReaction

func (k Keeper) HasReaction(ctx sdk.Context, subspaceID uint64, postID uint64, reactionID uint32) bool

HasReaction tells whether the given reaction exists or not

func (Keeper) HasRegisteredReaction

func (k Keeper) HasRegisteredReaction(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32) bool

HasRegisteredReaction tells whether the given registered reaction exists or not

func (Keeper) HasSubspace

func (k Keeper) HasSubspace(ctx sdk.Context, subspaceID uint64) bool

HasSubspace tells whether the subspace with the given id exists or not

func (Keeper) HasSubspaceReactionsParams

func (k Keeper) HasSubspaceReactionsParams(ctx sdk.Context, subspaceID uint64) bool

HasSubspaceReactionsParams tells whether the params for the given subspace exist or not

func (Keeper) HasUserBlocked

func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, user string, subspaceID uint64) bool

HasUserBlocked tells whether the given blocker has blocked the user inside the provided subspace

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks creates a new reports hooks

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)

InitGenesis initializes the chain state based on the given GenesisState

func (Keeper) IteratePostReactions

func (k Keeper) IteratePostReactions(ctx sdk.Context, subspaceID uint64, postID uint64, fn func(reaction types.Reaction) (stop bool))

IteratePostReactions iterates over all the given post reactions and performs the provided function

func (Keeper) IterateReactions

func (k Keeper) IterateReactions(ctx sdk.Context, fn func(reaction types.Reaction) (stop bool))

IterateReactions iterates over all the reactions and performs the provided function

func (Keeper) IterateReactionsParams

func (k Keeper) IterateReactionsParams(ctx sdk.Context, fn func(params types.SubspaceReactionsParams) (stop bool))

IterateReactionsParams iterates over all the stored subspace reactions params and performs the provided function

func (Keeper) IterateRegisteredReactions

func (k Keeper) IterateRegisteredReactions(ctx sdk.Context, fn func(reaction types.RegisteredReaction) (stop bool))

IterateRegisteredReactions iterates over all the registered reactions and performs the provided function

func (Keeper) IterateSubspaceReactions

func (k Keeper) IterateSubspaceReactions(ctx sdk.Context, subspaceID uint64, fn func(reaction types.Reaction) (stop bool))

IterateSubspaceReactions iterates over all the given subspace reactions and performs the provided function

func (Keeper) IterateSubspaceRegisteredReactions

func (k Keeper) IterateSubspaceRegisteredReactions(ctx sdk.Context, subspaceID uint64, fn func(reaction types.RegisteredReaction) (stop bool))

IterateSubspaceRegisteredReactions iterates over all the given subspace registered reactions and performs the provided function

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Reaction

Reaction implements the QueryReaction gRPC method

func (Keeper) Reactions

Reactions implements the QueryReactions gRPC method

func (Keeper) ReactionsParams

ReactionsParams implements the QueryReactionsParams gRPC method

func (Keeper) RegisteredReaction

RegisteredReaction implements the QueryRegisteredReaction gRPC method

func (Keeper) RegisteredReactions

RegisteredReactions implements the QueryRegisteredReactions gRPC method

func (Keeper) SaveReaction

func (k Keeper) SaveReaction(ctx sdk.Context, reaction types.Reaction)

SaveReaction saves the given reaction inside the current context

func (Keeper) SaveRegisteredReaction

func (k Keeper) SaveRegisteredReaction(ctx sdk.Context, reaction types.RegisteredReaction)

SaveRegisteredReaction saves the given registered reaction inside the current context

func (Keeper) SaveSubspaceReactionsParams

func (k Keeper) SaveSubspaceReactionsParams(ctx sdk.Context, params types.SubspaceReactionsParams)

SaveSubspaceReactionsParams stores the given reactions params inside the store

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(rs types.ReactionsHooks) *Keeper

SetHooks allows to set the reactions hooks

func (Keeper) SetNextReactionID

func (k Keeper) SetNextReactionID(ctx sdk.Context, subspaceID uint64, postID uint64, reactionID uint32)

SetNextReactionID sets the next reaction id for the given subspace

func (Keeper) SetNextRegisteredReactionID

func (k Keeper) SetNextRegisteredReactionID(ctx sdk.Context, subspaceID uint64, registeredReactionID uint32)

SetNextRegisteredReactionID sets the next registered reaction id for the given subspace

func (Keeper) ValidateReaction

func (k Keeper) ValidateReaction(ctx sdk.Context, reaction types.Reaction) (err error)

ValidateReaction validates the given reaction's value

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper, sk types.SubspacesKeeper, pk types.PostsKeeper) Migrator

NewMigrator returns a new Migrator

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

Jump to

Keyboard shortcuts

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