diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 3a90fb3c46c..f9e4acbb708 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -130,7 +130,7 @@ class CMainParams : public CChainParams { consensus.FortCanningParkHeight = 1503143; consensus.FortCanningHillHeight = 1604999; // Feb 7, 2022. consensus.FortCanningRoadHeight = 1786000; // April 11, 2022. - consensus.FortCanningGreenHeight = std::numeric_limits<int>::max(); + consensus.GreatWorldHeight = std::numeric_limits<int>::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -359,7 +359,7 @@ class CTestNetParams : public CChainParams { consensus.FortCanningParkHeight = 828800; consensus.FortCanningHillHeight = 828900; consensus.FortCanningRoadHeight = 893700; - consensus.FortCanningGreenHeight = std::numeric_limits<int>::max(); + consensus.GreatWorldHeight = std::numeric_limits<int>::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -549,7 +549,7 @@ class CDevNetParams : public CChainParams { consensus.FortCanningParkHeight = std::numeric_limits<int>::max(); consensus.FortCanningHillHeight = std::numeric_limits<int>::max(); consensus.FortCanningRoadHeight = std::numeric_limits<int>::max(); - consensus.FortCanningGreenHeight = std::numeric_limits<int>::max(); + consensus.GreatWorldHeight = std::numeric_limits<int>::max(); consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks @@ -731,7 +731,7 @@ class CRegTestParams : public CChainParams { consensus.FortCanningParkHeight = 10000000; consensus.FortCanningHillHeight = 10000000; consensus.FortCanningRoadHeight = 10000000; - consensus.FortCanningGreenHeight = 10000000; + consensus.GreatWorldHeight = 10000000; consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.pos.nTargetTimespan = 14 * 24 * 60 * 60; // two weeks @@ -952,7 +952,7 @@ void CRegTestParams::UpdateActivationParametersFromArgs() UpdateHeightValidation("Fort Canning Park", "-fortcanningparkheight", consensus.FortCanningParkHeight); UpdateHeightValidation("Fort Canning Hill", "-fortcanninghillheight", consensus.FortCanningHillHeight); UpdateHeightValidation("Fort Canning Road", "-fortcanningroadheight", consensus.FortCanningRoadHeight); - UpdateHeightValidation("Fort Canning Green", "-fortcanninggreenheight", consensus.FortCanningGreenHeight); + UpdateHeightValidation("Fort Canning Green", "-greatworldheight", consensus.GreatWorldHeight); if (gArgs.GetBoolArg("-simulatemainnet", false)) { consensus.pos.nTargetTimespan = 5 * 60; // 5 min == 10 blocks diff --git a/src/consensus/params.h b/src/consensus/params.h index 1523986b727..7c919d1bec4 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -95,7 +95,7 @@ struct Params { int FortCanningParkHeight; int FortCanningHillHeight; int FortCanningRoadHeight; - int FortCanningGreenHeight; + int GreatWorldHeight; /** Foundation share after AMK, normalized to COIN = 100% */ CAmount foundationShareDFIP1; diff --git a/src/init.cpp b/src/init.cpp index 843ec06f757..40a499f4532 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -476,7 +476,7 @@ void SetupServerArgs() gArgs.AddArg("-fortcanningparkheight", "Fort Canning Park fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-fortcanninghillheight", "Fort Canning Hill fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-fortcanningroadheight", "Fort Canning Road fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); - gArgs.AddArg("-fortcanninggreenheight", "Fort Canning Green fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); + gArgs.AddArg("-greatworldheight", "Fort Canning Green fork activation height (regtest only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-jellyfish_regtest", "Configure the regtest network for jellyfish testing", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS); gArgs.AddArg("-simulatemainnet", "Configure the regtest network to mainnet target timespan and spacing ", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS); #ifdef USE_UPNP diff --git a/src/masternodes/govvariables/attributes.cpp b/src/masternodes/govvariables/attributes.cpp index 2ff0fe9c46c..d33fd3b207e 100644 --- a/src/masternodes/govvariables/attributes.cpp +++ b/src/masternodes/govvariables/attributes.cpp @@ -748,8 +748,8 @@ Res ATTRIBUTES::Validate(const CCustomCSView & view) const case TokenKeys::LoanCollateralFactor: case TokenKeys::LoanMintingEnabled: case TokenKeys::LoanMintingInterest: { - if (view.GetLastHeight() < Params().GetConsensus().FortCanningGreenHeight) { - return Res::Err("Cannot be set before FortCanningGreen"); + if (view.GetLastHeight() < Params().GetConsensus().GreatWorldHeight) { + return Res::Err("Cannot be set before GreatWorld"); } if (!VerifyToken(view, attrV0->typeId)) { return Res::Err("No such token (%d)", attrV0->typeId); @@ -762,8 +762,8 @@ Res ATTRIBUTES::Validate(const CCustomCSView & view) const break; } case TokenKeys::FixedIntervalPriceId: - if (view.GetLastHeight() < Params().GetConsensus().FortCanningGreenHeight) { - return Res::Err("Cannot be set before FortCanningGreen"); + if (view.GetLastHeight() < Params().GetConsensus().GreatWorldHeight) { + return Res::Err("Cannot be set before GreatWorld"); } if (!VerifyToken(view, attrV0->typeId)) { return Res::Err("No such token (%d)", attrV0->typeId); @@ -787,8 +787,8 @@ Res ATTRIBUTES::Validate(const CCustomCSView & view) const break; case AttributeTypes::Oracles: - if (view.GetLastHeight() < Params().GetConsensus().FortCanningGreenHeight) { - return Res::Err("Cannot be set before FortCanningGreen"); + if (view.GetLastHeight() < Params().GetConsensus().GreatWorldHeight) { + return Res::Err("Cannot be set before GreatWorld"); } if (attrV0->typeId == OracleIDs::Splits) { const auto splitMap = boost::get<OracleSplits>(&attribute.second); @@ -846,8 +846,8 @@ Res ATTRIBUTES::Validate(const CCustomCSView & view) const break; case AttributeTypes::Locks: - if (view.GetLastHeight() < Params().GetConsensus().FortCanningGreenHeight) { - return Res::Err("Cannot be set before FortCanningGreen"); + if (view.GetLastHeight() < Params().GetConsensus().GreatWorldHeight) { + return Res::Err("Cannot be set before GreatWorld"); } if (attrV0->typeId != ParamIDs::TokenID) { return Res::Err("Unrecognised locks id"); diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 522eab8b754..3d1109b64b5 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -249,9 +249,9 @@ class CCustomMetadataParseVisitor : public boost::static_visitor<Res> return Res::Ok(); } - Res isPostFortCanningGreenFork() const { - if(static_cast<int>(height) < consensus.FortCanningGreenHeight) { - return Res::Err("called before FortCanningGreenHeight height"); + Res isPostGreatWorldFork() const { + if(static_cast<int>(height) < consensus.GreatWorldHeight) { + return Res::Err("called before GreatWorldHeight height"); } return Res::Ok(); } @@ -522,24 +522,24 @@ class CCustomMetadataParseVisitor : public boost::static_visitor<Res> auto res = isPostFortCanningFork(); if (!res) return res; - res = isPostFortCanningGreenFork(); - return res ? Res::Err("called after FortCanningGreen height") : serialize(obj); + res = isPostGreatWorldFork(); + return res ? Res::Err("called after GreatWorld height") : serialize(obj); } Res operator()(CLoanSetLoanTokenMessage& obj) const { auto res = isPostFortCanningFork(); if (!res) return res; - res = isPostFortCanningGreenFork(); - return res ? Res::Err("called after FortCanningGreen height") : serialize(obj); + res = isPostGreatWorldFork(); + return res ? Res::Err("called after GreatWorld height") : serialize(obj); } Res operator()(CLoanUpdateLoanTokenMessage& obj) const { auto res = isPostFortCanningFork(); if (!res) return res; - res = isPostFortCanningGreenFork(); - return res ? Res::Err("called after FortCanningGreen height") : serialize(obj); + res = isPostGreatWorldFork(); + return res ? Res::Err("called after GreatWorld height") : serialize(obj); } Res operator()(CLoanSchemeMessage& obj) const { diff --git a/src/masternodes/tokens.cpp b/src/masternodes/tokens.cpp index 20c636c0ae5..1c1625e12f6 100644 --- a/src/masternodes/tokens.cpp +++ b/src/masternodes/tokens.cpp @@ -299,7 +299,7 @@ inline Res CTokenImplementation::IsValidSymbol() const if (symbol.find('#') != std::string::npos) { return Res::Err("token symbol should not contain '#'"); } - if (creationHeight >= Params().GetConsensus().FortCanningGreenHeight && symbol.find('/') != std::string::npos) { + if (creationHeight >= Params().GetConsensus().GreatWorldHeight && symbol.find('/') != std::string::npos) { return Res::Err("token symbol should not contain '/'"); } return Res::Ok(); diff --git a/src/miner.cpp b/src/miner.cpp index 652623c627c..c6edebe07b3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -213,7 +213,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc } // TXs for the creationTx field in new tokens created via token split - if (nHeight >= chainparams.GetConsensus().FortCanningGreenHeight) { + if (nHeight >= chainparams.GetConsensus().GreatWorldHeight) { const auto attributes = pcustomcsview->GetAttributes(); if (attributes) { CDataStructureV0 splitKey{AttributeTypes::Oracles, OracleIDs::Splits, static_cast<uint32_t>(nHeight)}; diff --git a/src/validation.cpp b/src/validation.cpp index b995fd7e1a1..d1180744cb3 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3534,7 +3534,7 @@ void CChainState::ProcessTokenToGovVar(const CBlockIndex* pindex, CCustomCSView& // Migrate at +1 height so that GetLastHeight() in Gov var // Validate() has a height equal to the GW fork. - if (pindex->nHeight != chainparams.GetConsensus().FortCanningGreenHeight + 1) { + if (pindex->nHeight != chainparams.GetConsensus().GreatWorldHeight + 1) { return; } @@ -4001,7 +4001,7 @@ static Res VaultSplits(CCustomCSView& view, ATTRIBUTES& attributes, const DCT_ID } void CChainState::ProcessTokenSplits(const CBlock& block, const CBlockIndex* pindex, CCustomCSView& cache, const CChainParams& chainparams) { - if (pindex->nHeight < chainparams.GetConsensus().FortCanningGreenHeight) { + if (pindex->nHeight < chainparams.GetConsensus().GreatWorldHeight) { return; } const auto attributes = cache.GetAttributes(); @@ -5427,7 +5427,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P if (block.vtx[i]->IsCoinBase() && !IsAnchorRewardTx(*block.vtx[i], dummy, height >= consensusParams.FortCanningHeight) && !IsAnchorRewardTxPlus(*block.vtx[i], dummy, height >= consensusParams.FortCanningHeight) && - !IsTokenSplitTx(*block.vtx[i], dummy, height >= consensusParams.FortCanningGreenHeight)) + !IsTokenSplitTx(*block.vtx[i], dummy, height >= consensusParams.GreatWorldHeight)) return state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-cb-multiple", "more than one coinbase"); } } diff --git a/test/functional/feature_loan_vault.py b/test/functional/feature_loan_vault.py index 86ba4c0c2e2..67b49f36336 100755 --- a/test/functional/feature_loan_vault.py +++ b/test/functional/feature_loan_vault.py @@ -18,8 +18,8 @@ def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True self.extra_args = [ - ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1', '-fortcanninghillheight=300', '-fortcanninggreenheight=1700', '-jellyfish_regtest=1', '-simulatemainnet'], - ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1', '-fortcanninghillheight=300', '-fortcanninggreenheight=1700', '-jellyfish_regtest=1', '-simulatemainnet'] + ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1', '-fortcanninghillheight=300', '-greatworldheight=1700', '-jellyfish_regtest=1', '-simulatemainnet'], + ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1', '-fortcanninghillheight=300', '-greatworldheight=1700', '-jellyfish_regtest=1', '-simulatemainnet'] ] self.vaults = [] self.owner_addresses = [] @@ -750,19 +750,19 @@ def loan_and_collateral_token_to_govvar(self): self.move_to_gw_fork() # Try and call disabled RPC calls - assert_raises_rpc_error(-32600, 'called after FortCanningGreen height', self.nodes[0].setloantoken, { + assert_raises_rpc_error(-32600, 'called after GreatWorld height', self.nodes[0].setloantoken, { 'symbol': "DUSD", 'name': "DUSD stable token", 'fixedIntervalPriceId': "DUSD/USD", 'mintable': True, 'interest': 1}) - assert_raises_rpc_error(-32600, 'called after FortCanningGreen height', self.nodes[0].updateloantoken, "DUSD", { + assert_raises_rpc_error(-32600, 'called after GreatWorld height', self.nodes[0].updateloantoken, "DUSD", { 'symbol': "DUSD", 'name': "DUSD stable token", 'fixedIntervalPriceId': "DUSD/USD", 'mintable': True, 'interest': 1}) - assert_raises_rpc_error(-32600, 'called after FortCanningGreen height', self.nodes[0].setcollateraltoken, { + assert_raises_rpc_error(-32600, 'called after GreatWorld height', self.nodes[0].setcollateraltoken, { 'token': self.idDFI, 'factor': 1, 'fixedIntervalPriceId': "DFI/USD"}) diff --git a/test/functional/feature_setgov.py b/test/functional/feature_setgov.py index 979a96e5fcc..5c88efae778 100755 --- a/test/functional/feature_setgov.py +++ b/test/functional/feature_setgov.py @@ -21,8 +21,8 @@ def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True self.extra_args = [ - ['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=200', '-fortcanningheight=400', '-fortcanninghillheight=1110', '-fortcanningroadheight=1150', '-fortcanninggreenheight=1200', '-subsidytest=1'], - ['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=200', '-fortcanningheight=400', '-fortcanninghillheight=1110', '-fortcanningroadheight=1150', '-fortcanninggreenheight=1200', '-subsidytest=1']] + ['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=200', '-fortcanningheight=400', '-fortcanninghillheight=1110', '-fortcanningroadheight=1150', '-greatworldheight=1200', '-subsidytest=1'], + ['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=200', '-fortcanningheight=400', '-fortcanninghillheight=1110', '-fortcanningroadheight=1150', '-greatworldheight=1200', '-subsidytest=1']] def run_test(self): @@ -591,15 +591,15 @@ def run_test(self): assert_equal(result['v0/token/5/dfip2203'], 'true') # Check errors - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/locks/token/5':'true'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/oracles/splits/4000': '1/50'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/fixed_interval_price_id':'TSLA/USD'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_collateral_enabled':'true'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_collateral_factor':'1.00000000'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_minting_enabled':'true'}}) - assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before FortCanningGreen", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_minting_interest':'5.00000000'}}) - - # Move to FCG fork + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/locks/token/5':'true'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/oracles/splits/4000': '1/50'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/fixed_interval_price_id':'TSLA/USD'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_collateral_enabled':'true'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_collateral_factor':'1.00000000'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_minting_enabled':'true'}}) + assert_raises_rpc_error(-32600, "ATTRIBUTES: Cannot be set before GreatWorld", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/token/5/loan_minting_interest':'5.00000000'}}) + + # Move to GW fork self.nodes[0].generate(1200 - self.nodes[0].getblockcount()) # Check errors diff --git a/test/functional/feature_token_lock.py b/test/functional/feature_token_lock.py index aa7c7dffa73..a324abdddb0 100644 --- a/test/functional/feature_token_lock.py +++ b/test/functional/feature_token_lock.py @@ -15,7 +15,7 @@ class TokenLockTest(DefiTestFramework): def set_test_params(self): self.num_nodes = 1 self.setup_clean_chain = True - self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-fortcanninggreenheight=200', '-subsidytest=1']] + self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-greatworldheight=200', '-subsidytest=1']] def run_test(self): self.nodes[0].generate(150) diff --git a/test/functional/feature_token_split.py b/test/functional/feature_token_split.py index 206f1431e3d..84c26c177c0 100644 --- a/test/functional/feature_token_split.py +++ b/test/functional/feature_token_split.py @@ -20,7 +20,7 @@ def set_test_params(self): self.num_nodes = 1 self.setup_clean_chain = True self.extra_args = [ - ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanningmuseumheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-fortcanninggreenheight=150', '-subsidytest=1']] + ['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanningmuseumheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-greatworldheight=150', '-subsidytest=1']] def run_test(self): self.setup_test_tokens() @@ -329,7 +329,7 @@ def check_pool_split(self, pool_id, pool_symbol, token_id, token_symbol, token_s def token_split(self): - # Move to FCG + # Move to GW self.nodes[0].generate(151 - self.nodes[0].getblockcount()) # Make sure we cannot make a token with '/' in its symbol diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 1326a0c322c..1b316d0aeb8 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -136,7 +136,7 @@ def _test_getblockchaininfo(self): 'fortcanningpark': {'type': 'buried', 'active': False, 'height': 10000000}, 'fortcanninghill': {'type': 'buried', 'active': False, 'height': 10000000}, 'fortcanningroad': {'type': 'buried', 'active': False, 'height': 10000000}, - 'fortcanninggreen': {'type': 'buried', 'active': False, 'height': 10000000}, + 'greatworld': {'type': 'buried', 'active': False, 'height': 10000000}, 'testdummy': { 'type': 'bip9', 'bip9': {