diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-03-22 14:16:40 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-04-04 17:23:50 +0000 |
commit | acf269e1463c84d51f2eef695089cbf9d03b547f (patch) | |
tree | 71f0ff27e60867bfbd37d4c476975f4fc75a3cb9 /src/test/fuzz/util.h | |
parent | 244e88e6b580f94434d16b2cea2e5690db24f0d4 (diff) | |
download | bitcoin-acf269e1463c84d51f2eef695089cbf9d03b547f.tar.xz |
tests: Add proof-of-work fuzzing harness
Diffstat (limited to 'src/test/fuzz/util.h')
-rw-r--r-- | src/test/fuzz/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index 10be2ebaf7..6b22601d29 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -6,6 +6,7 @@ #define BITCOIN_TEST_FUZZ_UTIL_H #include <amount.h> +#include <arith_uint256.h> #include <attributes.h> #include <optional.h> #include <script/script.h> @@ -80,6 +81,11 @@ NODISCARD inline uint256 ConsumeUInt256(FuzzedDataProvider& fuzzed_data_provider return uint256{v256}; } +NODISCARD inline arith_uint256 ConsumeArithUInt256(FuzzedDataProvider& fuzzed_data_provider) noexcept +{ + return UintToArith256(ConsumeUInt256(fuzzed_data_provider)); +} + template <typename T> bool MultiplicationOverflow(T i, T j) { |