|
@ -2,8 +2,10 @@ package cryptoAmino |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
amino "github.com/tendermint/go-amino" |
|
|
amino "github.com/tendermint/go-amino" |
|
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/crypto" |
|
|
"github.com/tendermint/tendermint/crypto" |
|
|
"github.com/tendermint/tendermint/crypto/ed25519" |
|
|
"github.com/tendermint/tendermint/crypto/ed25519" |
|
|
|
|
|
"github.com/tendermint/tendermint/crypto/multisig" |
|
|
"github.com/tendermint/tendermint/crypto/secp256k1" |
|
|
"github.com/tendermint/tendermint/crypto/secp256k1" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -24,15 +26,17 @@ func RegisterAmino(cdc *amino.Codec) { |
|
|
// These are all written here instead of
|
|
|
// These are all written here instead of
|
|
|
cdc.RegisterInterface((*crypto.PubKey)(nil), nil) |
|
|
cdc.RegisterInterface((*crypto.PubKey)(nil), nil) |
|
|
cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, |
|
|
cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, |
|
|
"tendermint/PubKeyEd25519", nil) |
|
|
|
|
|
|
|
|
ed25519.PubKeyAminoRoute, nil) |
|
|
cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, |
|
|
cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, |
|
|
"tendermint/PubKeySecp256k1", nil) |
|
|
|
|
|
|
|
|
secp256k1.PubKeyAminoRoute, nil) |
|
|
|
|
|
cdc.RegisterConcrete(multisig.PubKeyMultisigThreshold{}, |
|
|
|
|
|
multisig.PubKeyMultisigThresholdAminoRoute, nil) |
|
|
|
|
|
|
|
|
cdc.RegisterInterface((*crypto.PrivKey)(nil), nil) |
|
|
cdc.RegisterInterface((*crypto.PrivKey)(nil), nil) |
|
|
cdc.RegisterConcrete(ed25519.PrivKeyEd25519{}, |
|
|
cdc.RegisterConcrete(ed25519.PrivKeyEd25519{}, |
|
|
"tendermint/PrivKeyEd25519", nil) |
|
|
|
|
|
|
|
|
ed25519.PrivKeyAminoRoute, nil) |
|
|
cdc.RegisterConcrete(secp256k1.PrivKeySecp256k1{}, |
|
|
cdc.RegisterConcrete(secp256k1.PrivKeySecp256k1{}, |
|
|
"tendermint/PrivKeySecp256k1", nil) |
|
|
|
|
|
|
|
|
secp256k1.PrivKeyAminoRoute, nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func PrivKeyFromBytes(privKeyBytes []byte) (privKey crypto.PrivKey, err error) { |
|
|
func PrivKeyFromBytes(privKeyBytes []byte) (privKey crypto.PrivKey, err error) { |
|
|