39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package types
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
"github.com/cosmos/cosmos-sdk/codec/legacy"
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
|
)
|
|
|
|
func init() {
|
|
RegisterLegacyAminoCodec(legacy.Cdc)
|
|
}
|
|
|
|
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
cdc.RegisterConcrete(Plan{}, "cosmos-sdk/Plan", nil)
|
|
cdc.RegisterConcrete(&SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal", nil)
|
|
cdc.RegisterConcrete(&CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal", nil)
|
|
legacy.RegisterAminoMsg(cdc, &MsgSoftwareUpgrade{}, "cosmos-sdk/MsgSoftwareUpgrade")
|
|
legacy.RegisterAminoMsg(cdc, &MsgCancelUpgrade{}, "cosmos-sdk/MsgCancelUpgrade")
|
|
}
|
|
|
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
registry.RegisterImplementations(
|
|
(*govtypes.Content)(nil),
|
|
&SoftwareUpgradeProposal{},
|
|
&CancelSoftwareUpgradeProposal{},
|
|
)
|
|
|
|
registry.RegisterImplementations((*sdk.Msg)(nil),
|
|
&MsgSoftwareUpgrade{},
|
|
&MsgCancelUpgrade{},
|
|
)
|
|
|
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
|
}
|