/
codec.go
50 lines (41 loc) · 1.25 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
39
40
41
42
43
44
45
46
47
48
49
50
package types
import (
"github.com/reapchain/cosmos-sdk/codec"
codectypes "github.com/reapchain/cosmos-sdk/codec/types"
sdk "github.com/reapchain/cosmos-sdk/types"
"github.com/reapchain/cosmos-sdk/types/msgservice"
govtypes "github.com/reapchain/cosmos-sdk/x/gov/types"
)
var (
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
AminoCdc = codec.NewAminoCodec(amino)
)
const (
convertToNative = "reapchain/MsgConvertToNative"
convertToDenom = "reapchain/MsgConvertToDenom"
)
func init() {
RegisterLegacyAminoCodec(amino)
amino.Seal()
}
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgConvertToNative{},
&MsgConvertToDenom{},
)
registry.RegisterImplementations(
(*govtypes.Content)(nil),
&RegisterEscrowDenomProposal{},
&RegisterEscrowDenomAndConvertProposal{},
&ToggleEscrowConversionProposal{},
&AddToEscrowPoolProposal{},
&AddToEscrowPoolAndConvertProposal{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgConvertToNative{}, convertToNative, nil)
cdc.RegisterConcrete(&MsgConvertToDenom{}, convertToDenom, nil)
}