Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCodec *codec.LegacyAmino) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidReportsIDs(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) CheckPostExistence(ctx sdk.Context, postID string) bool
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllReports(ctx sdk.Context) []types.Report
- func (k Keeper) GetPostReports(ctx sdk.Context, postID string) []types.Report
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) PostReports(ctx context.Context, request *types.QueryPostReportsRequest) (*types.QueryPostReportsResponse, error)
- func (k Keeper) SaveReport(ctx sdk.Context, report types.Report) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func NewMsgServerImpl ¶ added in v0.15.0
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 ¶
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 ¶
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
GetAllReports returns the list of all the reports that have been stored inside the given context
func (Keeper) GetPostReports ¶
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
func (k Keeper) PostReports( ctx context.Context, request *types.QueryPostReportsRequest, ) (*types.QueryPostReportsResponse, error)
PostReports implements the Query/PostReports gRPC method
func (Keeper) SaveReport ¶
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.