keeper

package
v6.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 21 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 posts invariants

func ValidReasonsInvariant

func ValidReasonsInvariant(k Keeper) sdk.Invariant

ValidReasonsInvariant checks that all the reasons are valid

func ValidReportsInvariant

func ValidReportsInvariant(k Keeper) sdk.Invariant

ValidReportsInvariant checks that all the reports are valid

func ValidSubspacesInvariant

func ValidSubspacesInvariant(k Keeper) sdk.Invariant

ValidSubspacesInvariant checks that all the subspaces have a valid reason id and report id to them

Types

type Hooks

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

Hooks represents a wrapper struct

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(sdk.Context, uint64, 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 Posts Keeper.

func (Keeper) AfterReasonDeleted

func (k Keeper) AfterReasonDeleted(ctx sdk.Context, subspaceID uint64, reasonID uint32)

AfterReasonDeleted implements types.ReportsHooks

func (Keeper) AfterReasonSaved

func (k Keeper) AfterReasonSaved(ctx sdk.Context, subspaceID uint64, reasonID uint32)

AfterReasonSaved implements types.ReportsHooks

func (Keeper) AfterReportDeleted

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

AfterReportDeleted implements types.ReportsHooks

func (Keeper) AfterReportSaved

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

AfterReportSaved implements types.ReportsHooks

func (Keeper) DeleteNextReasonID

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

DeleteNextReasonID removes the reason id key for the given subspace

func (Keeper) DeleteNextReportID

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

DeleteNextReportID removes the report id key for the given subspace

func (Keeper) DeleteReason

func (k Keeper) DeleteReason(ctx sdk.Context, subspaceID uint64, reasonID uint32)

DeleteReason deletes the reason having the given id from the store

func (Keeper) DeleteReport

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

DeleteReport deletes the report having the given id from the store

func (Keeper) ExportGenesis

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

ExportGenesis returns the GenesisState associated with the given context

func (Keeper) GetNextReasonID

func (k Keeper) GetNextReasonID(ctx sdk.Context, subspaceID uint64) (reasonID uint32, err error)

GetNextReasonID gets the highest reason id for the given subspace

func (Keeper) GetNextReportID

func (k Keeper) GetNextReportID(ctx sdk.Context, subspaceID uint64) (reportID uint64, err error)

GetNextReportID gets the highest report id for the given subspace

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)

GetParams returns the params from the store

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

func (k Keeper) GetReason(ctx sdk.Context, subspaceID uint64, reasonID uint32) (reason types.Reason, found bool)

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

func (Keeper) GetReport

func (k Keeper) GetReport(ctx sdk.Context, subspaceID uint64, reportID uint64) (report types.Report, found bool)

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

func (Keeper) GetStandardReason

func (k Keeper) GetStandardReason(ctx sdk.Context, id uint32) (reason types.StandardReason, found bool)

GetStandardReason returns the standard reason with the given id. If no standard reason with the given id could be found, the method will return an empty standard reason and false

func (Keeper) GetSubspaceReasons

func (k Keeper) GetSubspaceReasons(ctx sdk.Context, subspaceID uint64) []types.Reason

GetSubspaceReasons returns the reporting reasons for the given subspace

func (Keeper) GetSubspaceReports

func (k Keeper) GetSubspaceReports(ctx sdk.Context, subspaceID uint64) []types.Report

GetSubspaceReports returns all the reports for the given subspace

func (Keeper) HasNextReasonID

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

HasNextReasonID tells whether the next reason id exists for the given subspace

func (Keeper) HasNextReportID

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

HasNextReportID tells whether a next report id exists for the given subspace

func (Keeper) HasPermission

func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, 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) HasReason

func (k Keeper) HasReason(ctx sdk.Context, subspaceID uint64, reasonID uint32) bool

HasReason tells whether the given reason exists or not

func (Keeper) HasReport

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

HasReport tells whether the given report exists or not

func (Keeper) HasReported

func (k Keeper) HasReported(ctx sdk.Context, subspaceID uint64, reporter string, target types.ReportTarget) bool

HasReported tells whether the given reporter has reported the specified target 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) 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) IteratePostReports

func (k Keeper) IteratePostReports(ctx sdk.Context, subspaceID uint64, postID uint64, fn func(report types.Report) (stop bool))

IteratePostReports iterates over all the reports for the given post and performs the provided function

func (Keeper) IterateReasons

func (k Keeper) IterateReasons(ctx sdk.Context, fn func(reason types.Reason) (stop bool))

IterateReasons iterates over all the stored reasons and performs the provided function

func (Keeper) IterateReports

func (k Keeper) IterateReports(ctx sdk.Context, fn func(report types.Report) (stop bool))

IterateReports iterates over all reports and performs the provided function

func (Keeper) IterateSubspaceReasons

func (k Keeper) IterateSubspaceReasons(ctx sdk.Context, subspaceID uint64, fn func(reason types.Reason) (stop bool))

IterateSubspaceReasons iterates over all the given subspace reasons and performs the provided function

func (Keeper) IterateSubspaceReports

func (k Keeper) IterateSubspaceReports(ctx sdk.Context, subspaceID uint64, fn func(report types.Report) (stop bool))

IterateSubspaceReports iterates over all the given subspace reports 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) Params

Params implements the QueryParams gRPC method

func (Keeper) Reason

Reason implements the QueryReason gRPC method

func (Keeper) Reasons

Reasons implements the QueryReasons gRPC method

func (Keeper) Report

Report implements the QueryReport gRPC method

func (Keeper) Reports

Reports implements the QueryReports gRPC method

func (Keeper) SaveReason

func (k Keeper) SaveReason(ctx sdk.Context, reason types.Reason)

SaveReason saves the given reason inside the current context

func (Keeper) SaveReport

func (k Keeper) SaveReport(ctx sdk.Context, report types.Report)

SaveReport saves the given report inside the current context

func (*Keeper) SetHooks

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

SetHooks allows to set the reports hooks

func (Keeper) SetNextReasonID

func (k Keeper) SetNextReasonID(ctx sdk.Context, subspaceID uint64, reasonID uint32)

SetNextReasonID sets the new reason id for the given subspace to the store

func (Keeper) SetNextReportID

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

SetNextReportID sets the new report id for the given subspace to the store

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the params on the store

func (Keeper) ValidateReport

func (k Keeper) ValidateReport(ctx sdk.Context, report types.Report) (err error)

ValidateReport validates the given report's content

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, legacySubspace types.ParamsSubspace) Migrator

NewMigrator returns a new Migrator

func (Migrator) Migrate1to2

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

Migrate1to2 migrates from version 1 to 2.

func (Migrator) Migrate2to3

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

Migrate2to3 migrates from version 2 to 3.

Jump to

Keyboard shortcuts

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