8#include <chainparams.h>
13#include <test/util/blockindex.h>
14#include <test/util/setup_common.h>
16#include <boost/test/unit_test.hpp>
22 const bool expectActivation) {
30 block.
nHeight = activationHeight - 1;
33 block.
nHeight = activationHeight;
37 block.
nHeight = activationHeight + 1;
43BOOST_AUTO_TEST_SUITE(stakingrewards_tests)
47 checkStakingRewardsActivation(
"regtest",
false);
48 checkStakingRewardsActivation(
"test",
false);
49 checkStakingRewardsActivation(
"main",
true);
57 ProofId proofid1 = ProofId::fromHex(
58 "979dbc3b1351ee12f91f537e04e61fdf93a73d5ebfc317bccd12643b8be87b02");
60 "36653907336187a889c93bd9c75c0f3302ad5b24bdc0df51b4eaef914853d480",
66 "f8535480ac419d395127f592c13be827cbbced02614d2c06e4a599eb1cf43034",
70 ProofId proofid2 = ProofId::fromHex(
71 "e01bac293ed39e8d5e06214e7fe0bceb9646ef253ce501dcd7a475f802ab07f1");
73 "e4cafd6af9987403999ae77f3c622027ce765679ab068d215884253b547590f2",
77BOOST_AUTO_TEST_SUITE_END()
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CChainParams & Params()
Return the currently selected parameters.
#define Assert(val)
Identity function.
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
BlockHash GetBlockHash() const
int nHeight
height of the entry in the chain. The genesis block has height 0
const Consensus::Params & GetConsensus() const
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
RecursiveMutex & GetMutex() const LOCK_RETURNED(
Alias for cs_main.
CBlockIndex * ActiveTip() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
std::string ToString() const
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
bool IsStakingRewardsActivated(const Consensus::Params ¶ms, const CBlockIndex *pprev)
BOOST_FIXTURE_TEST_CASE(isstakingrewardsactivated, StakingRewardsActivationTestingSetup)
Parameters that influence chain consensus.
int cowperthwaiteHeight
Block height at which the Cowperthwaite activation becomes active.
void checkStakingRewardsActivation(const std::string &net, const bool expectActivation)
StakeContenderIds are unique for each block to ensure that the peer polling for their acceptance has ...
#define WITH_LOCK(cs, code)
Run code while locking a mutex.