fuzz: increase FromHex() coverage

pull/30532/head
stickies-v 3 months ago
parent 526a87ba6b
commit 9a0b2a69c4
No known key found for this signature in database
GPG Key ID: 5CB1CE6E5E66A757

@ -10,6 +10,7 @@
#include <uint256.h>
#include <univalue.h>
#include <util/strencodings.h>
#include <util/transaction_identifier.h>
#include <cassert>
#include <cstdint>
@ -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);

Loading…
Cancel
Save