Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) 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 posts.PostID) bool
- func (k Keeper) GetPostReports(ctx sdk.Context, postID posts.PostID) (reports types.Reports)
- func (k Keeper) GetReportsMap(ctx sdk.Context) map[string]types.Reports
- func (k Keeper) SaveReport(ctx sdk.Context, postID posts.PostID, report types.Report)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func NewHandler ¶
NewHandler returns a handler for "magpie" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all posts invariants
func ValidReportsIDs ¶
ValidReportsIDs checks that all reports are associated with a valid postID that correspond to an existent post
Types ¶
type Keeper ¶
type Keeper struct { PostKeeper postsK.Keeper // Post's keeper to perform checks on the postIDs StoreKey sdk.StoreKey // Unexposed key to access store from sdk.Context Cdc *codec.Codec // The wire codec for binary encoding/decoding. }
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
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) GetPostReports ¶
GetPostReports returns the list of reports associated with the given postID. If no reports is associated with the given postID the function will returns an empty list.
func (Keeper) GetReportsMap ¶
GetReportsMap allows to returns the list of reports that have been stored inside the given context
func (Keeper) SaveReport ¶
SaveReport allows to save the given reports inside the current context. It assumes that the given reports has already been validated. If the same reports has already been inserted, nothing will be changed.