-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec.go
43 lines (38 loc) · 1.2 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
package types
import (
"github.com/ci123chain/ci123chain/pkg/abci/codec"
codectypes "github.com/ci123chain/ci123chain/pkg/abci/codec/types"
"github.com/ci123chain/ci123chain/pkg/ibc/core/exported"
types2 "github.com/tendermint/tendermint/proto/tendermint/types"
)
var LightClientCodec *codec.Codec
func init(){
LightClientCodec = codec.New()
RegisterCodec(LightClientCodec)
codec.RegisterCrypto(LightClientCodec)
LightClientCodec.Seal()
}
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(&ClientState{}, "ibclightclient/ClientState", nil)
cdc.RegisterConcrete(&ConsensusState{}, "ibclightclient/ConsensusState", nil)
cdc.RegisterConcrete(&types2.ValidatorSet{}, "ibclightclient/tendermint.ValidatorSet", nil)
cdc.RegisterConcrete(&Header{}, "ibclightclient/Header", nil)
}
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*exported.ClientState)(nil),
&ClientState{},
)
registry.RegisterImplementations(
(*exported.ConsensusState)(nil),
&ConsensusState{},
)
registry.RegisterImplementations(
(*exported.Header)(nil),
&Header{},
)
//registry.RegisterImplementations(
// (*exported.Misbehaviour)(nil),
// &Misbehaviour{},
//)
}