diff --git a/x/gov/migrations/v3/convert.go b/x/gov/migrations/v3/convert.go index 7c9c111eb3..bef6cc157d 100644 --- a/x/gov/migrations/v3/convert.go +++ b/x/gov/migrations/v3/convert.go @@ -51,16 +51,14 @@ func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error) { if len(msgs) != 1 { return v1beta1.Proposal{}, sdkerrors.ErrInvalidType.Wrap("can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of proposal messages is more than one") } - for _, msg := range msgs { - if legacyMsg, ok := msg.(*v1.MsgExecLegacyContent); ok { - // check that the content struct can be unmarshalled - _, err := v1.LegacyContentFromMessage(legacyMsg) - if err != nil { - return v1beta1.Proposal{}, err - } - legacyProposal.Content = legacyMsg.Content - return legacyProposal, nil + if legacyMsg, ok := msgs[0].(*v1.MsgExecLegacyContent); ok { + // check that the content struct can be unmarshalled + _, err := v1.LegacyContentFromMessage(legacyMsg) + if err != nil { + return v1beta1.Proposal{}, err } + legacyProposal.Content = legacyMsg.Content + return legacyProposal, nil } // hack to fill up the content with the first message // this is to support clients that have not yet (properly) use gov/v1 endpoints