mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Chainparams: Get rid of CChainParams& Params(std::string)
This commit is contained in:
@@ -39,17 +39,18 @@ static void TestBlockSubsidyHalvings(int nSubsidyHalvingInterval)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(block_subsidy_test)
|
||||
{
|
||||
TestBlockSubsidyHalvings(Params(CBaseChainParams::MAIN).GetConsensus()); // As in main
|
||||
const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);
|
||||
TestBlockSubsidyHalvings(chainParams->GetConsensus()); // As in main
|
||||
TestBlockSubsidyHalvings(150); // As in regtest
|
||||
TestBlockSubsidyHalvings(1000); // Just another interval
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(subsidy_limit_test)
|
||||
{
|
||||
const Consensus::Params& consensusParams = Params(CBaseChainParams::MAIN).GetConsensus();
|
||||
const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);
|
||||
CAmount nSum = 0;
|
||||
for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
|
||||
CAmount nSubsidy = GetBlockSubsidy(nHeight, consensusParams);
|
||||
CAmount nSubsidy = GetBlockSubsidy(nHeight, chainParams->GetConsensus());
|
||||
BOOST_CHECK(nSubsidy <= 50 * COIN);
|
||||
nSum += nSubsidy * 1000;
|
||||
BOOST_CHECK(MoneyRange(nSum));
|
||||
|
||||
Reference in New Issue
Block a user