desmos-labs / desmos

Improving the well-being of users on social networks through the blockchain technology.
https://desmos.network
Apache License 2.0
103 stars 45 forks source link

fix: remove duplicated message type events #1284

Closed dadamu closed 6 months ago

dadamu commented 6 months ago

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 has two message type event:

[
    {
        "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...

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...

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (cfefad2) 81.46% compared to head (22ed971) 81.04%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1284 +/- ## ========================================== - Coverage 81.46% 81.04% -0.43% ========================================== Files 218 218 Lines 18287 17880 -407 ========================================== - Hits 14897 14490 -407 Misses 2778 2778 Partials 612 612 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.