2020-06-04 03:38:24 -07:00
|
|
|
package codec
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/tendermint/tendermint/crypto/sr25519"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2020-09-25 01:41:16 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
2020-09-16 04:08:55 -07:00
|
|
|
kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
|
2020-08-28 09:02:38 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
2020-09-18 02:40:39 -07:00
|
|
|
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
2020-06-04 03:38:24 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// RegisterCrypto registers all crypto dependency types with the provided Amino
|
|
|
|
// codec.
|
2020-08-10 12:41:21 -07:00
|
|
|
func RegisterCrypto(cdc *codec.LegacyAmino) {
|
2020-09-18 02:40:39 -07:00
|
|
|
cdc.RegisterInterface((*cryptotypes.PubKey)(nil), nil)
|
2020-08-14 10:58:53 -07:00
|
|
|
cdc.RegisterConcrete(sr25519.PubKey{},
|
|
|
|
sr25519.PubKeyName, nil)
|
2020-09-25 01:41:16 -07:00
|
|
|
cdc.RegisterConcrete(&ed25519.PubKey{},
|
|
|
|
ed25519.PubKeyName, nil)
|
2020-09-16 04:08:55 -07:00
|
|
|
cdc.RegisterConcrete(&secp256k1.PubKey{},
|
2020-08-14 10:58:53 -07:00
|
|
|
secp256k1.PubKeyName, nil)
|
2020-09-16 04:08:55 -07:00
|
|
|
cdc.RegisterConcrete(&kmultisig.LegacyAminoPubKey{},
|
2020-09-18 02:40:39 -07:00
|
|
|
kmultisig.PubKeyAminoRoute, nil)
|
2020-06-04 03:38:24 -07:00
|
|
|
|
2020-11-09 08:01:43 -08:00
|
|
|
cdc.RegisterInterface((*cryptotypes.PrivKey)(nil), nil)
|
2020-08-14 10:58:53 -07:00
|
|
|
cdc.RegisterConcrete(sr25519.PrivKey{},
|
|
|
|
sr25519.PrivKeyName, nil)
|
2021-02-15 07:32:51 -08:00
|
|
|
cdc.RegisterConcrete(&ed25519.PrivKey{}, //nolint:staticcheck
|
2020-09-25 01:41:16 -07:00
|
|
|
ed25519.PrivKeyName, nil)
|
2020-09-16 04:08:55 -07:00
|
|
|
cdc.RegisterConcrete(&secp256k1.PrivKey{},
|
2020-08-14 10:58:53 -07:00
|
|
|
secp256k1.PrivKeyName, nil)
|
2020-06-04 03:38:24 -07:00
|
|
|
}
|