/
codec.go
70 lines (59 loc) · 2.17 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)
var (
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)
const (
// msgs
setHotRoutes = "osmosis/MsgSetHotRoutes"
setDeveloperAccount = "osmosis/MsgSetDeveloperAccount"
setMaxPoolPointsPerTx = "osmosis/MsgSetMaxPoolPointsPerTx"
setMaxPoolPointsPerBlock = "osmosis/MsgSetMaxPoolPointsPerBlock"
setInfoByPoolType = "osmosis/MsgSetInfoByPoolType"
setBaseDenoms = "osmosis/MsgSetBaseDenoms"
// proposals
setProtoRevEnabledProposal = "osmosis/SetProtoRevEnabledProposal"
setProtoRevAdminAccountProposal = "osmosis/SetProtoRevAdminAccountProposal"
)
func init() {
RegisterCodec(amino)
sdk.RegisterLegacyAminoCodec(amino)
amino.Seal()
}
func RegisterCodec(cdc *codec.LegacyAmino) {
// msgs
cdc.RegisterConcrete(&MsgSetHotRoutes{}, setHotRoutes, nil)
cdc.RegisterConcrete(&MsgSetDeveloperAccount{}, setDeveloperAccount, nil)
cdc.RegisterConcrete(&MsgSetMaxPoolPointsPerTx{}, setMaxPoolPointsPerTx, nil)
cdc.RegisterConcrete(&MsgSetMaxPoolPointsPerBlock{}, setMaxPoolPointsPerBlock, nil)
cdc.RegisterConcrete(&MsgSetInfoByPoolType{}, setInfoByPoolType, nil)
cdc.RegisterConcrete(&MsgSetBaseDenoms{}, setBaseDenoms, nil)
// proposals
cdc.RegisterConcrete(&SetProtoRevEnabledProposal{}, setProtoRevEnabledProposal, nil)
cdc.RegisterConcrete(&SetProtoRevAdminAccountProposal{}, setProtoRevAdminAccountProposal, nil)
}
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
// msgs
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSetHotRoutes{},
&MsgSetDeveloperAccount{},
&MsgSetMaxPoolPointsPerTx{},
&MsgSetMaxPoolPointsPerBlock{},
&MsgSetInfoByPoolType{},
&MsgSetBaseDenoms{},
)
// proposals
registry.RegisterImplementations(
(*govtypesv1.Content)(nil),
&SetProtoRevEnabledProposal{},
&SetProtoRevAdminAccountProposal{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}