mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
[upstream #8855] Chainparams: Get rid of CChainParams& Params(std::string)
This commit is contained in:
parent
8335a9ea8e
commit
713a4601f8
8 changed files with 25 additions and 29 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue