// Copyright (c) 2025 The Limenka developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef LIMENKA_TEST_FORK_UTIL_H #define LIMENKA_TEST_FORK_UTIL_H #include #include #include #include #include #include /** Lightweight fixture for fork chain parameter tests. * Uses ChainType::FORK directly via TestingSetup (not TestChain100Setup, * which hardcodes REGTEST). Fork activation defaults to MTP 1 (active * from the start) with a reduced delay (1024 steps) so tests run fast. * No pre-mined chain — use mineBlocks() if needed. */ struct ForkTestingSetup : public TestingSetup { ForkTestingSetup(const TestOpts& opts = {}) : TestingSetup(ChainType::FORK, { .extra_args = Cat( std::vector{ "-forkactivationtime=1", "-forkdelaysteps=1024", }, opts.extra_args), .coins_db_in_memory = opts.coins_db_in_memory, .block_tree_db_in_memory = opts.block_tree_db_in_memory, .setup_net = opts.setup_net, .setup_validation_interface = opts.setup_validation_interface, .min_validation_cache = opts.min_validation_cache, }) {} const Consensus::Params& ForkConsensus() const { return Params().GetConsensus(); } }; #endif // LIMENKA_TEST_FORK_UTIL_H