Add static_assert for hf numeric values

This commit is contained in:
Jason Rhinelander 2022-05-20 17:50:22 -03:00
parent 6011a9b4e7
commit 2b94af71a9
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 4 additions and 0 deletions

View File

@ -209,6 +209,10 @@ constexpr auto hf_prev(hf x) {
return static_cast<hf>(static_cast<uint8_t>(x) - 1);
}
// This is here to make sure the numeric value of the top hf enum value is correct (i.e. hf19 == 19
// numerically); bump this when adding a new hf.
static_assert(static_cast<uint8_t>(hf_max) == 19);
// Constants for which hardfork activates various features:
namespace feature {
constexpr auto PER_BYTE_FEE = hf::hf10_bulletproofs;