// 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. #include #include #include #include #include BOOST_FIXTURE_TEST_SUITE(fork_interval_tests, ForkTestingSetup) BOOST_AUTO_TEST_CASE(fork_interval_target) { const auto& p = ForkConsensus(); BOOST_CHECK_EQUAL(p.nForkIntervalTarget, 617); } BOOST_AUTO_TEST_CASE(fork_block_subsidy) { const int halving_interval = 210000; int64_t agg_seconds = 0; // Time-proportional reward at the full interval: 50 BTC coinbase. CAmount sub = GetForkBlockSubsidy(600, agg_seconds, halving_interval); BOOST_CHECK_EQUAL(sub, 50 * COIN); // Post-halving: after 4 years of aggregate seconds. agg_seconds = 600LL * halving_interval + 1; CAmount sub_halved = GetForkBlockSubsidy(600, agg_seconds, halving_interval); BOOST_CHECK_EQUAL(sub_halved, sub / 2); // Second halving. agg_seconds = 600LL * halving_interval * 2 + 1; CAmount sub_quarter = GetForkBlockSubsidy(600, agg_seconds, halving_interval); BOOST_CHECK_EQUAL(sub_quarter, sub / 4); } BOOST_AUTO_TEST_CASE(fork_block_weight_limit) { // Fork blocks have no fixed weight cap (time-proportional payload). BOOST_CHECK_GT(MAX_BLOCK_WEIGHT, 0); BOOST_CHECK_LE(MAX_BLOCK_WEIGHT, int64_t(4'000'000)); } BOOST_AUTO_TEST_SUITE_END()