From 0add6bc82390834ade99a63dd9bfefe5ad76c1f1 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Fri, 13 Sep 2024 15:06:23 +0700 Subject: [PATCH] feat: removed 2 checkpoints: TestChainDIP3Setup and TestChainV19Setup from unit tests It takes time to update each checkpoint if any forks changes in unit tests: new height, new bit, and extra params. Reduced scope of changes for future updates --- src/test/evo_deterministicmns_tests.cpp | 22 +++++++++++++++------- src/test/util/setup_common.cpp | 4 ---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/test/evo_deterministicmns_tests.cpp b/src/test/evo_deterministicmns_tests.cpp index 9aed314cbf..71c89ff481 100644 --- a/src/test/evo_deterministicmns_tests.cpp +++ b/src/test/evo_deterministicmns_tests.cpp @@ -814,25 +814,33 @@ void FuncVerifyDB(TestChainSetup& setup) BOOST_AUTO_TEST_SUITE(evo_dip3_activation_tests) -struct TestChainDIP3Setup : public TestChainSetup -{ - TestChainDIP3Setup() : TestChainSetup(431) {} -}; - struct TestChainDIP3BeforeActivationSetup : public TestChainSetup { TestChainDIP3BeforeActivationSetup() : TestChainSetup(430) {} }; +struct TestChainDIP3Setup : public TestChainDIP3BeforeActivationSetup +{ + TestChainDIP3Setup() + { + // Activate DIP3 here + CreateAndProcessBlock({}, coinbaseKey); + } +}; + struct TestChainV19BeforeActivationSetup : public TestChainSetup { TestChainV19BeforeActivationSetup(); }; -struct TestChainV19Setup : public TestChainSetup +struct TestChainV19Setup : public TestChainV19BeforeActivationSetup { - TestChainV19Setup() : TestChainSetup(899) + TestChainV19Setup() { + // Activate V19 + for (int i = 0; i < 5; ++i) { + CreateAndProcessBlock({}, coinbaseKey); + } bool v19_just_activated{DeploymentActiveAfter(m_node.chainman->ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19) && !DeploymentActiveAt(*m_node.chainman->ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)}; assert(v19_just_activated); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 7356641e53..74770c301f 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -358,14 +358,10 @@ TestChainSetup::TestChainSetup(int num_blocks, const std::vector& e { 100, uint256S("0x6ffb83129c19ebdf1ae3771be6a67fe34b35f4c956326b9ba152fac1649f65ae") }, /* TestChainDIP3BeforeActivationSetup */ { 430, uint256S("0x0bcefaa33fec56cd84d05d0e76cd6a78badcc20f627d91903646de6a07930a14") }, - /* TestChainDIP3Setup */ - { 431, uint256S("0x5fd3aa5ef29464839499d7f847edd9362e3e73392b79d3bd88b1591f5fb17d4e") }, /* TestChainBRRBeforeActivationSetup */ { 497, uint256S("0x23c31820ec5160b7181bfdf328e2b76cd12c9fa4544d892b7f01e74dd6220849") }, /* TestChainV19BeforeActivationSetup */ { 894, uint256S("0x2885cf0fe8fdf29803b6c65002ba2570ff011531d8ea92be312a85d655e00c51") }, - /* TestChainV19Setup */ - { 899, uint256S("0x7df3c857ce647b3ecd0d4b389b6b0f16e2bdc60b20a8d01c4ad946fe5f15dbc2") }, } };