diff options
| author | MarcoFalke <[email protected]> | 2020-04-05 04:40:54 +0800 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-04-05 04:41:07 +0800 |
| commit | 4839560ee1c12d162605f8eade75e63c581d8688 (patch) | |
| tree | 1f10c5d5889f76df4fb84681d851f8dc8c6e73f6 /src/test/fuzz/util.h | |
| parent | Merge #18499: rpc: Make rpc documentation not depend on call-time rpc args (diff) | |
| parent | tests: Add proof-of-work fuzzing harness (diff) | |
| download | discoin-4839560ee1c12d162605f8eade75e63c581d8688.tar.xz discoin-4839560ee1c12d162605f8eade75e63c581d8688.zip | |
Merge #18407: tests: Add proof-of-work fuzzing harness
acf269e1463c84d51f2eef695089cbf9d03b547f tests: Add proof-of-work fuzzing harness (practicalswift)
Pull request description:
Add proof-of-work fuzzing harness.
Top commit has no ACKs.
Tree-SHA512: dcdfa211cf1ec3018b61f378bb0f95793bbbe5d00e2f4d17f9db2c7263fe8ce919760c56cae7122c62c82e05c90e7056eb1778871674bdb3c42869e5fe4c2b60
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 7004aff42..b70ea6d90 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> @@ -91,6 +92,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> NODISCARD bool MultiplicationOverflow(const T i, const T j) noexcept { |