-
Notifications
You must be signed in to change notification settings - Fork 44
/
hooks.go
61 lines (50 loc) · 1.91 KB
/
hooks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package keeper
// DONTCOVER
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/desmos-labs/desmos/v6/x/posts/types"
)
// Implement PostsHooks interface
var _ types.PostsHooks = Keeper{}
// AfterPostSaved implements types.PostsHooks
func (k Keeper) AfterPostSaved(ctx sdk.Context, subspaceID uint64, postID uint64) {
if k.hooks != nil {
k.hooks.AfterPostSaved(ctx, subspaceID, postID)
}
}
// AfterPostDeleted implements types.PostsHooks
func (k Keeper) AfterPostDeleted(ctx sdk.Context, subspaceID uint64, postID uint64) {
if k.hooks != nil {
k.hooks.AfterPostDeleted(ctx, subspaceID, postID)
}
}
// AfterAttachmentSaved implements types.PostsHooks
func (k Keeper) AfterAttachmentSaved(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) {
if k.hooks != nil {
k.hooks.AfterAttachmentSaved(ctx, subspaceID, postID, attachmentID)
}
}
// AfterAttachmentDeleted implements types.PostsHooks
func (k Keeper) AfterAttachmentDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, attachmentID uint32) {
if k.hooks != nil {
k.hooks.AfterAttachmentDeleted(ctx, subspaceID, postID, attachmentID)
}
}
// AfterPollAnswerSaved implements types.PostsHooks
func (k Keeper) AfterPollAnswerSaved(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) {
if k.hooks != nil {
k.hooks.AfterPollAnswerSaved(ctx, subspaceID, postID, pollID, user)
}
}
// AfterPollAnswerDeleted implements types.PostsHooks
func (k Keeper) AfterPollAnswerDeleted(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32, user string) {
if k.hooks != nil {
k.hooks.AfterPollAnswerDeleted(ctx, subspaceID, postID, pollID, user)
}
}
// AfterPollVotingPeriodEnded implements types.PostsHooks
func (k Keeper) AfterPollVotingPeriodEnded(ctx sdk.Context, subspaceID uint64, postID uint64, pollID uint32) {
if k.hooks != nil {
k.hooks.AfterPollVotingPeriodEnded(ctx, subspaceID, postID, pollID)
}
}