Add type assertions for sig/pub/privkey implemenetations

This commit is contained in:
Ethan Frey 2017-04-10 13:05:52 +02:00
parent f17e6bf44c
commit 9e57d521ef
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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.

View File

@ -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