From 9a0b2a69c4d836d7382f6fe7703de40288fc7421 Mon Sep 17 00:00:00 2001 From: stickies-v Date: Mon, 29 Jul 2024 17:35:01 +0100 Subject: [PATCH] fuzz: increase FromHex() coverage --- src/test/fuzz/hex.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/hex.cpp b/src/test/fuzz/hex.cpp index bc46863f1df..ebe30c3c1aa 100644 --- a/src/test/fuzz/hex.cpp +++ b/src/test/fuzz/hex.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -27,7 +28,11 @@ FUZZ_TARGET(hex) assert(ToLower(random_hex_string) == hex_data); } (void)IsHexNumber(random_hex_string); - (void)uint256::FromHex(random_hex_string); + if (uint256::FromHex(random_hex_string)) { + assert(random_hex_string.length() == 64); + assert(Txid::FromHex(random_hex_string)); + assert(Wtxid::FromHex(random_hex_string)); + } (void)uint256S(random_hex_string); try { (void)HexToPubKey(random_hex_string);