2020-05-20 13:10:49 -07:00
|
|
|
package multisig
|
|
|
|
|
|
|
|
import (
|
2020-07-28 05:53:35 -07:00
|
|
|
amino "github.com/tendermint/go-amino"
|
2020-05-20 13:10:49 -07:00
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/crypto"
|
|
|
|
"github.com/tendermint/tendermint/crypto/ed25519"
|
|
|
|
"github.com/tendermint/tendermint/crypto/secp256k1"
|
|
|
|
"github.com/tendermint/tendermint/crypto/sr25519"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TODO: Figure out API for others to either add their own pubkey types, or
|
2020-06-12 11:13:20 -07:00
|
|
|
// to make verify / marshal accept a Cdc.
|
2020-05-20 13:10:49 -07:00
|
|
|
const (
|
|
|
|
PubKeyAminoRoute = "tendermint/PubKeyMultisigThreshold"
|
|
|
|
)
|
|
|
|
|
2020-06-12 11:13:20 -07:00
|
|
|
var Cdc = amino.NewCodec()
|
2020-05-20 13:10:49 -07:00
|
|
|
|
|
|
|
func init() {
|
2020-06-12 11:13:20 -07:00
|
|
|
Cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
|
|
|
|
Cdc.RegisterConcrete(PubKeyMultisigThreshold{},
|
2020-05-20 13:10:49 -07:00
|
|
|
PubKeyAminoRoute, nil)
|
2020-06-12 11:13:20 -07:00
|
|
|
Cdc.RegisterConcrete(ed25519.PubKeyEd25519{},
|
2020-05-20 13:10:49 -07:00
|
|
|
ed25519.PubKeyAminoName, nil)
|
2020-06-12 11:13:20 -07:00
|
|
|
Cdc.RegisterConcrete(sr25519.PubKeySr25519{},
|
2020-05-20 13:10:49 -07:00
|
|
|
sr25519.PubKeyAminoName, nil)
|
2020-06-12 11:13:20 -07:00
|
|
|
Cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{},
|
2020-05-20 13:10:49 -07:00
|
|
|
secp256k1.PubKeyAminoName, nil)
|
|
|
|
}
|