Match network id to regtest
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
parent
da86c108e7
commit
e44cf950ce
7 changed files with 25 additions and 24 deletions
|
@ -112,7 +112,7 @@ static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits
|
||||||
class CMainParams : public CChainParams {
|
class CMainParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
CMainParams() {
|
CMainParams() {
|
||||||
strNetworkID = "lbrycrd";
|
strNetworkID = CBaseChainParams::MAIN;
|
||||||
consensus.nSubsidyLevelInterval = 1<<5;
|
consensus.nSubsidyLevelInterval = 1<<5;
|
||||||
consensus.nMajorityEnforceBlockUpgrade = 750;
|
consensus.nMajorityEnforceBlockUpgrade = 750;
|
||||||
consensus.nMajorityRejectBlockOutdated = 950;
|
consensus.nMajorityRejectBlockOutdated = 950;
|
||||||
|
@ -223,7 +223,7 @@ public:
|
||||||
class CTestNetParams : public CChainParams {
|
class CTestNetParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
CTestNetParams() {
|
CTestNetParams() {
|
||||||
strNetworkID = "lbrycrdtest";
|
strNetworkID = CBaseChainParams::TESTNET;
|
||||||
consensus.nSubsidyLevelInterval = 1 << 5;
|
consensus.nSubsidyLevelInterval = 1 << 5;
|
||||||
consensus.nMajorityEnforceBlockUpgrade = 51;
|
consensus.nMajorityEnforceBlockUpgrade = 51;
|
||||||
consensus.nMajorityRejectBlockOutdated = 75;
|
consensus.nMajorityRejectBlockOutdated = 75;
|
||||||
|
@ -325,7 +325,7 @@ public:
|
||||||
class CRegTestParams : public CChainParams {
|
class CRegTestParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
explicit CRegTestParams(const ArgsManager& args) {
|
explicit CRegTestParams(const ArgsManager& args) {
|
||||||
strNetworkID = "lbrycrdreg";
|
strNetworkID = CBaseChainParams::REGTEST;
|
||||||
consensus.nSubsidyLevelInterval = 1 << 5;
|
consensus.nSubsidyLevelInterval = 1 << 5;
|
||||||
consensus.BIP16Exception = uint256();
|
consensus.BIP16Exception = uint256();
|
||||||
consensus.BIP34Height = 1000; // BIP34 is needed for validation_block_tests
|
consensus.BIP34Height = 1000; // BIP34 is needed for validation_block_tests
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
const std::string CBaseChainParams::MAIN = "lbrycrd";
|
const std::string CBaseChainParams::MAIN = "lbrycrd";
|
||||||
const std::string CBaseChainParams::TESTNET = "lbrycrdtest";
|
const std::string CBaseChainParams::TESTNET = "lbrycrdtest";
|
||||||
const std::string CBaseChainParams::REGTEST = "regtest";
|
const std::string CBaseChainParams::REGTEST = "lbrycrdreg";
|
||||||
|
|
||||||
void SetupChainParamsBaseOptions()
|
void SetupChainParamsBaseOptions()
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,8 +18,8 @@ static const struct {
|
||||||
const int iconColorSaturationReduction;
|
const int iconColorSaturationReduction;
|
||||||
} network_styles[] = {
|
} network_styles[] = {
|
||||||
{"lbrycrd", QAPP_APP_NAME_DEFAULT, 0, 0},
|
{"lbrycrd", QAPP_APP_NAME_DEFAULT, 0, 0},
|
||||||
{"lbrycrdtest", QAPP_APP_NAME_TESTNET, 70, 30, QT_TRANSLATE_NOOP("SplashScreen")},
|
{"lbrycrdtest", QAPP_APP_NAME_TESTNET, 70, 30},
|
||||||
{"regtest", QAPP_APP_NAME_REGTEST, 160, 30}
|
{"lbrycrdreg", QAPP_APP_NAME_REGTEST, 160, 30}
|
||||||
};
|
};
|
||||||
static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles);
|
static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles);
|
||||||
|
|
||||||
|
|
|
@ -134,11 +134,11 @@ void PaymentServer::ipcParseCommandLine(interfaces::Node& node, int argc, char*
|
||||||
PaymentRequestPlus request;
|
PaymentRequestPlus request;
|
||||||
if (readPaymentRequestFromFile(arg, request))
|
if (readPaymentRequestFromFile(arg, request))
|
||||||
{
|
{
|
||||||
if (request.getDetails().network() == "lbrycrd")
|
if (request.getDetails().network() == CBaseChainParams::MAIN)
|
||||||
{
|
{
|
||||||
node.selectParams(CBaseChainParams::MAIN);
|
node.selectParams(CBaseChainParams::MAIN);
|
||||||
}
|
}
|
||||||
else if (request.getDetails().network() == "lbrycrdtest")
|
else if (request.getDetails().network() == CBaseChainParams::TESTNET)
|
||||||
{
|
{
|
||||||
node.selectParams(CBaseChainParams::TESTNET);
|
node.selectParams(CBaseChainParams::TESTNET);
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
||||||
if (strMode != "template")
|
if (strMode != "template")
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
||||||
|
|
||||||
if (Params().NetworkIDString() != "lbrycrdreg") // who should own this constant?
|
if (Params().NetworkIDString() != CBaseChainParams::REGTEST) // who should own this constant?
|
||||||
{
|
{
|
||||||
if (!g_connman)
|
if (!g_connman)
|
||||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"76a91453c0307d6851aa0ce7825ba883c6bd9ad242b48688ac",
|
"76a91453c0307d6851aa0ce7825ba883c6bd9ad242b48688ac",
|
||||||
{
|
{
|
||||||
"isPrivkey": false,
|
"isPrivkey": false,
|
||||||
"chain": "regtest"
|
"chain": "lbrycrdreg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
{
|
{
|
||||||
"isCompressed": false,
|
"isCompressed": false,
|
||||||
"isPrivkey": true,
|
"isPrivkey": true,
|
||||||
"chain": "regtest"
|
"chain": "lbrycrdreg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
{
|
{
|
||||||
"isCompressed": true,
|
"isCompressed": true,
|
||||||
"isPrivkey": true,
|
"isPrivkey": true,
|
||||||
"chain": "regtest"
|
"chain": "lbrycrdreg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -294,7 +294,7 @@
|
||||||
{
|
{
|
||||||
"isCompressed": false,
|
"isCompressed": false,
|
||||||
"isPrivkey": true,
|
"isPrivkey": true,
|
||||||
"chain": "regtest"
|
"chain": "lbrycrdreg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -481,7 +481,7 @@
|
||||||
"001428e40f9a66993a8d50b2604af71b17e1606842d8",
|
"001428e40f9a66993a8d50b2604af71b17e1606842d8",
|
||||||
{
|
{
|
||||||
"isPrivkey": false,
|
"isPrivkey": false,
|
||||||
"chain": "regtest",
|
"chain": "lbrycrdreg",
|
||||||
"tryCaseFlip": true
|
"tryCaseFlip": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
|
|
||||||
|
#include <chainparamsbase.h>
|
||||||
#include <clientversion.h>
|
#include <clientversion.h>
|
||||||
#include <sync.h>
|
#include <sync.h>
|
||||||
#include <test/setup_common.h>
|
#include <test/setup_common.h>
|
||||||
|
@ -562,27 +563,27 @@ BOOST_AUTO_TEST_CASE(util_GetChainName)
|
||||||
std::string error;
|
std::string error;
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrd");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::MAIN);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "regtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::REGTEST);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_test_no_reg, error));
|
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_test_no_reg, error));
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
||||||
BOOST_CHECK_THROW(test_args.GetChainName(), std::runtime_error);
|
BOOST_CHECK_THROW(test_args.GetChainName(), std::runtime_error);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
|
@ -590,7 +591,7 @@ BOOST_AUTO_TEST_CASE(util_GetChainName)
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_test_no_reg, error));
|
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_test_no_reg, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
|
@ -602,11 +603,11 @@ BOOST_AUTO_TEST_CASE(util_GetChainName)
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_testnet, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_regtest, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
|
@ -614,7 +615,7 @@ BOOST_AUTO_TEST_CASE(util_GetChainName)
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_test_no_reg, error));
|
BOOST_CHECK(test_args.ParseParameters(2, (char**)argv_test_no_reg, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
BOOST_CHECK_EQUAL(test_args.GetChainName(), "lbrycrdtest");
|
BOOST_CHECK_EQUAL(test_args.GetChainName(), CBaseChainParams::TESTNET);
|
||||||
|
|
||||||
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
BOOST_CHECK(test_args.ParseParameters(3, (char**)argv_both, error));
|
||||||
test_args.ReadConfigString(testnetconf);
|
test_args.ReadConfigString(testnetconf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue