059171009b consensus/params: simplify ValidDeployment check to avoid gcc warning (Anthony Towns)
Pull request description:
Simplifies the ValidDeployment check to only check the upperbound, relying on the lower bound to be trivially true due to enum values starting at the minimum value of the underlying type (which is checked at compile time in deploymentstatus.cpp). Avoids a "comparison always true" warning in some versions of gcc.
Fixes#22587
ACKs for top commit:
MarcoFalke:
review ACK 059171009b
tryphe:
retested ACK 059171009b
Tree-SHA512: e53b5d478b46d35ec476d004e3c92803afb874c138dd6ef3848861f4281cc113fe88921bc4ac74fd4decbf318ed776d3f816c3a1185f99dc36a5cfecfff51f7c
static_assert(ValidDeployment(Consensus::DEPLOYMENT_TESTDUMMY),"sanity check of DeploymentPos failed (TESTDUMMY not valid)");
static_assert(ValidDeployment(Consensus::DEPLOYMENT_TESTDUMMY),"sanity check of DeploymentPos failed (TESTDUMMY not valid)");
static_assert(!ValidDeployment(Consensus::MAX_VERSION_BITS_DEPLOYMENTS),"sanity check of DeploymentPos failed (MAX value considered valid)");
static_assert(!ValidDeployment(Consensus::MAX_VERSION_BITS_DEPLOYMENTS),"sanity check of DeploymentPos failed (MAX value considered valid)");
static_assert(!ValidDeployment(static_cast<Consensus::BuriedDeployment>(Consensus::DEPLOYMENT_TESTDUMMY)),"sanity check of BuriedDeployment failed (overlaps with DeploymentPos)");
static_assert(!ValidDeployment(static_cast<Consensus::BuriedDeployment>(Consensus::DEPLOYMENT_TESTDUMMY)),"sanity check of BuriedDeployment failed (overlaps with DeploymentPos)");
/* ValidDeployment only checks upper bounds for ensuring validity.