2018-12-18 16:10:04 +00:00
|
|
|
package crypto
|
|
|
|
|
2019-08-11 14:42:46 +00:00
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
)
|
2018-12-18 16:10:04 +00:00
|
|
|
|
2020-06-08 18:33:48 +00:00
|
|
|
var cryptoCodec = codec.New()
|
2018-12-18 16:10:04 +00:00
|
|
|
|
2019-09-15 16:12:59 +00:00
|
|
|
const (
|
2020-06-08 18:33:48 +00:00
|
|
|
// Amino encoding names
|
2019-09-15 16:12:59 +00:00
|
|
|
PrivKeyAminoName = "crypto/PrivKeySecp256k1"
|
|
|
|
PubKeyAminoName = "crypto/PubKeySecp256k1"
|
|
|
|
)
|
|
|
|
|
2018-12-18 16:10:04 +00:00
|
|
|
func init() {
|
2020-06-08 18:33:48 +00:00
|
|
|
RegisterCodec(cryptoCodec)
|
2018-12-18 16:10:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RegisterCodec registers all the necessary types with amino for the given
|
|
|
|
// codec.
|
|
|
|
func RegisterCodec(cdc *codec.Codec) {
|
2019-09-15 16:12:59 +00:00
|
|
|
cdc.RegisterConcrete(PubKeySecp256k1{}, PubKeyAminoName, nil)
|
|
|
|
cdc.RegisterConcrete(PrivKeySecp256k1{}, PrivKeyAminoName, nil)
|
2018-12-18 16:10:04 +00:00
|
|
|
}
|