Add type assertions for sig/pub/privkey implemenetations
This commit is contained in:
parent
f17e6bf44c
commit
9e57d521ef
|
@ -64,6 +64,8 @@ var privKeyMapper = data.NewMapper(PrivKey{}).
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ PrivKeyInner = PrivKeyEd25519{}
|
||||
|
||||
// Implements PrivKey
|
||||
type PrivKeyEd25519 [64]byte
|
||||
|
||||
|
@ -149,6 +151,8 @@ func GenPrivKeyEd25519FromSecret(secret []byte) PrivKeyEd25519 {
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ PrivKeyInner = PrivKeySecp256k1{}
|
||||
|
||||
// Implements PrivKey
|
||||
type PrivKeySecp256k1 [32]byte
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ var pubKeyMapper = data.NewMapper(PubKey{}).
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ PubKeyInner = PubKeyEd25519{}
|
||||
|
||||
// Implements PubKeyInner
|
||||
type PubKeyEd25519 [32]byte
|
||||
|
||||
|
@ -146,6 +148,8 @@ func (pubKey PubKeyEd25519) Wrap() PubKey {
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ PubKeyInner = PubKeySecp256k1{}
|
||||
|
||||
// Implements PubKey.
|
||||
// Compressed pubkey (just the x-cord),
|
||||
// prefixed with 0x02 or 0x03, depending on the y-cord.
|
||||
|
|
|
@ -62,6 +62,8 @@ var sigMapper = data.NewMapper(Signature{}).
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ SignatureInner = SignatureEd25519{}
|
||||
|
||||
// Implements Signature
|
||||
type SignatureEd25519 [64]byte
|
||||
|
||||
|
@ -100,6 +102,8 @@ func (sig SignatureEd25519) Wrap() Signature {
|
|||
|
||||
//-------------------------------------
|
||||
|
||||
var _ SignatureInner = SignatureSecp256k1{}
|
||||
|
||||
// Implements Signature
|
||||
type SignatureSecp256k1 []byte
|
||||
|
||||
|
|
Loading…
Reference in New Issue