-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec.go
83 lines (77 loc) · 3.3 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
package types
import (
"github.com/ci123chain/ci123chain/pkg/abci/codec"
codectypes "github.com/ci123chain/ci123chain/pkg/abci/codec/types"
sdk "github.com/ci123chain/ci123chain/pkg/abci/types"
)
var GravityCodec *codec.Codec
var SubModuleCdc *codec.ProtoCodec
func init() {
GravityCodec = codec.New()
RegisterCodec(GravityCodec)
codec.RegisterCrypto(GravityCodec)
//GravityCodec.Seal()
}
func SetBinary(registry codectypes.InterfaceRegistry) {
SubModuleCdc = codec.NewProtoCodec(registry)
}
// RegisterCodec registers concrete types on the Amino codec
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterInterface((*EthereumClaim)(nil), nil)
cdc.RegisterConcrete(&MsgSetOrchestratorAddress{}, "gravity/MsgSetOrchestratorAddress", nil)
cdc.RegisterConcrete(&MsgValsetConfirm{}, "gravity/MsgValsetConfirm", nil)
cdc.RegisterConcrete(&MsgSendToEth{}, "gravity/MsgSendToEth", nil)
cdc.RegisterConcrete(&MsgRequestBatch{}, "gravity/MsgRequestBatch", nil)
cdc.RegisterConcrete(&MsgConfirmBatch{}, "gravity/MsgConfirmBatch", nil)
cdc.RegisterConcrete(&MsgConfirmLogicCall{}, "gravity/MsgConfirmLogicCall", nil)
cdc.RegisterConcrete(&Valset{}, "gravity/Valset", nil)
cdc.RegisterConcrete(&MsgDepositClaim{}, "gravity/MsgDepositClaim", nil)
cdc.RegisterConcrete(&MsgDeposit721Claim{}, "gravity/MsgDeposit721Claim", nil)
cdc.RegisterConcrete(&MsgWithdrawClaim{}, "gravity/MsgWithdrawClaim", nil)
cdc.RegisterConcrete(&MsgERC20DeployedClaim{}, "gravity/MsgERC20DeployedClaim", nil)
cdc.RegisterConcrete(&MsgERC721DeployedClaim{}, "gravity/MsgERC721DeployedClaim", nil)
cdc.RegisterConcrete(&MsgLogicCallExecutedClaim{}, "gravity/MsgLogicCallExecutedClaim", nil)
cdc.RegisterConcrete(&MsgValsetConfirmNonceClaim{}, "gravity/MsgValsetConfirmNonceClaim", nil)
cdc.RegisterConcrete(&OutgoingTxBatch{}, "gravity/OutgoingTxBatch", nil)
cdc.RegisterConcrete(&MsgCancelSendToEth{}, "gravity/MsgCancelSendToEth", nil)
cdc.RegisterConcrete(&OutgoingTransferTx{}, "gravity/OutgoingTransferTx", nil)
cdc.RegisterConcrete(&ERC20Token{}, "gravity/ERC20Token", nil)
cdc.RegisterConcrete(&ERC20ToDenom{}, "gravity/ERC20ToDenom", nil)
cdc.RegisterConcrete(&IDSet{}, "gravity/IDSet", nil)
cdc.RegisterConcrete(&Attestation{}, "gravity/Attestation", nil)
cdc.RegisterConcrete(&MetaData{}, "gravity/ContractMetaData", nil)
cdc.RegisterConcrete(&GenesisState{}, "gravity/GenesisState", nil)
cdc.RegisterConcrete(&GravityData{}, "gravity/GravityData", nil)
cdc.RegisterConcrete(&Params{}, "gravity/Params", nil)
cdc.RegisterConcrete(&BridgeValidator{}, "gravity/BridgeValidator", nil)
cdc.RegisterConcrete(&BridgeValidators{}, "gravity/BridgeValidators", nil)
}
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterInterface(
"gravity.v1.EthereumClaim",
(*EthereumClaim)(nil),
)
registry.RegisterImplementations(
(*EthereumClaim)(nil),
&MsgDepositClaim{},
&MsgDeposit721Claim{},
&MsgWithdrawClaim{},
&MsgERC20DeployedClaim{},
&MsgERC721DeployedClaim{},
&MsgValsetConfirmNonceClaim{},
)
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgValsetConfirm{},
&MsgSendToEth{},
&MsgRequestBatch{},
&MsgConfirmBatch{},
&MsgDepositClaim{},
&MsgDeposit721Claim{},
&MsgWithdrawClaim{},
&MsgERC20DeployedClaim{},
&MsgERC721DeployedClaim{},
&MsgValsetConfirmNonceClaim{},
&MsgCancelSendToEth{},
)
}