11 #include <boost/test/unit_test.hpp>
58 int nActivationHeight = 100;
92 int nActivationHeight = 100;
121 int nActivationHeight = 100;
150 int nActivationHeight = 100;
void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivationHeight)
Allows modifying the network upgrade regtest parameters.
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
const CChainParams & Params()
Return the currently selected parameters.
static const std::string REGTEST
static const std::string MAIN
Chain name strings.
const Consensus::Params & GetConsensus() const
BOOST_AUTO_TEST_SUITE_END()
UpgradeIndex
Index into Params.vUpgrades and NetworkUpgradeInfo.
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
static constexpr int ALWAYS_ACTIVE
Special value for nActivationHeight indicating that the upgrade is always active.
int nActivationHeight
Height of the first block for which the new consensus rules will be active.
static constexpr int NO_ACTIVATION_HEIGHT
Special value for nActivationHeight indicating that the upgrade will never activate.
Parameters that influence chain consensus.
NetworkUpgrade vUpgrades[MAX_NETWORK_UPGRADES]
int DefaultActivation[Consensus::MAX_NETWORK_UPGRADES]
UpgradeState NetworkUpgradeState(int nHeight, const Consensus::Params ¶ms, Consensus::UpgradeIndex idx)
Checks the state of a given network upgrade based on block height.
bool IsActivationHeightForAnyUpgrade(int nHeight, const Consensus::Params ¶ms)
Returns true if the given block height is the activation height for any upgrade.
bool IsActivationHeight(int nHeight, const Consensus::Params ¶ms, Consensus::UpgradeIndex idx)
Returns true if the given block height is the activation height for the given upgrade.
Optional< int > NextActivationHeight(int nHeight, const Consensus::Params ¶ms)
Returns the activation height for the next upgrade after the given block height, or nullopt if there ...
BOOST_AUTO_TEST_CASE(networkUpgradeStateTest)