aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/hex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/fuzz/hex.cpp')
-rw-r--r--src/test/fuzz/hex.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/fuzz/hex.cpp b/src/test/fuzz/hex.cpp
index 964e30cc7e..3dcf1ed3d5 100644
--- a/src/test/fuzz/hex.cpp
+++ b/src/test/fuzz/hex.cpp
@@ -35,9 +35,14 @@ FUZZ_TARGET(hex)
assert(uint256::FromUserHex(random_hex_string));
}
if (const auto result{uint256::FromUserHex(random_hex_string)}) {
- assert(uint256::FromHex(result->ToString()));
+ const auto result_string{result->ToString()}; // ToString() returns a fixed-length string without "0x" prefix
+ assert(result_string.length() == 64);
+ assert(IsHex(result_string));
+ assert(TryParseHex(result_string));
+ assert(Txid::FromHex(result_string));
+ assert(Wtxid::FromHex(result_string));
+ assert(uint256::FromHex(result_string));
}
- (void)uint256S(random_hex_string);
try {
(void)HexToPubKey(random_hex_string);
} catch (const UniValue&) {