mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-28 16:36:04 +01:00
Decouple RegTestChainParams from ArgsManager
RegTest chain params can now be initialized by configuring a RegTestOptions struct, or with ArgsManager. This offers an interface for creating RegTestChainParams without a gArgs object.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <consensus/params.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {
|
||||
{
|
||||
/*.name =*/ "testdummy",
|
||||
@@ -34,3 +36,19 @@ std::string DeploymentName(Consensus::BuriedDeployment dep)
|
||||
} // no default case, so the compiler can warn about missing cases
|
||||
return "";
|
||||
}
|
||||
|
||||
std::optional<Consensus::BuriedDeployment> GetBuriedDeployment(const std::string_view name)
|
||||
{
|
||||
if (name == "segwit") {
|
||||
return Consensus::BuriedDeployment::DEPLOYMENT_SEGWIT;
|
||||
} else if (name == "bip34") {
|
||||
return Consensus::BuriedDeployment::DEPLOYMENT_HEIGHTINCB;
|
||||
} else if (name == "dersig") {
|
||||
return Consensus::BuriedDeployment::DEPLOYMENT_DERSIG;
|
||||
} else if (name == "cltv") {
|
||||
return Consensus::BuriedDeployment::DEPLOYMENT_CLTV;
|
||||
} else if (name == "csv") {
|
||||
return Consensus::BuriedDeployment::DEPLOYMENT_CSV;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user