Skip to content

Commit 9a0b2a6

Browse files
committed
fuzz: increase FromHex() coverage
1 parent 526a87b commit 9a0b2a6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/fuzz/hex.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <uint256.h>
1111
#include <univalue.h>
1212
#include <util/strencodings.h>
13+
#include <util/transaction_identifier.h>
1314

1415
#include <cassert>
1516
#include <cstdint>
@@ -27,7 +28,11 @@ FUZZ_TARGET(hex)
2728
assert(ToLower(random_hex_string) == hex_data);
2829
}
2930
(void)IsHexNumber(random_hex_string);
30-
(void)uint256::FromHex(random_hex_string);
31+
if (uint256::FromHex(random_hex_string)) {
32+
assert(random_hex_string.length() == 64);
33+
assert(Txid::FromHex(random_hex_string));
34+
assert(Wtxid::FromHex(random_hex_string));
35+
}
3136
(void)uint256S(random_hex_string);
3237
try {
3338
(void)HexToPubKey(random_hex_string);

0 commit comments

Comments
 (0)