feat(gov): support v1.Proposal in v1beta1.Proposal.Content#14347
Conversation
|
Adding backports to 0.46 and 0.47, but maybe we will need to make it manually , because the directory names changed. |
| return legacyProposal, nil | ||
| // hack to fill up the content with the first message | ||
| legacyProposal.Content, err = codectypes.NewAnyWithValue(msgs[0]) | ||
|
|
There was a problem hiding this comment.
The first idea I had, was to create a simple message:
message BasicContent {
string title = 1;
string description = 2 ;
}
and fill it using the Content interface. But, then we will remove additional attributes, which are in fact used by explorers to display the full content (I verified that with ping pub).
There was a problem hiding this comment.
I agree, the current way you have is best imo.
|
Can we add a NotEmpty / Equal check in tests? |
|
@julienrbrt what do you mean? |
I just mean adding a test in here: https://github.com/cosmos/cosmos-sdk/blob/main/x/gov/migrations/v3/convert_test.go, to check content is properly set. |
julienrbrt
left a comment
There was a problem hiding this comment.
lgtm, can we add a changelog too?
Co-authored-by: Julien Robert <julien@rbrt.fr>
|
[Cosmos SDK] Kudos, SonarCloud Quality Gate passed! |
|
Added an error when amount of messages in v1.Proposal is different than one. The conversion (and the endpoint) will fail in that case. |
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
(cherry picked from commit 330ff5f) # Conflicts: # CHANGELOG.md
(cherry picked from commit 330ff5f) # Conflicts: # CHANGELOG.md # x/gov/migrations/v3/convert.go # x/gov/migrations/v3/convert_test.go
|
@Mergifyio backport release/v0.47.x |
✅ Backports have been createdDetails
|
| 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 { |
There was a problem hiding this comment.
The for loop isn't needed anymore
There was a problem hiding this comment.
yes... too late :/ Is it worth to create another PR?








Description
Closes: #14334
Strawman solution to handle
gov/v1proposals ingov/v1beta1.Proposal.Contentrequired for existing explorers (mintscan, ping pub, kepler) and wallets.I tested it locally in Umee and local, with various proposals (including sofware upgrade, custom proposals, params...)
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change