refactor: moves evo-deterministicmns_tests specific code from header

This commit is contained in:
Konstantin Akimov 2024-08-27 02:04:53 +07:00
parent 1d96fbf091
commit 3fffb0cab9
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
3 changed files with 32 additions and 33 deletions

View File

@ -814,6 +814,38 @@ 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 TestChainV19BeforeActivationSetup : public TestChainSetup
{
TestChainV19BeforeActivationSetup();
};
struct TestChainV19Setup : public TestChainSetup
{
TestChainV19Setup() : TestChainSetup(899)
{
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);
}
};
// 5 blocks earlier
TestChainV19BeforeActivationSetup::TestChainV19BeforeActivationSetup() : TestChainSetup(894)
{
bool v19_active{DeploymentActiveAfter(m_node.chainman->ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)};
assert(!v19_active);
}
// DIP3 can only be activated with legacy scheme (v19 is activated later)
BOOST_AUTO_TEST_CASE(dip3_activation_legacy)
{

View File

@ -571,16 +571,3 @@ CBlock getBlock13b8a()
return block;
}
TestChainV19Setup::TestChainV19Setup() : TestChainSetup(899)
{
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);
}
// 5 blocks earlier
TestChainV19BeforeActivationSetup::TestChainV19BeforeActivationSetup() : TestChainSetup(894)
{
bool v19_active{DeploymentActiveAfter(m_node.chainman->ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)};
assert(!v19_active);
}

View File

@ -183,26 +183,6 @@ struct TestChain100Setup : public TestChainSetup {
TestChain100Setup(const std::vector<const char*>& extra_args = {});
};
struct TestChainDIP3Setup : public TestChainSetup
{
TestChainDIP3Setup() : TestChainSetup(431) {}
};
struct TestChainV19Setup : public TestChainSetup
{
TestChainV19Setup();
};
struct TestChainDIP3BeforeActivationSetup : public TestChainSetup
{
TestChainDIP3BeforeActivationSetup() : TestChainSetup(430) {}
};
struct TestChainV19BeforeActivationSetup : public TestChainSetup
{
TestChainV19BeforeActivationSetup();
};
/**
* Make a test setup that has disk access to the debug.log file disabled. Can
* be used in "hot loops", for example fuzzing or benchmarking.