@@ -56,11 +56,13 @@ BOOST_AUTO_TEST_CASE(budget_value)
5656BOOST_FIXTURE_TEST_CASE (block_value, TestnetSetup)
5757{
5858 enableMnSyncAndSuperblocksPayment ();
59- // regular block
6059 int nHeight = 100 ; std::string strError;
6160 const CAmount nBlockReward = GetBlockValue (nHeight);
6261 CAmount nExpectedRet = nBlockReward;
6362 CAmount nBudgetAmtRet = 0 ;
63+
64+ // regular block
65+ BOOST_CHECK (IsBlockValueValid (nHeight, nExpectedRet, 0 , nBudgetAmtRet));
6466 BOOST_CHECK (IsBlockValueValid (nHeight, nExpectedRet, nBlockReward-1 , nBudgetAmtRet));
6567 BOOST_CHECK_EQUAL (nExpectedRet, nBlockReward);
6668 BOOST_CHECK_EQUAL (nBudgetAmtRet, 0 );
@@ -127,6 +129,16 @@ BOOST_FIXTURE_TEST_CASE(block_value, TestnetSetup)
127129 BOOST_CHECK_EQUAL (nBudgetAmtRet, 0 );
128130}
129131
132+ BOOST_FIXTURE_TEST_CASE (block_value_undermint, RegTestingSetup)
133+ {
134+ int nHeight = 100 ;
135+ CAmount nExpectedRet = GetBlockValue (nHeight);
136+ CAmount nBudgetAmtRet = 0 ;
137+ // under-minting blocks are invalid after v6
138+ BOOST_CHECK (IsBlockValueValid (nHeight, nExpectedRet, -1 , nBudgetAmtRet));
139+ UpdateNetworkUpgradeParameters (Consensus::UPGRADE_V6_0, Consensus::NetworkUpgrade::ALWAYS_ACTIVE);
140+ BOOST_CHECK (!IsBlockValueValid (nHeight, nExpectedRet, -1 , nBudgetAmtRet));
141+ }
130142
131143/* *
132144 * 1) Create two proposals and two budget finalizations with a different proposal payment order:
0 commit comments