From 40818309b66157604ef43d8bdc481c400ac2eaee Mon Sep 17 00:00:00 2001 From: Paul Chen Date: Mon, 8 Jan 2024 21:16:55 +0800 Subject: [PATCH] fix: remove duplicated message type events (#1284) ## Description Currently, the `sdk.MessageEventType` is emitted twice in Desmos, it is because that cosmos-sdk already handles the default message type event. As we can see, [the example transaction](https://testnet.bigdipper.live/desmos/transactions/F2340B9AFB6FF097085820B9F784251777FE43A700F0185E9542EF1AED914679) has two message type event: ```json [ { "events": [ { "type": "message", "attributes": [ { "key": "action", "value": "/desmos.posts.v3.MsgCreatePost" }, { "key": "sender", "value": "desmos1q35n50xnlj7lapfkzzcq5rvypcvhure0rr945u" } ] }, { "type": "message", "attributes": [ { "key": "module", "value": "posts" }, { "key": "action", "value": "/desmos.posts.v3.MsgCreatePost" }, { "key": "sender", "value": "desmos1q35n50xnlj7lapfkzzcq5rvypcvhure0rr945u" } ] }, ...skip ] ``` To fix it, we can safely remove the `sdk.MessageEventType` event inside Desmos modules. References: https://docs.cosmos.network/v0.47/learn/advanced/events#default-events https://github.com/cosmos/cosmos-sdk/blob/v0.47.5/baseapp/baseapp.go#L848 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- ...cde7983870148f84626f49c69e2b52dc5abed.yaml | 6 + x/posts/keeper/msg_server.go | 75 --------- x/posts/keeper/msg_server_test.go | 99 +----------- x/posts/types/events.go | 1 - x/profiles/keeper/msg_server_app_link.go | 15 -- x/profiles/keeper/msg_server_app_link_test.go | 18 --- x/profiles/keeper/msg_server_chain_link.go | 18 --- .../keeper/msg_server_chain_link_test.go | 18 --- .../keeper/msg_server_dtag_transfers.go | 24 --- .../keeper/msg_server_dtag_transfers_test.go | 36 ----- x/profiles/keeper/msg_server_params.go | 9 -- x/profiles/keeper/msg_server_params_test.go | 9 +- x/profiles/keeper/msgs_server_profile.go | 12 -- x/profiles/keeper/msgs_server_profile_test.go | 30 ---- x/profiles/types/events.go | 2 - x/reactions/keeper/msg_server.go | 36 ----- x/reactions/keeper/msg_server_test.go | 42 ----- x/reactions/types/events.go | 1 - x/relationships/keeper/msg_server.go | 24 --- x/relationships/keeper/msg_server_test.go | 24 --- x/relationships/types/events.go | 1 - x/reports/keeper/msg_server.go | 39 ----- x/reports/keeper/msg_server_test.go | 51 +----- x/reports/types/events.go | 1 - x/subspaces/keeper/msg_server.go | 126 +-------------- x/subspaces/keeper/msg_server_test.go | 150 ------------------ x/subspaces/types/events.go | 1 - x/tokenfactory/keeper/msg_server.go | 33 ---- x/tokenfactory/keeper/msg_server_test.go | 33 +--- x/tokenfactory/types/events.go | 1 - 30 files changed, 12 insertions(+), 923 deletions(-) create mode 100644 .changeset/entries/d3f03fad99e3c68e9114b638351cde7983870148f84626f49c69e2b52dc5abed.yaml diff --git a/.changeset/entries/d3f03fad99e3c68e9114b638351cde7983870148f84626f49c69e2b52dc5abed.yaml b/.changeset/entries/d3f03fad99e3c68e9114b638351cde7983870148f84626f49c69e2b52dc5abed.yaml new file mode 100644 index 0000000000..51cd31e9c4 --- /dev/null +++ b/.changeset/entries/d3f03fad99e3c68e9114b638351cde7983870148f84626f49c69e2b52dc5abed.yaml @@ -0,0 +1,6 @@ +type: fix +module: none +pull_request: 5299 +description: 'fix: remove duplicated message type events' +backward_compatible: true +date: 2023-12-28T10:10:27.551132142Z diff --git a/x/posts/keeper/msg_server.go b/x/posts/keeper/msg_server.go index 92e7c4b9e5..c0f0474c12 100644 --- a/x/posts/keeper/msg_server.go +++ b/x/posts/keeper/msg_server.go @@ -102,12 +102,6 @@ func (k msgServer) CreatePost(goCtx context.Context, msg *types.MsgCreatePost) ( } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Author), - ), sdk.NewEvent( types.EventTypeCreatePost, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -162,12 +156,6 @@ func (k msgServer) EditPost(goCtx context.Context, msg *types.MsgEditPost) (*typ k.SavePost(ctx, updatedPost) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Editor), - ), sdk.NewEvent( types.EventTypeEditPost, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -207,12 +195,6 @@ func (k msgServer) DeletePost(goCtx context.Context, msg *types.MsgDeletePost) ( k.Keeper.DeletePost(ctx, msg.SubspaceID, msg.PostID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeDeletePost, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -313,12 +295,6 @@ func (k msgServer) AddPostAttachment(goCtx context.Context, msg *types.MsgAddPos k.SavePost(ctx, post) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Editor), - ), sdk.NewEvent( types.EventTypeAddPostAttachment, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -376,12 +352,6 @@ func (k msgServer) RemovePostAttachment(goCtx context.Context, msg *types.MsgRem k.SavePost(ctx, post) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Editor), - ), sdk.NewEvent( types.EventTypeRemovePostAttachment, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -461,12 +431,6 @@ func (k msgServer) AnswerPoll(goCtx context.Context, msg *types.MsgAnswerPoll) ( k.SaveUserAnswer(ctx, answer) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeAnswerPoll, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -488,15 +452,6 @@ func (m msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) m.SetParams(ctx, msg.Params) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), - ), - }) - return &types.MsgUpdateParamsResponse{}, nil } @@ -574,12 +529,6 @@ func (k msgServer) MovePost(goCtx context.Context, msg *types.MsgMovePost) (*typ k.Keeper.DeletePost(ctx, msg.SubspaceID, msg.PostID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Owner), - ), sdk.NewEvent( types.EventTypeMovePost, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -636,12 +585,6 @@ func (k msgServer) RequestPostOwnerTransfer(goCtx context.Context, msg *types.Ms )) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeRequestPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -673,12 +616,6 @@ func (k msgServer) CancelPostOwnerTransferRequest(goCtx context.Context, msg *ty k.DeletePostOwnerTransferRequest(ctx, msg.SubspaceID, msg.PostID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeCancelPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -735,12 +672,6 @@ func (k msgServer) AcceptPostOwnerTransferRequest(goCtx context.Context, msg *ty k.DeletePostOwnerTransferRequest(ctx, msg.SubspaceID, msg.PostID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Receiver), - ), sdk.NewEvent( types.EventTypeAcceptPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -771,12 +702,6 @@ func (k msgServer) RefusePostOwnerTransferRequest(goCtx context.Context, msg *ty k.DeletePostOwnerTransferRequest(ctx, msg.SubspaceID, msg.PostID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Receiver), - ), sdk.NewEvent( types.EventTypeRefusePostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), diff --git a/x/posts/keeper/msg_server_test.go b/x/posts/keeper/msg_server_test.go index f78b18605d..860163f21c 100644 --- a/x/posts/keeper/msg_server_test.go +++ b/x/posts/keeper/msg_server_test.go @@ -363,12 +363,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreatePost() { CreationDate: time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreatePost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeCreatePost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -485,12 +479,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreatePost() { CreationDate: time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreatePost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeCreatePost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -778,12 +766,6 @@ func (suite *KeeperTestSuite) TestMsgServer_EditPost() { EditDate: time.Date(2021, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgEditPost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeEditPost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -985,12 +967,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeletePost() { msg: types.NewMsgDeletePost(1, 1, "cosmos1r9jamre0x0qqy562rhhckt6sryztwhnvhafyz4"), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeletePost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1r9jamre0x0qqy562rhhckt6sryztwhnvhafyz4"), - ), sdk.NewEvent( types.EventTypeDeletePost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1042,12 +1018,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeletePost() { }, msg: types.NewMsgDeletePost(1, 1, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeletePost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeDeletePost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1289,12 +1259,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddPostAttachment() { EditDate: time.Date(2021, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddPostAttachment{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeAddPostAttachment, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1619,12 +1583,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemovePostAttachment() { EditDate: time.Date(2021, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemovePostAttachment{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1r9jamre0x0qqy562rhhckt6sryztwhnvhafyz4"), - ), sdk.NewEvent( types.EventTypeRemovePostAttachment, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1707,12 +1665,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemovePostAttachment() { EditDate: time.Date(2021, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemovePostAttachment{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeRemovePostAttachment, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2235,12 +2187,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AnswerPoll() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAnswerPoll{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeAnswerPoll, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2322,12 +2268,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AnswerPoll() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAnswerPoll{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeAnswerPoll, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2403,14 +2343,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateParams() { authtypes.NewModuleAddress("gov").String(), ), shouldErr: false, - expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUpdateParams{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"), - ), - }, + expEvents: sdk.Events{}, check: func(ctx sdk.Context) { params := suite.k.GetParams(ctx) suite.Require().Equal(types.DefaultParams(), params) @@ -2832,12 +2765,6 @@ func (suite *KeeperTestSuite) TestMsgServer_MovePost() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgMovePost{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeMovePost, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3227,12 +3154,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RequestPostOwnerTransfer() { ), expResponse: &types.MsgRequestPostOwnerTransferResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRequestPostOwnerTransfer{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg"), - ), sdk.NewEvent( types.EventTypeRequestPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3342,12 +3263,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CancelPostOwnerTransfer() { ), expResponse: &types.MsgCancelPostOwnerTransferRequestResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCancelPostOwnerTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1eqpa6mv2jgevukaqtjmx5535vhc3mm3cf458zg"), - ), sdk.NewEvent( types.EventTypeCancelPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3588,12 +3503,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptPostOwnerTransfer() { ), expResponse: &types.MsgAcceptPostOwnerTransferRequestResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAcceptPostOwnerTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeAcceptPostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3689,12 +3598,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RefusePostOwnerTransfer() { ), expResponse: &types.MsgRefusePostOwnerTransferRequestResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRefusePostOwnerTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"), - ), sdk.NewEvent( types.EventTypeRefusePostOwnerTransfer, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), diff --git a/x/posts/types/events.go b/x/posts/types/events.go index c5de58e61d..9a97feec7e 100644 --- a/x/posts/types/events.go +++ b/x/posts/types/events.go @@ -15,7 +15,6 @@ const ( EventTypeAcceptPostOwnerTransfer = "accept_post_owner_transfer" EventTypeRefusePostOwnerTransfer = "refuse_post_owner_transfer" - AttributeValueCategory = ModuleName AttributeKeySubspaceID = "subspace_id" AttributeKeySectionID = "section_id" AttributeKeyPostID = "post_id" diff --git a/x/profiles/keeper/msg_server_app_link.go b/x/profiles/keeper/msg_server_app_link.go index 2c1ce6392f..d4e3edb6a8 100644 --- a/x/profiles/keeper/msg_server_app_link.go +++ b/x/profiles/keeper/msg_server_app_link.go @@ -48,12 +48,6 @@ func (k Keeper) LinkApplication( "account", msg.Sender) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypesApplicationLinkCreated, sdk.NewAttribute(types.AttributeKeyUser, msg.Sender), @@ -90,14 +84,5 @@ func (k MsgServer) UnlinkApplication( "username", msg.Username, "account", msg.Signer) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), - }) - return &types.MsgUnlinkApplicationResponse{}, nil } diff --git a/x/profiles/keeper/msg_server_app_link_test.go b/x/profiles/keeper/msg_server_app_link_test.go index e6a30850c5..8500841ad3 100644 --- a/x/profiles/keeper/msg_server_app_link_test.go +++ b/x/profiles/keeper/msg_server_app_link_test.go @@ -236,12 +236,6 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkApplication() { sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgLinkApplication{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypesApplicationLinkCreated, sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), @@ -348,12 +342,6 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkApplication() { sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgLinkApplication{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypesApplicationLinkCreated, sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), @@ -528,12 +516,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkApplication() { sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC).Format(time.RFC3339)), ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUnlinkApplication{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), }, check: func(ctx sdk.Context) { suite.Require().False( diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 778b7fea91..4e0f5a05bb 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -28,12 +28,6 @@ func (k MsgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeLinkChainAccount, sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, srcAddrData.GetValue()), @@ -60,12 +54,6 @@ func (k MsgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin k.DeleteChainLink(ctx, link) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Owner), - ), sdk.NewEvent( types.EventTypeUnlinkChainAccount, sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.Target), @@ -90,12 +78,6 @@ func (k MsgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.M k.SaveDefaultExternalAddress(ctx, msg.Signer, msg.ChainName, msg.Target) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeSetDefaultExternalAddress, sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainName), diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 438dcde682..3de7b23cfa 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -107,12 +107,6 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgLinkChainAccount{})), - sdk.NewAttribute(sdk.AttributeKeySender, destAddr), - ), sdk.NewEvent( types.EventTypeLinkChainAccount, sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, srcAddr), @@ -204,12 +198,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUnlinkChainAccount{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeUnlinkChainAccount, sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), @@ -306,12 +294,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetDefaultExternalAddress() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetDefaultExternalAddress{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeSetDefaultExternalAddress, sdk.NewAttribute(types.AttributeKeyChainLinkChainName, "cosmos"), diff --git a/x/profiles/keeper/msg_server_dtag_transfers.go b/x/profiles/keeper/msg_server_dtag_transfers.go index ead6979ee3..e9e73bc4bd 100644 --- a/x/profiles/keeper/msg_server_dtag_transfers.go +++ b/x/profiles/keeper/msg_server_dtag_transfers.go @@ -44,12 +44,6 @@ func (k MsgServer) RequestDTagTransfer(goCtx context.Context, msg *types.MsgRequ } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeDTagTransferRequest, sdk.NewAttribute(types.AttributeKeyDTagToTrade, dTagToTrade), @@ -74,12 +68,6 @@ func (k MsgServer) CancelDTagTransferRequest(goCtx context.Context, msg *types.M k.DeleteDTagTransferRequest(ctx, msg.Sender, msg.Receiver) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeDTagTransferCancel, sdk.NewAttribute(types.AttributeKeyRequestSender, msg.Sender), @@ -177,12 +165,6 @@ func (k MsgServer) AcceptDTagTransferRequest(goCtx context.Context, msg *types.M } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Receiver), - ), sdk.NewEvent( types.EventTypeDTagTransferAccept, sdk.NewAttribute(types.AttributeKeyDTagToTrade, dTagToTrade), @@ -208,12 +190,6 @@ func (k MsgServer) RefuseDTagTransferRequest(goCtx context.Context, msg *types.M k.DeleteDTagTransferRequest(ctx, msg.Sender, msg.Receiver) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Receiver), - ), sdk.NewEvent( types.EventTypeDTagTransferRefuse, sdk.NewAttribute(types.AttributeKeyRequestSender, msg.Sender), diff --git a/x/profiles/keeper/msg_server_dtag_transfers_test.go b/x/profiles/keeper/msg_server_dtag_transfers_test.go index ef6eed5fce..e280245e3b 100644 --- a/x/profiles/keeper/msg_server_dtag_transfers_test.go +++ b/x/profiles/keeper/msg_server_dtag_transfers_test.go @@ -82,12 +82,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RequestDTagTransfer() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRequestDTagTransfer{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeDTagTransferRequest, sdk.NewAttribute(types.AttributeKeyDTagToTrade, fmt.Sprintf("%s-dtag", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns")), @@ -155,12 +149,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CancelDTagTransfer() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCancelDTagTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeDTagTransferCancel, sdk.NewAttribute(types.AttributeKeyRequestSender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), @@ -378,12 +366,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAcceptDTagTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - ), sdk.NewEvent( types.EventTypeDTagTransferAccept, sdk.NewAttribute(types.AttributeKeyDTagToTrade, "DTag"), @@ -413,12 +395,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAcceptDTagTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - ), sdk.NewEvent( types.EventTypeDTagTransferAccept, sdk.NewAttribute(types.AttributeKeyDTagToTrade, "DTag"), @@ -457,12 +433,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAcceptDTagTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - ), sdk.NewEvent( types.EventTypeDTagTransferAccept, sdk.NewAttribute(types.AttributeKeyDTagToTrade, "receiverDTag"), @@ -540,12 +510,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RefuseDTagTransfer() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRefuseDTagTransferRequest{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - ), sdk.NewEvent( types.EventTypeDTagTransferRefuse, sdk.NewAttribute(types.AttributeKeyRequestSender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), diff --git a/x/profiles/keeper/msg_server_params.go b/x/profiles/keeper/msg_server_params.go index 7706887523..37e3c8c28f 100644 --- a/x/profiles/keeper/msg_server_params.go +++ b/x/profiles/keeper/msg_server_params.go @@ -20,14 +20,5 @@ func (m MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) m.SetParams(ctx, msg.Params) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), - ), - }) - return &types.MsgUpdateParamsResponse{}, nil } diff --git a/x/profiles/keeper/msg_server_params_test.go b/x/profiles/keeper/msg_server_params_test.go index 99465eb921..9d91845a14 100644 --- a/x/profiles/keeper/msg_server_params_test.go +++ b/x/profiles/keeper/msg_server_params_test.go @@ -31,14 +31,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateParams() { authtypes.NewModuleAddress("gov").String(), ), shouldErr: false, - expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUpdateParams{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"), - ), - }, + expEvents: sdk.Events{}, check: func(ctx sdk.Context) { params := suite.k.GetParams(ctx) suite.Require().Equal(types.DefaultParams(), params) diff --git a/x/profiles/keeper/msgs_server_profile.go b/x/profiles/keeper/msgs_server_profile.go index b156c865a7..0e8b2fb267 100644 --- a/x/profiles/keeper/msgs_server_profile.go +++ b/x/profiles/keeper/msgs_server_profile.go @@ -70,12 +70,6 @@ func (k MsgServer) SaveProfile(goCtx context.Context, msg *types.MsgSaveProfile) } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Creator), - ), sdk.NewEvent( types.EventTypeProfileSaved, sdk.NewAttribute(types.AttributeKeyProfileDTag, updated.DTag), @@ -97,12 +91,6 @@ func (k MsgServer) DeleteProfile(goCtx context.Context, msg *types.MsgDeleteProf } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Creator), - ), sdk.NewEvent( types.EventTypeProfileDeleted, sdk.NewAttribute(types.AttributeKeyProfileCreator, msg.Creator), diff --git a/x/profiles/keeper/msgs_server_profile_test.go b/x/profiles/keeper/msgs_server_profile_test.go index dbe8cc57fd..84ba020b12 100644 --- a/x/profiles/keeper/msgs_server_profile_test.go +++ b/x/profiles/keeper/msgs_server_profile_test.go @@ -50,12 +50,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { suite.Require().True(found) }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSaveProfile{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypeProfileSaved, sdk.NewAttribute(types.AttributeKeyProfileDTag, "custom_dtag"), @@ -90,12 +84,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSaveProfile{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypeProfileSaved, sdk.NewAttribute(types.AttributeKeyProfileDTag, "other_dtag"), @@ -136,12 +124,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSaveProfile{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypeProfileSaved, sdk.NewAttribute(types.AttributeKeyProfileDTag, "Test"), @@ -220,12 +202,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ), expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSaveProfile{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - ), sdk.NewEvent( types.EventTypeProfileSaved, sdk.NewAttribute(types.AttributeKeyProfileDTag, "tomtom"), @@ -317,12 +293,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteProfile() { msg: types.NewMsgDeleteProfile("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteProfile{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - ), sdk.NewEvent( types.EventTypeProfileDeleted, sdk.NewAttribute(types.AttributeKeyProfileCreator, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index 26aeebd6f5..03fbd539a0 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -42,6 +42,4 @@ const ( AttributeKeyResolveStatus = "resolve_status" AttributeKeyAck = "acknowledgement" AttributeKeyAckError = "error" - - AttributeValueCategory = ModuleName ) diff --git a/x/reactions/keeper/msg_server.go b/x/reactions/keeper/msg_server.go index cd944303b4..22ca1eac69 100644 --- a/x/reactions/keeper/msg_server.go +++ b/x/reactions/keeper/msg_server.go @@ -89,12 +89,6 @@ func (k msgServer) AddReaction(goCtx context.Context, msg *types.MsgAddReaction) k.SetNextReactionID(ctx, msg.SubspaceID, msg.PostID, reaction.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.EventTypeAddReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -144,12 +138,6 @@ func (k msgServer) RemoveReaction(goCtx context.Context, msg *types.MsgRemoveRea k.DeleteReaction(ctx, msg.SubspaceID, msg.PostID, msg.ReactionID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.EventTypeRemoveReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -200,12 +188,6 @@ func (k msgServer) AddRegisteredReaction(goCtx context.Context, msg *types.MsgAd k.SetNextRegisteredReactionID(ctx, msg.SubspaceID, reaction.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.ActionAddRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -249,12 +231,6 @@ func (k msgServer) EditRegisteredReaction(goCtx context.Context, msg *types.MsgE k.SaveRegisteredReaction(ctx, updated) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.ActionEditRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -288,12 +264,6 @@ func (k msgServer) RemoveRegisteredReaction(goCtx context.Context, msg *types.Ms k.DeleteRegisteredReaction(ctx, msg.SubspaceID, msg.RegisteredReactionID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.EventTypeRemoveRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -329,12 +299,6 @@ func (k msgServer) SetReactionsParams(goCtx context.Context, msg *types.MsgSetRe k.SaveSubspaceReactionsParams(ctx, params) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.User), - ), sdk.NewEvent( types.EventTypeSetReactionsParams, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), diff --git a/x/reactions/keeper/msg_server_test.go b/x/reactions/keeper/msg_server_test.go index 21e99ab28a..4be4145ff2 100644 --- a/x/reactions/keeper/msg_server_test.go +++ b/x/reactions/keeper/msg_server_test.go @@ -415,12 +415,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { ReactionID: 1, }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeAddReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -507,12 +501,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReaction() { ReactionID: 1, }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeAddReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -791,12 +779,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReaction() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemoveReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeRemoveReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -964,12 +946,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddRegisteredReaction() { RegisteredReactionID: 1, }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddRegisteredReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeAddRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1160,12 +1136,6 @@ func (suite *KeeperTestSuite) TestMsgServer_EditRegisteredReaction() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgEditRegisteredReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.ActionEditRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1310,12 +1280,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveRegisteredReaction() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemoveRegisteredReaction{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeRemoveRegisteredReaction, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1449,12 +1413,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetReactionsParams() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetReactionsParams{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1efa8l9h4p6hmkps6vk8lu7nxydr46npr8qtg5f"), - ), sdk.NewEvent( types.EventTypeSetReactionsParams, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), diff --git a/x/reactions/types/events.go b/x/reactions/types/events.go index 0b68a51433..e6a8c8bcf0 100644 --- a/x/reactions/types/events.go +++ b/x/reactions/types/events.go @@ -9,7 +9,6 @@ const ( EventTypeRemoveRegisteredReaction = "removed_registered_reaction" EventTypeSetReactionsParams = "set_reactions_params" - AttributeValueCategory = ModuleName AttributeKeySubspaceID = "subspace_id" AttributeKeyPostID = "post_id" AttributeKeyReactionID = "reaction_id" diff --git a/x/relationships/keeper/msg_server.go b/x/relationships/keeper/msg_server.go index 33903a0ab0..21d117c43b 100644 --- a/x/relationships/keeper/msg_server.go +++ b/x/relationships/keeper/msg_server.go @@ -47,12 +47,6 @@ func (k msgServer) CreateRelationship(goCtx context.Context, msg *types.MsgCreat k.SaveRelationship(ctx, types.NewRelationship(msg.Signer, msg.Counterparty, msg.SubspaceID)) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeRelationshipCreated, sdk.NewAttribute(types.AttributeRelationshipCreator, msg.Signer), @@ -82,12 +76,6 @@ func (k msgServer) DeleteRelationship(goCtx context.Context, msg *types.MsgDelet k.Keeper.DeleteRelationship(ctx, msg.Signer, msg.Counterparty, msg.SubspaceID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeRelationshipDeleted, sdk.NewAttribute(types.AttributeRelationshipCreator, msg.Signer), @@ -117,12 +105,6 @@ func (k msgServer) BlockUser(goCtx context.Context, msg *types.MsgBlockUser) (*t k.SaveUserBlock(ctx, types.NewUserBlock(msg.Blocker, msg.Blocked, msg.Reason, msg.SubspaceID)) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Blocker), - ), sdk.NewEvent( types.EventTypeBlockUser, sdk.NewAttribute(types.AttributeKeyUserBlockBlocker, msg.Blocker), @@ -152,12 +134,6 @@ func (k msgServer) UnblockUser(goCtx context.Context, msg *types.MsgUnblockUser) k.DeleteUserBlock(ctx, msg.Blocker, msg.Blocked, msg.SubspaceID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Blocker), - ), sdk.NewEvent( types.EventTypeUnblockUser, sdk.NewAttribute(types.AttributeKeyUserBlockBlocker, msg.Blocker), diff --git a/x/relationships/keeper/msg_server_test.go b/x/relationships/keeper/msg_server_test.go index 8eaf32739e..064d2546ca 100644 --- a/x/relationships/keeper/msg_server_test.go +++ b/x/relationships/keeper/msg_server_test.go @@ -81,12 +81,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateRelationship() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateRelationship{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeRelationshipCreated, sdk.NewAttribute(types.AttributeRelationshipCreator, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), @@ -186,12 +180,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteRelationship() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteRelationship{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeRelationshipDeleted, sdk.NewAttribute(types.AttributeRelationshipCreator, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), @@ -294,12 +282,6 @@ func (suite *KeeperTestSuite) TestMsgServer_BlockUser() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgBlockUser{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeBlockUser, sdk.NewAttribute(types.AttributeKeyUserBlockBlocker, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), @@ -400,12 +382,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnblockUser() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUnblockUser{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), - ), sdk.NewEvent( types.EventTypeUnblockUser, sdk.NewAttribute(types.AttributeKeyUserBlockBlocker, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), diff --git a/x/relationships/types/events.go b/x/relationships/types/events.go index 96dc088901..af067d44b4 100644 --- a/x/relationships/types/events.go +++ b/x/relationships/types/events.go @@ -8,7 +8,6 @@ const ( EventTypeBlockUser = "block_user" EventTypeUnblockUser = "unblock_user" - AttributeValueCategory = ModuleName AttributeRelationshipCreator = "creator" AttributeRelationshipCounterparty = "counterparty" AttributeKeyUserBlockBlocker = "blocker" diff --git a/x/reports/keeper/msg_server.go b/x/reports/keeper/msg_server.go index a9b80e4e4f..0798419633 100644 --- a/x/reports/keeper/msg_server.go +++ b/x/reports/keeper/msg_server.go @@ -110,12 +110,6 @@ func (k msgServer) CreateReport(goCtx context.Context, msg *types.MsgCreateRepor } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Reporter), - ), sdk.NewEvent( types.EventTypeCreateReport, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -158,12 +152,6 @@ func (k msgServer) DeleteReport(goCtx context.Context, msg *types.MsgDeleteRepor k.Keeper.DeleteReport(ctx, msg.SubspaceID, msg.ReportID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeDeleteReport, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -214,12 +202,6 @@ func (k msgServer) SupportStandardReason(goCtx context.Context, msg *types.MsgSu k.SetNextReasonID(ctx, msg.SubspaceID, reason.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeSupportStandardReason, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -267,12 +249,6 @@ func (k msgServer) AddReason(goCtx context.Context, msg *types.MsgAddReason) (*t k.SetNextReasonID(ctx, msg.SubspaceID, reason.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeAddReason, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -308,12 +284,6 @@ func (k msgServer) RemoveReason(goCtx context.Context, msg *types.MsgRemoveReaso k.DeleteReason(ctx, msg.SubspaceID, msg.ReasonID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeRemoveReason, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -334,14 +304,5 @@ func (m msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) m.SetParams(ctx, msg.Params) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), - ), - }) - return &types.MsgUpdateParamsResponse{}, nil } diff --git a/x/reports/keeper/msg_server_test.go b/x/reports/keeper/msg_server_test.go index a45afbe923..df6c8d8d8a 100644 --- a/x/reports/keeper/msg_server_test.go +++ b/x/reports/keeper/msg_server_test.go @@ -279,12 +279,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateReport() { CreationDate: time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateReport{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeCreateReport, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -381,12 +375,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateReport() { CreationDate: time.Date(2020, 1, 1, 12, 00, 00, 000, time.UTC), }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateReport{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeCreateReport, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -602,12 +590,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteReport() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteReport{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeDeleteReport, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -650,12 +632,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteReport() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteReport{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeDeleteReport, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -821,12 +797,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SupportStandardReason() { ReasonsID: 1, }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSupportStandardReason{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeSupportStandardReason, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1005,12 +975,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddReason() { ReasonID: 1, }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddReason{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeAddReason, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1150,12 +1114,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveReason() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemoveReason{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qycmg40ju50fx2mcc82qtkzuswjs3mj3mqekeh"), - ), sdk.NewEvent( types.EventTypeRemoveReason, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1211,14 +1169,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateParams() { authtypes.NewModuleAddress("gov").String(), ), shouldErr: false, - expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUpdateParams{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"), - ), - }, + expEvents: sdk.Events{}, check: func(ctx sdk.Context) { params := suite.k.GetParams(ctx) suite.Require().Equal(types.DefaultParams(), params) diff --git a/x/reports/types/events.go b/x/reports/types/events.go index 52c6918209..303243da1e 100644 --- a/x/reports/types/events.go +++ b/x/reports/types/events.go @@ -11,7 +11,6 @@ const ( EventTypeAddReason = "add_reason" EventTypeRemoveReason = "remove_reason" - AttributeValueCategory = ModuleName AttributeKeySubspaceID = "subspace_id" AttributeKeyReportID = "report_id" AttributeKeyReporter = "reporter" diff --git a/x/subspaces/keeper/msg_server.go b/x/subspaces/keeper/msg_server.go index d3a325e54b..60716922fd 100644 --- a/x/subspaces/keeper/msg_server.go +++ b/x/subspaces/keeper/msg_server.go @@ -50,12 +50,6 @@ func (k msgServer) CreateSubspace(goCtx context.Context, msg *types.MsgCreateSub k.SetSubspaceID(ctx, subspace.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, subspace.Creator), - ), sdk.NewEvent( types.EventTypeCreateSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", subspaceID)), @@ -101,12 +95,6 @@ func (k msgServer) EditSubspace(goCtx context.Context, msg *types.MsgEditSubspac k.SaveSubspace(ctx, updated) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeEditSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", updated.ID)), @@ -139,12 +127,6 @@ func (k msgServer) DeleteSubspace(goCtx context.Context, msg *types.MsgDeleteSub k.Keeper.DeleteSubspace(ctx, msg.SubspaceID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeDeleteSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -198,12 +180,6 @@ func (k msgServer) CreateSection(goCtx context.Context, msg *types.MsgCreateSect k.SetNextSectionID(ctx, section.SubspaceID, section.ID+1) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Creator), - ), sdk.NewEvent( types.EventTypeCreateSection, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", section.SubspaceID)), @@ -253,12 +229,6 @@ func (k msgServer) EditSection(goCtx context.Context, msg *types.MsgEditSection) k.SaveSection(ctx, updated) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Editor), - ), sdk.NewEvent( types.EventTypeEditSection, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", section.SubspaceID)), @@ -315,12 +285,6 @@ func (k msgServer) MoveSection(goCtx context.Context, msg *types.MsgMoveSection) } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeMoveSection, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -359,12 +323,6 @@ func (k msgServer) DeleteSection(goCtx context.Context, msg *types.MsgDeleteSect k.Keeper.DeleteSection(ctx, msg.SubspaceID, msg.SectionID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeDeleteSection, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -441,12 +399,6 @@ func (k msgServer) CreateUserGroup(goCtx context.Context, msg *types.MsgCreateUs } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Creator), - ), sdk.NewEvent( types.EventTypeCreateUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -493,12 +445,6 @@ func (k msgServer) EditUserGroup(goCtx context.Context, msg *types.MsgEditUserGr k.SaveUserGroup(ctx, updated) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeEditUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -554,12 +500,6 @@ func (k msgServer) MoveUserGroup(goCtx context.Context, msg *types.MsgMoveUserGr k.SaveUserGroup(ctx, group) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EvenTypeMoveUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -611,12 +551,6 @@ func (k msgServer) SetUserGroupPermissions(goCtx context.Context, msg *types.Msg k.SaveUserGroup(ctx, group) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, signer.String()), - ), sdk.NewEvent( types.EventTypeSetUserGroupPermissions, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -656,12 +590,6 @@ func (k msgServer) DeleteUserGroup(goCtx context.Context, msg *types.MsgDeleteUs k.Keeper.DeleteUserGroup(ctx, msg.SubspaceID, msg.GroupID) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeDeleteUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -711,12 +639,6 @@ func (k msgServer) AddUserToUserGroup(goCtx context.Context, msg *types.MsgAddUs k.AddUserToGroup(ctx, msg.SubspaceID, msg.GroupID, user.String()) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeAddUserToGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -762,12 +684,6 @@ func (k msgServer) RemoveUserFromUserGroup(goCtx context.Context, msg *types.Msg k.RemoveUserFromGroup(ctx, msg.SubspaceID, msg.GroupID, msg.User) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), - ), sdk.NewEvent( types.EventTypeRemoveUserFromGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -817,12 +733,6 @@ func (k msgServer) SetUserPermissions(goCtx context.Context, msg *types.MsgSetUs } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, signer.String()), - ), sdk.NewEvent( types.EventTypeSetUserPermissions, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -867,12 +777,6 @@ func (k msgServer) GrantTreasuryAuthorization(goCtx context.Context, msg *types. } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Granter), - ), sdk.NewEvent( types.EventTypeGrantTreasuryAuthorization, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -911,12 +815,6 @@ func (k msgServer) RevokeTreasuryAuthorization(goCtx context.Context, msg *types } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Granter), - ), sdk.NewEvent( types.EventTypeRevokeTreasuryAuthorization, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -939,14 +837,7 @@ func (k msgServer) GrantAllowance(goCtx context.Context, msg *types.MsgGrantAllo return nil, errors.Wrap(types.ErrPermissionDenied, "you cannot manage allowances in this subspace") } - events := sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Granter), - ), - } + events := sdk.Events{} switch grantee := msg.Grantee.GetCachedValue().(type) { case *types.UserGrantee: @@ -1004,14 +895,7 @@ func (k msgServer) RevokeAllowance(goCtx context.Context, msg *types.MsgRevokeAl return nil, errors.Wrap(types.ErrPermissionDenied, "you cannot manage allowances in this subspace") } - events := sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Granter), - ), - } + events := sdk.Events{} switch grantee := msg.Grantee.GetCachedValue().(type) { case *types.UserGrantee: @@ -1071,12 +955,6 @@ func (k msgServer) UpdateSubspaceFeeTokens(goCtx context.Context, msg *types.Msg k.SaveSubspace(ctx, updated) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), - ), sdk.NewEvent( types.EventTypeUpdateSubspaceFeeToken, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", updated.ID)), diff --git a/x/subspaces/keeper/msg_server_test.go b/x/subspaces/keeper/msg_server_test.go index a81d266ded..5e4cf1315f 100644 --- a/x/subspaces/keeper/msg_server_test.go +++ b/x/subspaces/keeper/msg_server_test.go @@ -62,12 +62,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateSubspace() { shouldErr: false, expResponse: &types.MsgCreateSubspaceResponse{SubspaceID: 1}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateSubspace{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69"), - ), sdk.NewEvent( types.EventTypeCreateSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -117,12 +111,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateSubspace() { shouldErr: false, expResponse: &types.MsgCreateSubspaceResponse{SubspaceID: 1}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateSubspace{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos18atyyv6zycryhvnhpr2mjxgusdcah6kdpkffq0"), - ), sdk.NewEvent( types.EventTypeCreateSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -177,12 +165,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateSubspace() { shouldErr: false, expResponse: &types.MsgCreateSubspaceResponse{SubspaceID: 2}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateSubspace{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll"), - ), sdk.NewEvent( types.EventTypeCreateSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, "2"), @@ -375,12 +357,6 @@ func (suite *KeeperTestSuite) TestMsgServer_EditSubspace() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgEditSubspace{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5"), - ), sdk.NewEvent( types.EventTypeEditSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -504,12 +480,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteSubspace() { msg: types.NewMsgDeleteSubspace(1, "cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5"), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteSubspace{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5"), - ), sdk.NewEvent( types.EventTypeDeleteSubspace, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -741,12 +711,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateSection() { shouldErr: false, expResponse: &types.MsgCreateSectionResponse{SectionID: 2}, expEvent: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateSection{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1wq7mruftxd03qrrf9f7xnnzyqda9rkq5sshnr4"), - ), sdk.NewEvent( types.EventTypeCreateSection, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -947,12 +911,6 @@ func (suite *KeeperTestSuite) TestMsgServer_EditSection() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgEditSection{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1wq7mruftxd03qrrf9f7xnnzyqda9rkq5sshnr4"), - ), sdk.NewEvent( types.EventTypeEditSection, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1208,12 +1166,6 @@ func (suite *KeeperTestSuite) TestMsgServer_MoveSection() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgMoveSection{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1wq7mruftxd03qrrf9f7xnnzyqda9rkq5sshnr4"), - ), sdk.NewEvent( types.EventTypeMoveSection, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1361,12 +1313,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteSection() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteSection{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1wq7mruftxd03qrrf9f7xnnzyqda9rkq5sshnr4"), - ), sdk.NewEvent( types.EventTypeDeleteSection, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1593,12 +1539,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateUserGroup() { shouldErr: false, expResponse: &types.MsgCreateUserGroupResponse{GroupID: 2}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeCreateUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -1796,12 +1736,6 @@ func (suite *KeeperTestSuite) TestMsgServer_EditUserGroup() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgEditUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeEditUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2109,12 +2043,6 @@ func (suite *KeeperTestSuite) TestMsgServer_MoveUserGroup() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgMoveUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EvenTypeMoveUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2335,12 +2263,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserGroupPermissions() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetUserGroupPermissions{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5"), - ), sdk.NewEvent( types.EventTypeSetUserGroupPermissions, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2391,12 +2313,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserGroupPermissions() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetUserGroupPermissions{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeSetUserGroupPermissions, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2542,12 +2458,6 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteUserGroup() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgDeleteUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeDeleteUserGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2727,12 +2637,6 @@ func (suite *KeeperTestSuite) TestMsgServer_AddUserToGroup() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgAddUserToUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeAddUserToGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -2912,12 +2816,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RemoveUserFromGroup() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRemoveUserFromUserGroup{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeRemoveUserFromGroup, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3084,12 +2982,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPermissions() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetUserPermissions{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos17ua98rre5j9ce7hfude0y5y3rh4gtqkygm8hru"), - ), sdk.NewEvent( types.EventTypeSetUserPermissions, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3219,12 +3111,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateSubspaceFeeTokens() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUpdateSubspaceFeeTokens{})), - sdk.NewAttribute(sdk.AttributeKeySender, authtypes.NewModuleAddress("gov").String()), - ), sdk.NewEvent( types.EventTypeUpdateSubspaceFeeToken, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3407,12 +3293,6 @@ func (suite *KeeperTestSuite) TestMsgServer_GrantTreasuryAuthorization() { shouldErr: false, expResponse: &types.MsgGrantTreasuryAuthorizationResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgGrantTreasuryAuthorization{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1lv3e0l66rr68k5l74mnrv4j9kyny6cz27pvnez"), - ), sdk.NewEvent( types.EventTypeGrantTreasuryAuthorization, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3637,12 +3517,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RevokeTreasuryAuthorization() { shouldErr: false, expResponse: &types.MsgRevokeTreasuryAuthorizationResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRevokeTreasuryAuthorization{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1lv3e0l66rr68k5l74mnrv4j9kyny6cz27pvnez"), - ), sdk.NewEvent( types.EventTypeRevokeTreasuryAuthorization, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3880,12 +3754,6 @@ func (suite *KeeperTestSuite) TestMsgServer_GrantAllowance() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgGrantAllowance{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeGrantAllowance, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -3942,12 +3810,6 @@ func (suite *KeeperTestSuite) TestMsgServer_GrantAllowance() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgGrantAllowance{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeGrantAllowance, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -4114,12 +3976,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RevokeAllowance() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRevokeAllowance{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeRevokeAllowance, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -4165,12 +4021,6 @@ func (suite *KeeperTestSuite) TestMsgServer_RevokeAllowance() { ), shouldErr: false, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgRevokeAllowance{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1x5pjlvufs4znnhhkwe8v4tw3kz30f3lxgwza53"), - ), sdk.NewEvent( types.EventTypeRevokeAllowance, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), diff --git a/x/subspaces/types/events.go b/x/subspaces/types/events.go index c6351cf734..52cceb1be1 100644 --- a/x/subspaces/types/events.go +++ b/x/subspaces/types/events.go @@ -23,7 +23,6 @@ const ( EventTypeRevokeAllowance = "revoke_allowance" EventTypeUpdateSubspaceFeeToken = "update_subspace_fee_token" - AttributeValueCategory = ModuleName AttributeKeySubspaceID = "subspace_id" AttributeKeySubspaceName = "subspace_name" AttributeKeySubspaceCreator = "subspace_creator" diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index f10ea02c20..ea6a304a49 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -43,12 +43,6 @@ func (k msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateDenom) } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeCreateDenom, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -83,12 +77,6 @@ func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMi } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeMint, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -121,12 +109,6 @@ func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBu } ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.EventTypeBurn, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -156,12 +138,6 @@ func (k msgServer) SetDenomMetadata(goCtx context.Context, msg *types.MsgSetDeno k.bk.SetDenomMetaData(ctx, msg.Metadata) ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), sdk.NewEvent( types.ActionSetDenomMetadata, sdk.NewAttribute(types.AttributeKeySubspaceID, fmt.Sprintf("%d", msg.SubspaceID)), @@ -182,14 +158,5 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) k.SetParams(ctx, msg.Params) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), - ), - }) - return &types.MsgUpdateParamsResponse{}, nil } diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index cbd556255a..66ba9bb3cc 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -163,12 +163,6 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateDenom() { NewTokenDenom: "factory/cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47/uminttoken", }, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgCreateDenom{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69"), - ), sdk.NewEvent( types.EventTypeCreateDenom, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -438,12 +432,6 @@ func (suite *KeeperTestSuite) TestMsgServer_Mint() { ), expResponse: &types.MsgMintResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgMint{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69"), - ), sdk.NewEvent( types.EventTypeMint, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -704,12 +692,6 @@ func (suite *KeeperTestSuite) TestMsgServer_Burn() { ), expResponse: &types.MsgBurnResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgBurn{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69"), - ), sdk.NewEvent( types.EventTypeBurn, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -858,12 +840,6 @@ func (suite *KeeperTestSuite) TestMsgServer_SetDenomMetadata() { ), expResponse: &types.MsgSetDenomMetadataResponse{}, expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetDenomMetadata{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69"), - ), sdk.NewEvent( types.EventTypeSetDenomMetadata, sdk.NewAttribute(types.AttributeKeySubspaceID, "1"), @@ -928,14 +904,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateParams() { suite.k.GetParams(ctx), ) }, - expEvents: sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgUpdateParams{})), - sdk.NewAttribute(sdk.AttributeKeySender, "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"), - ), - }, + expEvents: sdk.Events{}, }, } for _, tc := range testCases { diff --git a/x/tokenfactory/types/events.go b/x/tokenfactory/types/events.go index 33e529d65c..bb9ec430f0 100644 --- a/x/tokenfactory/types/events.go +++ b/x/tokenfactory/types/events.go @@ -9,7 +9,6 @@ const ( EventTypeBurn = "tf_burn" EventTypeSetDenomMetadata = "set_denom_metadata" - AttributeValueCategory = ModuleName AttributeKeySubspaceID = "subspace_id" AttributeAmount = "amount" AttributeCreator = "creator"