fix(x/gov): remove leading comma in proposal_messages event attribute#26353
Merged
aljo242 merged 3 commits intocosmos:mainfrom May 4, 2026
Merged
Conversation
The proposal_messages event attribute was being built by prepending a comma to each message type URL inside the loop, producing values like ",/cosmos.bank.v1beta1.MsgSend,/cosmos.staking.v1beta1.MsgDelegate" instead of the intended comma-separated list. This broke downstream consumers that split the attribute on commas. Replace the manual accumulator with strings.Join over a []string of type URLs, and add a regression test that asserts the emitted attribute has no leading comma. Closes: cosmos#26045
Contributor
|
PR author is not in the allowed authors list. |
aljo242
approved these changes
May 4, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26353 +/- ##
==========================================
- Coverage 64.87% 64.86% -0.02%
==========================================
Files 890 874 -16
Lines 58583 57601 -982
==========================================
- Hits 38008 37361 -647
+ Misses 20575 20240 -335
🚀 New features to boost your workflow:
|
aljo242
added a commit
that referenced
this pull request
May 4, 2026
…6353 fix(x/gov): remove leading comma in proposal_messages event attribute (backport #26353)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: #26045
The
proposal_messagesevent attribute was being built by prepending a comma to each message type URL inside the loop inx/gov/keeper/proposal.go:For a proposal with two messages, this emitted
",/cosmos.bank.v1beta1.MsgSend,/cosmos.staking.v1beta1.MsgDelegate"instead of"/cosmos.bank.v1beta1.MsgSend,/cosmos.staking.v1beta1.MsgDelegate". The leading comma broke downstream consumers that parse the attribute by splitting on commas (the first element comes back empty).Changes
msgsStraccumulator with a[]stringcollected viaappend, then emit the joined value withstrings.Join(msgTypeURLs, ",").TestSubmitProposal_EmitsMessagesWithoutLeadingCommaregression test that submits a proposal with two messages and asserts the emitted attribute has no leading comma and equals the expected joined value.I also checked
CancelProposalfor the same pattern (per the suggestion in the issue thread) — it does not emit aproposal_messagesevent, so no changes needed there.A CHANGELOG entry will be added in a follow-up commit once this PR has a number.