mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Switch from Optional<T> to std::optional<T> (C++17). Run clang-format.
This commit is contained in:
parent
fb559c1170
commit
cd34038cbd
25 changed files with 111 additions and 87 deletions
|
|
@ -2,20 +2,20 @@
|
|||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <optional.h>
|
||||
#include <protocol.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
void test_one_input(const std::vector<uint8_t>& buffer)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const Optional<CInv> inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
|
||||
const std::optional<CInv> inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
|
||||
if (!inv) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
} catch (const std::out_of_range&) {
|
||||
}
|
||||
(void)inv->ToString();
|
||||
const Optional<CInv> another_inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
|
||||
const std::optional<CInv> another_inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
|
||||
if (!another_inv) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue