@@ -144,6 +144,7 @@ BOOST_AUTO_TEST_SUITE(block_reward_reallocation_tests)
144144BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationSetup)
145145{
146146 const auto & chainparams = Params ();
147+ const auto & consensusParams = chainparams.GetConsensus ();
147148 CScript coinbasePubKey = CScript () << ToByteVector (coinbaseKey.GetPubKey ()) << OP_CHECKSIG;
148149
149150 BOOST_ASSERT (deterministicMNManager->IsDIP3Enforced (WITH_LOCK (cs_main, return ::ChainActive ().Height ())));
@@ -201,7 +202,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
201202 LOCK (cs_main);
202203 deterministicMNManager->UpdatedBlockTip (::ChainActive ().Tip ());
203204 BOOST_ASSERT (deterministicMNManager->GetListAtChainTip ().HasMN (tx.GetHash ()));
204- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
205+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
205206 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
206207 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
207208 }
@@ -212,7 +213,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
212213
213214 {
214215 LOCK (cs_main);
215- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
216+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
216217 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
217218 BOOST_CHECK_EQUAL (pblocktemplate->block .vtx [0 ]->GetValueOut (), 13748571607 );
218219 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
@@ -227,7 +228,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
227228 CreateAndProcessBlock ({}, coinbaseKey);
228229 }
229230 LOCK (cs_main);
230- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
231+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
231232 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
232233 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
233234 }
@@ -236,7 +237,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
236237 {
237238 // Reward split should reach ~60/40 after reallocation is done
238239 LOCK (cs_main);
239- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
240+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
240241 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
241242 BOOST_CHECK_EQUAL (pblocktemplate->block .vtx [0 ]->GetValueOut (), 10221599170 );
242243 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
@@ -250,15 +251,15 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
250251 CreateAndProcessBlock ({}, coinbaseKey);
251252 }
252253 LOCK (cs_main);
253- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
254+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
254255 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
255256 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
256257 }
257258
258259 {
259260 // Reward split should reach ~60/40 after reallocation is done
260261 LOCK (cs_main);
261- auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), 2500 );
262+ auto masternode_payment = GetMasternodePayment (::ChainActive ().Height (), GetBlockSubsidy (::ChainActive ().Tip ()->nBits , ::ChainActive ().Height (), chainparams), consensusParams, 2500 );
262263 const auto pblocktemplate = BlockAssembler (*sporkManager, *governance, *m_node.llmq_ctx , *m_node.evodb , ::ChainstateActive (), *m_node.mempool , Params ()).CreateNewBlock (coinbasePubKey);
263264 BOOST_CHECK_EQUAL (pblocktemplate->block .vtx [0 ]->GetValueOut (), 9491484944 );
264265 BOOST_CHECK_EQUAL (pblocktemplate->voutMasternodePayments [0 ].nValue , masternode_payment);
0 commit comments