some test fixes

This commit is contained in:
Łukasz Magiera
2020-02-21 20:28:01 +01:00
parent d6dffed203
commit 4e98f2e438
6 changed files with 28 additions and 20 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ import (
func Sign(sigType crypto.SigType, privkey []byte, msg []byte) (*crypto.Signature, error) {
sv, ok := sigs[sigType]
if !ok {
return nil, fmt.Errorf("cannot sign message with signature of unsupported type: %s", sigType)
return nil, fmt.Errorf("cannot sign message with signature of unsupported type: %v", sigType)
}
sb, err := sv.Sign(privkey, msg)
@@ -42,7 +42,7 @@ func Verify(sig *crypto.Signature, addr address.Address, msg []byte) error {
sv, ok := sigs[sig.Type]
if !ok {
return fmt.Errorf("cannot verify signature of unsupported type: %s", sig.Type)
return fmt.Errorf("cannot verify signature of unsupported type: %v", sig.Type)
}
return sv.Verify(sig.Data, addr, msg)
@@ -52,7 +52,7 @@ func Verify(sig *crypto.Signature, addr address.Address, msg []byte) error {
func Generate(sigType crypto.SigType) ([]byte, error) {
sv, ok := sigs[sigType]
if !ok {
return nil, fmt.Errorf("cannot generate private key of unsupported type: %s", sigType)
return nil, fmt.Errorf("cannot generate private key of unsupported type: %v", sigType)
}
return sv.GenPrivate()
@@ -62,7 +62,7 @@ func Generate(sigType crypto.SigType) ([]byte, error) {
func ToPublic(sigType crypto.SigType, pk []byte) ([]byte, error) {
sv, ok := sigs[sigType]
if !ok {
return nil, fmt.Errorf("cannot generate public key of unsupported type: %s", sigType)
return nil, fmt.Errorf("cannot generate public key of unsupported type: %v", sigType)
}
return sv.ToPublic(pk)