Skip to content

fix(x/gov): remove leading comma in proposal_messages event attribute (backport #26353)#26382

Merged
aljo242 merged 1 commit intorelease/v0.54.xfrom
mergify/bp/release/v0.54.x/pr-26353
May 4, 2026
Merged

fix(x/gov): remove leading comma in proposal_messages event attribute (backport #26353)#26382
aljo242 merged 1 commit intorelease/v0.54.xfrom
mergify/bp/release/v0.54.x/pr-26353

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 4, 2026

Description

Closes: #26045

The proposal_messages event attribute was being built by prepending a comma to each message type URL inside the loop in x/gov/keeper/proposal.go:

msgsStr += fmt.Sprintf(",%s", sdk.MsgTypeURL(msg))

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

  • Replace the manual msgsStr accumulator with a []string collected via append, then emit the joined value with strings.Join(msgTypeURLs, ",").
  • Add TestSubmitProposal_EmitsMessagesWithoutLeadingComma regression 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 CancelProposal for the same pattern (per the suggestion in the issue thread) — it does not emit a proposal_messages event, 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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 4, 2026

PR author is not in the allowed authors list.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🔒 WARNING: unsigned commits detected

This pull request contains 1 commit(s) without a verified signature.

How to fix:

  1. Set up commit signing (GPG or SSH).
  2. Amend/rebase so every commit in this PR is verified-signed.
  3. Push the updated branch and open a new PR, or ask a maintainer to reopen once fixed.

Docs: https://docs.github.com/authentication/managing-commit-signature-verification

Unsigned commits:

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.86%. Comparing base (4842dd4) to head (e69da8d).
⚠️ Report is 15 commits behind head on release/v0.54.x.

Additional details and impacted files

Impacted file tree graph

@@                 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     
Files with missing lines Coverage Δ
x/gov/keeper/proposal.go 83.09% <100.00%> (ø)

... and 3 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aljo242 aljo242 merged commit 66463cc into release/v0.54.x May 4, 2026
43 checks passed
@aljo242 aljo242 deleted the mergify/bp/release/v0.54.x/pr-26353 branch May 4, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants