mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
refactor: add uint256::FromUserHex helper
FromUserHex will be used in future commits to construct uint256 instances from user hex input without being unnecessarily restrictive on formatting by allowing 0x-prefixed input that is shorter than 64 characters.
This commit is contained in:
@@ -32,6 +32,10 @@ FUZZ_TARGET(hex)
|
||||
assert(random_hex_string.length() == 64);
|
||||
assert(Txid::FromHex(random_hex_string));
|
||||
assert(Wtxid::FromHex(random_hex_string));
|
||||
assert(uint256::FromUserHex(random_hex_string));
|
||||
}
|
||||
if (const auto result{uint256::FromUserHex(random_hex_string)}) {
|
||||
assert(uint256::FromHex(result->ToString()));
|
||||
}
|
||||
(void)uint256S(random_hex_string);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user