mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
This is the first of a number of commits with the goal of moving the chain type definitions out of chainparamsbase to their own file and implementing them as enums instead of constant strings. The goal is to allow the kernel chainparams to no longer include chainparamsbase. The commit is part of an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager and other functionality that should not be part of the kernel library.
23 lines
526 B
C++
23 lines
526 B
C++
// Copyright (c) 2023 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_UTIL_CHAINTYPE_H
|
|
#define BITCOIN_UTIL_CHAINTYPE_H
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
enum class ChainType {
|
|
MAIN,
|
|
TESTNET,
|
|
SIGNET,
|
|
REGTEST,
|
|
};
|
|
|
|
std::string ChainTypeToString(ChainType chain);
|
|
|
|
std::optional<ChainType> ChainTypeFromString(std::string_view chain);
|
|
|
|
#endif // BITCOIN_UTIL_CHAINTYPE_H
|