-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec.go
38 lines (32 loc) · 1.29 KB
/
codec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package types
import (
"github.com/mycodeku/transtionhelper/codec"
"github.com/mycodeku/transtionhelper/codec/legacy"
"github.com/mycodeku/transtionhelper/codec/types"
sdk "github.com/mycodeku/transtionhelper/types"
"github.com/mycodeku/transtionhelper/types/msgservice"
govtypes "github.com/mycodeku/transtionhelper/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)
}