diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 358bcdb53..52b7fbfc5 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -112,7 +112,7 @@ static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits class CMainParams : public CChainParams { public: CMainParams() { - strNetworkID = "lbrycrd"; + strNetworkID = CBaseChainParams::MAIN; consensus.nSubsidyLevelInterval = 1<<5; consensus.nMajorityEnforceBlockUpgrade = 750; consensus.nMajorityRejectBlockOutdated = 950; @@ -223,7 +223,7 @@ public: class CTestNetParams : public CChainParams { public: CTestNetParams() { - strNetworkID = "lbrycrdtest"; + strNetworkID = CBaseChainParams::TESTNET; consensus.nSubsidyLevelInterval = 1 << 5; consensus.nMajorityEnforceBlockUpgrade = 51; consensus.nMajorityRejectBlockOutdated = 75; @@ -325,7 +325,7 @@ public: class CRegTestParams : public CChainParams { public: explicit CRegTestParams(const ArgsManager& args) { - strNetworkID = "lbrycrdreg"; + strNetworkID = CBaseChainParams::REGTEST; consensus.nSubsidyLevelInterval = 1 << 5; consensus.BIP16Exception = uint256(); consensus.BIP34Height = 1000; // BIP34 is needed for validation_block_tests diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index b013bfd5e..be1edac34 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -13,7 +13,7 @@ const std::string CBaseChainParams::MAIN = "lbrycrd"; const std::string CBaseChainParams::TESTNET = "lbrycrdtest"; -const std::string CBaseChainParams::REGTEST = "regtest"; +const std::string CBaseChainParams::REGTEST = "lbrycrdreg"; void SetupChainParamsBaseOptions() { diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index fb063565b..e116b5d8a 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -18,8 +18,8 @@ static const struct { const int iconColorSaturationReduction; } network_styles[] = { {"lbrycrd", QAPP_APP_NAME_DEFAULT, 0, 0}, - {"lbrycrdtest", QAPP_APP_NAME_TESTNET, 70, 30, QT_TRANSLATE_NOOP("SplashScreen")}, - {"regtest", QAPP_APP_NAME_REGTEST, 160, 30} + {"lbrycrdtest", QAPP_APP_NAME_TESTNET, 70, 30}, + {"lbrycrdreg", QAPP_APP_NAME_REGTEST, 160, 30} }; static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index e66edb31b..fc56898d1 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -134,11 +134,11 @@ void PaymentServer::ipcParseCommandLine(interfaces::Node& node, int argc, char* PaymentRequestPlus request; if (readPaymentRequestFromFile(arg, request)) { - if (request.getDetails().network() == "lbrycrd") + if (request.getDetails().network() == CBaseChainParams::MAIN) { node.selectParams(CBaseChainParams::MAIN); } - else if (request.getDetails().network() == "lbrycrdtest") + else if (request.getDetails().network() == CBaseChainParams::TESTNET) { node.selectParams(CBaseChainParams::TESTNET); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index a5228bc3b..2e508ea88 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -443,7 +443,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) if (strMode != "template") 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) throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); diff --git a/src/test/data/key_io_valid.json b/src/test/data/key_io_valid.json index e5a1193f0..85f6c970d 100644 --- a/src/test/data/key_io_valid.json +++ b/src/test/data/key_io_valid.json @@ -28,7 +28,7 @@ "76a91453c0307d6851aa0ce7825ba883c6bd9ad242b48688ac", { "isPrivkey": false, - "chain": "regtest" + "chain": "lbrycrdreg" } ], [ @@ -72,7 +72,7 @@ { "isCompressed": false, "isPrivkey": true, - "chain": "regtest" + "chain": "lbrycrdreg" } ], [ @@ -90,7 +90,7 @@ { "isCompressed": true, "isPrivkey": true, - "chain": "regtest" + "chain": "lbrycrdreg" } ], [ @@ -294,7 +294,7 @@ { "isCompressed": false, "isPrivkey": true, - "chain": "regtest" + "chain": "lbrycrdreg" } ], [ @@ -481,7 +481,7 @@ "001428e40f9a66993a8d50b2604af71b17e1606842d8", { "isPrivkey": false, - "chain": "regtest", + "chain": "lbrycrdreg", "tryCaseFlip": true } ] diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 300f00e86..74a8dd21d 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -4,6 +4,7 @@ #include +#include #include #include #include @@ -562,27 +563,27 @@ BOOST_AUTO_TEST_CASE(util_GetChainName) std::string 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_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_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_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_THROW(test_args.GetChainName(), std::runtime_error); BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error)); 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)); 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)); 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)); 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)); test_args.ReadConfigString(testnetconf); @@ -602,11 +603,11 @@ BOOST_AUTO_TEST_CASE(util_GetChainName) BOOST_CHECK(test_args.ParseParameters(0, (char**)argv_testnet, error)); 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)); 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)); 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)); 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)); test_args.ReadConfigString(testnetconf);