Skip to content

Commit

Permalink
sanitize message contained in a x/gov or x/group proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega committed Jan 29, 2024
1 parent c949d5b commit 2538051
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions e2e/testsuite/sanitize/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,26 @@ func removeUnknownFields(tag string, msg sdk.Msg) sdk.Msg {
msg.Title = ""
msg.Summary = ""
}
// sanitize messages contained in the x/gov proposal
msgs, err := msg.GetMsgs()
if err != nil {
panic(err)
}
sanitizedMsgs := Messages(tag, msgs...)
msg.SetMsgs(sanitizedMsgs)
return msg
case *grouptypes.MsgSubmitProposal:
if !groupsv1ProposalTitleAndSummary.IsSupported(tag) {
msg.Title = ""
msg.Summary = ""
}
// sanitize messages contained in the x/group proposal
msgs, err := msg.GetMsgs()
if err != nil {
panic(err)
}
sanitizedMsgs := Messages(tag, msgs...)
msg.SetMsgs(sanitizedMsgs)
return msg
case *icacontrollertypes.MsgRegisterInterchainAccount:
if !icaUnorderedChannelFeatureReleases.IsSupported(tag) {
Expand Down

0 comments on commit 2538051

Please sign in to comment.