keeper

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

func NewMsgServerImpl added in v0.15.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the stored MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCodec *codec.LegacyAmino) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all reports invariants

func ValidReportsIDs

func ValidReportsIDs(k Keeper) sdk.Invariant

ValidReportsIDs checks that all reports are associated with a valid post id that corresponds to an existent post

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(cdc codec.BinaryMarshaler, storeKey sdk.StoreKey, pk postskeeper.Keeper) Keeper

NewKeeper creates new instances of the reports Keeper

func (Keeper) CheckPostExistence

func (k Keeper) CheckPostExistence(ctx sdk.Context, postID string) bool

CheckPostExistence checks if a post with the given postID is present inside the current context and returns a boolean indicating that.

func (Keeper) ExportGenesis added in v0.15.0

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

ExportGenesis returns the GenesisState associated with the given context

func (Keeper) GetAllReports added in v0.15.0

func (k Keeper) GetAllReports(ctx sdk.Context) []types.Report

GetAllReports returns the list of all the reports that have been stored inside the given context

func (Keeper) GetPostReports

func (k Keeper) GetPostReports(ctx sdk.Context, postID string) []types.Report

GetPostReports returns the list of reports associated with the given postID. If no report is associated with the given postID the function will returns an empty list.

func (Keeper) InitGenesis added in v0.15.0

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

InitGenesis initializes the chain state based on the given GenesisState

func (Keeper) PostReports added in v0.15.0

PostReports implements the Query/PostReports gRPC method

func (Keeper) SaveReport

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

SaveReport allows to save the given report inside the current context. It assumes that the given report has already been validated. If the same report has already been inserted, nothing will be changed.

Jump to

Keyboard shortcuts

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