make ParseOutputType return a std::optional<OutputType>

This commit is contained in:
fanquake
2021-08-04 13:38:36 +08:00
parent 3308c61091
commit 32fa49a184
7 changed files with 40 additions and 36 deletions

View File

@@ -11,6 +11,7 @@
#include <script/standard.h>
#include <array>
#include <optional>
#include <string>
#include <vector>
@@ -28,7 +29,7 @@ static constexpr auto OUTPUT_TYPES = std::array{
OutputType::BECH32M,
};
[[nodiscard]] bool ParseOutputType(const std::string& str, OutputType& output_type);
std::optional<OutputType> ParseOutputType(const std::string& str);
const std::string& FormatOutputType(OutputType type);
/**