Skip to content

Commit

Permalink
fix(x/upgrade): register missing implementation for SoftwareUpgradePr…
Browse files Browse the repository at this point in the history
…oposal

to avoid no concrete type registered
for type URL /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal against interface *v1beta1.Content error
  • Loading branch information
mmsqe committed Jan 4, 2025
1 parent 07d5168 commit 61fafb4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

* (query) [23002](https://github.com/cosmos/cosmos-sdk/pull/23002) Fix collection filtered pagination.
* (x/auth/tx) [#23148](https://github.com/cosmos/cosmos-sdk/pull/23148) Avoid panic from intoAnyV2 when v1.PublicKey is optional.
* (x/upgrade) [#23177](https://github.com/cosmos/cosmos-sdk/pull/23177) Register missing implementation for SoftwareUpgradeProposal to avoid no concrete type registered for type URL /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal against interface *v1beta1.Content error.

### API Breaking Changes

Expand Down
6 changes: 5 additions & 1 deletion x/upgrade/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"cosmossdk.io/core/registry"
coretransaction "cosmossdk.io/core/transaction"
"cosmossdk.io/x/gov/types/v1beta1"

"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/types/msgservice"
Expand All @@ -23,6 +24,9 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
&MsgSoftwareUpgrade{},
&MsgCancelUpgrade{},
)

registrar.RegisterImplementations(
(*v1beta1.Content)(nil),
&SoftwareUpgradeProposal{},
)
msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc)
}
21 changes: 21 additions & 0 deletions x/upgrade/types/proposal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package types

import (
"cosmossdk.io/x/gov/types"
"cosmossdk.io/x/gov/types/v1beta1"
)

// GetTitle returns the proposal title
func (sp *SoftwareUpgradeProposal) GetTitle() string { return sp.Title }

// GetDescription returns the proposal description
func (sp *SoftwareUpgradeProposal) GetDescription() string { return sp.Description }

// ProposalRoute returns the proposal router key
func (sp *SoftwareUpgradeProposal) ProposalRoute() string { return types.RouterKey }

// ProposalType is "Text"
func (sp *SoftwareUpgradeProposal) ProposalType() string { return v1beta1.ProposalTypeText }

// ValidateBasic validates the content's title and description of the proposal
func (sp *SoftwareUpgradeProposal) ValidateBasic() error { return v1beta1.ValidateAbstract(sp) }

0 comments on commit 61fafb4

Please sign in to comment.