From 17188ab8fbb9027cb23fc2c69e4ead16ef56eb14 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sat, 20 May 2023 00:53:53 +0200 Subject: [PATCH] properly configured pos_altblocks_validation --- tests/core_tests/chaingen.cpp | 7 +++++++ tests/core_tests/chaingen.h | 2 ++ tests/core_tests/pos_validation.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index a1c2d24a..97d799d7 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -2287,6 +2287,13 @@ currency::core_runtime_config test_chain_unit_base::get_runtime_info_for_core() crc.hard_forks = m_hardforks; return crc; } + +void test_chain_unit_base::set_hardforks_for_old_tests() +{ + m_hardforks.set_hardfork_height(1, 1440); + m_hardforks.set_hardfork_height(2, 1800); + m_hardforks.set_hardfork_height(3, 1801); +} //------------------------------------------------------------------------------ test_chain_unit_enchanced::test_chain_unit_enchanced() diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index ad689177..216643a5 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -259,6 +259,8 @@ public: currency::core_runtime_config get_runtime_info_for_core() const; // tests can override this for special initialization + void set_hardforks_for_old_tests(); + private: callbacks_map m_callbacks; diff --git a/tests/core_tests/pos_validation.cpp b/tests/core_tests/pos_validation.cpp index 2c7ef529..941c7b4d 100644 --- a/tests/core_tests/pos_validation.cpp +++ b/tests/core_tests/pos_validation.cpp @@ -849,6 +849,7 @@ bool pos_wallet_big_block_test::c1(currency::core& c, size_t ev_index, const std pos_altblocks_validation::pos_altblocks_validation() { + test_chain_unit_base::set_hardforks_for_old_tests(); } bool pos_altblocks_validation::configure_core(currency::core& c, size_t ev_index, const std::vector& events)