-
Notifications
You must be signed in to change notification settings - Fork 2
/
codec.go
29 lines (24 loc) · 1012 Bytes
/
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
package types
import (
"github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec"
"github.com/fibonacci-chain/fbc/x/evidence/exported"
)
// ModuleCdc defines the evidence module's codec. The codec is not sealed as to
// allow other modules to register their concrete Evidence types.
var ModuleCdc = codec.New()
// RegisterCodec registers all the necessary types and interfaces for the
// evidence module.
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterInterface((*exported.Evidence)(nil), nil)
cdc.RegisterConcrete(MsgSubmitEvidence{}, "cosmos-sdk/MsgSubmitEvidence", nil)
cdc.RegisterConcrete(Equivocation{}, "cosmos-sdk/Equivocation", nil)
}
// RegisterEvidenceTypeCodec registers an external concrete Evidence type defined
// in another module for the internal ModuleCdc. This allows the MsgSubmitEvidence
// to be correctly Amino encoded and decoded.
func RegisterEvidenceTypeCodec(o interface{}, name string) {
ModuleCdc.RegisterConcrete(o, name, nil)
}
func init() {
RegisterCodec(ModuleCdc)
}