aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util.h
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-05-10 18:35:55 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-05-14 18:52:57 +0000
commitcd34038cbda4864e4770734c44b18d3e01aa2a28 (patch)
treed08835aeb6ee0f4b11a4c827eb2150957d63dd37 /src/test/fuzz/util.h
parentfb559c1170773360afb9d05daaccd57d18636ee9 (diff)
Switch from Optional<T> to std::optional<T> (C++17). Run clang-format.
Diffstat (limited to 'src/test/fuzz/util.h')
-rw-r--r--src/test/fuzz/util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h
index 501bb1de5a..f72d9380eb 100644
--- a/src/test/fuzz/util.h
+++ b/src/test/fuzz/util.h
@@ -9,7 +9,6 @@
#include <arith_uint256.h>
#include <attributes.h>
#include <consensus/consensus.h>
-#include <optional.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <serialize.h>
@@ -21,6 +20,7 @@
#include <version.h>
#include <cstdint>
+#include <optional>
#include <string>
#include <vector>
@@ -52,7 +52,7 @@ NODISCARD inline std::vector<T> ConsumeRandomLengthIntegralVector(FuzzedDataProv
}
template <typename T>
-NODISCARD inline Optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_data_provider, const size_t max_length = 4096) noexcept
+NODISCARD inline std::optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_data_provider, const size_t max_length = 4096) noexcept
{
const std::vector<uint8_t> buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
CDataStream ds{buffer, SER_NETWORK, INIT_PROTO_VERSION};
@@ -60,7 +60,7 @@ NODISCARD inline Optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_da
try {
ds >> obj;
} catch (const std::ios_base::failure&) {
- return nullopt;
+ return std::nullopt;
}
return obj;
}