Skip to content

Commit

Permalink
chore: fix x/reactions events
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Montagnin <[email protected]>
  • Loading branch information
RiccardoM committed Jun 27, 2022
1 parent 8adb7c9 commit 09e7e49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions x/reactions/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (k msgServer) AddReaction(goCtx context.Context, msg *types.MsgAddReaction)
sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)),
sdk.NewAttribute(types.AttributeKeyPostID, fmt.Sprintf("%d", msg.PostID)),
sdk.NewAttribute(types.AttributeKeyReactionID, fmt.Sprintf("%d", reaction.ID)),
sdk.NewAttribute(types.AttributeKeyUser, msg.User),
),
})

Expand Down Expand Up @@ -293,7 +294,7 @@ func (k msgServer) RemoveRegisteredReaction(goCtx context.Context, msg *types.Ms
sdk.NewAttribute(sdk.AttributeKeySender, msg.User),
),
sdk.NewEvent(
types.ActionRemoveRegisteredReaction,
types.EventTypeRemoveRegisteredReaction,
sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)),
sdk.NewAttribute(types.AttributeKeyRegisteredReactionID, fmt.Sprintf("%d", msg.RegisteredReactionID)),
),
Expand Down Expand Up @@ -334,7 +335,7 @@ func (k msgServer) SetReactionsParams(goCtx context.Context, msg *types.MsgSetRe
sdk.NewAttribute(sdk.AttributeKeySender, msg.User),
),
sdk.NewEvent(
types.ActionSetReactionParams,
types.EventTypeSetReactionsParams,
sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)),
),
})
Expand Down
6 changes: 4 additions & 2 deletions x/reactions/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() {
sdk.NewAttribute(types.AttributeKeySubspaceID, "1"),
sdk.NewAttribute(types.AttributeKeyPostID, "1"),
sdk.NewAttribute(types.AttributeKeyReactionID, "1"),
sdk.NewAttribute(types.AttributeKeyUser, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"),
),
},
check: func(ctx sdk.Context) {
Expand Down Expand Up @@ -457,6 +458,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() {
sdk.NewAttribute(types.AttributeKeySubspaceID, "1"),
sdk.NewAttribute(types.AttributeKeyPostID, "1"),
sdk.NewAttribute(types.AttributeKeyReactionID, "1"),
sdk.NewAttribute(types.AttributeKeyUser, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"),
),
},
check: func(ctx sdk.Context) {
Expand Down Expand Up @@ -1252,7 +1254,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveRegisteredReaction() {
sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"),
),
sdk.NewEvent(
types.ActionRemoveRegisteredReaction,
types.EventTypeRemoveRegisteredReaction,
sdk.NewAttribute(types.AttributeKeySubspaceID, "1"),
sdk.NewAttribute(types.AttributeKeyRegisteredReactionID, "1"),
),
Expand Down Expand Up @@ -1390,7 +1392,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SetReactionsParams() {
sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"),
),
sdk.NewEvent(
types.ActionSetReactionParams,
types.EventTypeSetReactionsParams,
sdk.NewAttribute(types.AttributeKeySubspaceID, "1"),
),
},
Expand Down

0 comments on commit 09e7e49

Please sign in to comment.