From 2aa302f69a8c1831f3baf9d3cb82f173d6c977fc Mon Sep 17 00:00:00 2001 From: sowle Date: Sat, 3 Jun 2023 04:03:35 +0200 Subject: [PATCH] total number of HFs + "==" and "!=" for hard_forks_descriptor --- src/currency_core/core_runtime_config.h | 12 +++++++++++- src/currency_core/currency_config.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/currency_core/core_runtime_config.h b/src/currency_core/core_runtime_config.h index 583add64..31472800 100644 --- a/src/currency_core/core_runtime_config.h +++ b/src/currency_core/core_runtime_config.h @@ -13,7 +13,7 @@ namespace currency { struct hard_forks_descriptor { - constexpr static size_t m_total_count = 5; + constexpr static size_t m_total_count = ZANO_HARDFORKS_TOTAL; std::array m_height_the_hardfork_n_active_after; hard_forks_descriptor() @@ -81,6 +81,16 @@ namespace currency { return HF3_BLOCK_MINOR_VERSION; } + + bool operator==(const hard_forks_descriptor& rhs) const + { + return m_height_the_hardfork_n_active_after == rhs.m_height_the_hardfork_n_active_after; + } + + bool operator!=(const hard_forks_descriptor& rhs) const + { + return ! operator==(rhs); + } }; diff --git a/src/currency_core/currency_config.h b/src/currency_core/currency_config.h index b559d696..3a8876a6 100644 --- a/src/currency_core/currency_config.h +++ b/src/currency_core/currency_config.h @@ -266,6 +266,7 @@ #define ZANO_HARDFORK_02 2 #define ZANO_HARDFORK_03 3 #define ZANO_HARDFORK_04_ZARCANUM 4 +#define ZANO_HARDFORKS_TOTAL 5