-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec.go
109 lines (103 loc) · 3.66 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
nykstypes "github.com/twilight-project/nyks/x/forks/types"
)
func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgConfirmBtcDeposit{}, "bridge/MsgConfirmBtcDeposit", nil)
cdc.RegisterConcrete(&MsgRegisterBtcDepositAddress{}, "bridge/RegisterBtcDepositAddress", nil)
cdc.RegisterConcrete(&MsgRegisterReserveAddress{}, "bridge/RegisterReserveAddress", nil)
cdc.RegisterConcrete(&MsgRegisterJudge{}, "bridge/RegisterJudge", nil)
cdc.RegisterConcrete(&MsgWithdrawBtcRequest{}, "bridge/WithdrawRequest", nil)
cdc.RegisterConcrete(&MsgSweepProposal{}, "bridge/SweepProposal", nil)
cdc.RegisterConcrete(&MsgWithdrawTxSigned{}, "bridge/WithdrawTxSigned", nil)
cdc.RegisterConcrete(&MsgWithdrawTxFinal{}, "bridge/WithdrawTxFinal", nil)
cdc.RegisterConcrete(&MsgSignRefund{}, "bridge/SignRefund", nil)
cdc.RegisterConcrete(&MsgBroadcastTxSweep{}, "bridge/BroadcastTxSweep", nil)
cdc.RegisterConcrete(&MsgSignSweep{}, "bridge/SignSweep", nil)
cdc.RegisterConcrete(&MsgProposeRefundHash{}, "bridge/ProposeRefundHash", nil)
cdc.RegisterConcrete(&MsgConfirmBtcWithdraw{}, "bridge/ConfirmBtcWithdraw", nil)
cdc.RegisterConcrete(&MsgUnsignedTxSweep{}, "bridge/UnsignedTxSweep", nil)
cdc.RegisterConcrete(&MsgUnsignedTxRefund{}, "bridge/UnsignedTxRefund", nil)
cdc.RegisterConcrete(&MsgBroadcastTxRefund{}, "bridge/BroadcastTxRefund", nil)
cdc.RegisterConcrete(&MsgProposeSweepAddress{}, "bridge/ProposeSweepAddress", nil)
// this line is used by starport scaffolding # 2
}
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgConfirmBtcDeposit{},
)
registry.RegisterInterface(
"BtcProposal",
(*nykstypes.BtcProposal)(nil),
&MsgConfirmBtcDeposit{},
)
registry.RegisterInterface(
"BtcProposal",
(*nykstypes.BtcProposal)(nil),
&MsgSweepProposal{},
)
registry.RegisterInterface(
"BtcProposal",
(*nykstypes.BtcProposal)(nil),
&MsgConfirmBtcWithdraw{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgRegisterBtcDepositAddress{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgRegisterReserveAddress{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgRegisterJudge{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgWithdrawBtcRequest{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSweepProposal{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgWithdrawTxSigned{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgWithdrawTxFinal{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSignRefund{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgBroadcastTxSweep{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSignSweep{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgProposeRefundHash{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgConfirmBtcWithdraw{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUnsignedTxSweep{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUnsignedTxRefund{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgBroadcastTxRefund{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgProposeSweepAddress{},
)
// this line is used by starport scaffolding # 3
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
var (
Amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)