fix(x/gov): remove leading comma in proposal_messages event attribute (backport #26353)#26382
Merged
aljo242 merged 1 commit intorelease/v0.54.xfrom May 4, 2026
Merged
Conversation
…#26353) Co-authored-by: Alex | Cosmos Labs <[email protected]> (cherry picked from commit 42f6f00)
Contributor
|
PR author is not in the allowed authors list. |
Contributor
|
🔒 WARNING: unsigned commits detected This pull request contains 1 commit(s) without a verified signature. How to fix:
Docs: https://docs.github.com/authentication/managing-commit-signature-verification Unsigned commits:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v0.54.x #26382 +/- ##
===================================================
+ Coverage 64.83% 64.86% +0.02%
===================================================
Files 874 874
Lines 57559 57559
===================================================
+ Hits 37321 37338 +17
+ Misses 20238 20221 -17
🚀 New features to boost your workflow:
|
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.
This is an automatic backport of pull request #26353 done by Mergify.