Fix wrong error handling for TestRecoverPubKey()
@@ -60,12 +60,7 @@ func TestRecoverPublicKey(t *testing.T) {
sig.bytes[0] = sig.bytes[0] ^ 0x0f
pub2, err := sig.RecoverPublicKey(testHash)
- if err != nil {
- t.Errorf("error recover public key:%s", err)
- return
- }
-
- if pub.Equal(pub2) {
+ if err == nil && pub.Equal(pub2) {
t.Errorf("Public key recovery always works!")
}
}
