From 3bccdb415f59451088a76c211d05f3a45ca0d4c1 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Fri, 14 Feb 2025 13:32:20 +0100 Subject: [PATCH] Clean code --- src/Neo/Cryptography/Crypto.cs | 6 +----- src/Neo/SmartContract/Native/CryptoLib.cs | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Neo/Cryptography/Crypto.cs b/src/Neo/Cryptography/Crypto.cs index 5ee4d05a20..18c400c828 100644 --- a/src/Neo/Cryptography/Crypto.cs +++ b/src/Neo/Cryptography/Crypto.cs @@ -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) { diff --git a/src/Neo/SmartContract/Native/CryptoLib.cs b/src/Neo/SmartContract/Native/CryptoLib.cs index 89e0149e08..fef9231552 100644 --- a/src/Neo/SmartContract/Native/CryptoLib.cs +++ b/src/Neo/SmartContract/Native/CryptoLib.cs @@ -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 {