2020-02-19 16:04:13 -08:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2020-05-05 07:28:20 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
2020-07-23 19:45:34 -07:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2020-02-19 16:04:13 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// RegisterCodec registers concrete types on codec
|
2020-08-10 12:41:21 -07:00
|
|
|
func RegisterCodec(cdc *codec.LegacyAmino) {
|
2020-06-03 12:52:05 -07:00
|
|
|
cdc.RegisterConcrete(&MsgUnjail{}, "cosmos-sdk/MsgUnjail", nil)
|
2020-02-19 16:04:13 -08:00
|
|
|
}
|
|
|
|
|
2020-07-23 19:45:34 -07:00
|
|
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
|
|
registry.RegisterImplementations((*sdk.Msg)(nil),
|
|
|
|
&MsgUnjail{},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-02-19 16:04:13 -08:00
|
|
|
var (
|
|
|
|
amino = codec.New()
|
|
|
|
|
|
|
|
// ModuleCdc references the global x/slashing module codec. Note, the codec
|
|
|
|
// should ONLY be used in certain instances of tests and for JSON encoding as Amino
|
|
|
|
// is still used for that purpose.
|
|
|
|
//
|
|
|
|
// The actual codec used for serialization should be provided to x/slashing and
|
|
|
|
// defined at the application level.
|
2020-08-13 06:20:02 -07:00
|
|
|
ModuleCdc = codec.NewAminoCodec(amino)
|
2020-02-19 16:04:13 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RegisterCodec(amino)
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec.RegisterCrypto(amino)
|
2020-02-19 16:04:13 -08:00
|
|
|
amino.Seal()
|
|
|
|
}
|