Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Feb 14, 2025
1 parent a5ede9e commit 3bccdb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/Neo/Cryptography/Crypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,7 @@ public static ECC.ECPoint ECRecover(byte[] signature, byte[] hash)
ECC.ECCurve.Secp256k1.BouncyCastleCurve.G, eInvrInv,
decompressedRKey, srInv);

return ECC.ECPoint.FromBytes(q.Normalize().GetEncoded(false), ECC.ECCurve.Secp256k1);
}
catch (ArgumentException)
{
throw;
return ECPoint.FromBytes(q.Normalize().GetEncoded(false), ECC.ECCurve.Secp256k1);
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Neo/SmartContract/Native/CryptoLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static byte[] RecoverSecp256K1(byte[] messageHash, byte[] signature)
try
{
var point = Crypto.ECRecover(signature, messageHash);
return point?.EncodePoint(true);
return point.EncodePoint(true);
}
catch
{
Expand Down

0 comments on commit 3bccdb4

Please sign in to comment.