From 14bec1cc5a405e22f1d788e524aa8be0bcd6802e Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 13 Apr 2023 23:23:22 +0200 Subject: [PATCH] coretests: hard_fork_2 tests now handling m_hardforks properly --- tests/core_tests/hard_fork_2.cpp | 15 +++++---------- tests/core_tests/hard_fork_2.h | 2 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/core_tests/hard_fork_2.cpp b/tests/core_tests/hard_fork_2.cpp index 892cb713..fc6a96cd 100644 --- a/tests/core_tests/hard_fork_2.cpp +++ b/tests/core_tests/hard_fork_2.cpp @@ -20,7 +20,10 @@ hard_fork_2_base_test::hard_fork_2_base_test(size_t hardfork_01_height, size_t h , m_hardfork_02_height(hardfork_02_height) , m_hardfork_03_height(CURRENCY_MAX_BLOCK_NUMBER) { - + m_hardforks.clear(); + m_hardforks.set_hardfork_height(1, m_hardfork_01_height); + m_hardforks.set_hardfork_height(2, m_hardfork_02_height); + m_hardforks.set_hardfork_height(3, m_hardfork_03_height); REGISTER_CALLBACK_METHOD(hard_fork_2_base_test, configure_core); } @@ -29,19 +32,11 @@ bool hard_fork_2_base_test::configure_core(currency::core& c, size_t ev_index, c currency::core_runtime_config pc = c.get_blockchain_storage().get_core_runtime_config(); pc.min_coinstake_age = TESTS_POS_CONFIG_MIN_COINSTAKE_AGE; pc.pos_minimum_heigh = TESTS_POS_CONFIG_POS_MINIMUM_HEIGH; - pc.hard_forks.set_hardfork_height(1, m_hardfork_01_height); - pc.hard_forks.set_hardfork_height(2, m_hardfork_02_height); - pc.hard_forks.set_hardfork_height(3, m_hardfork_03_height); + pc.hard_forks = m_hardforks; c.get_blockchain_storage().set_core_runtime_config(pc); return true; } -void hard_fork_2_base_test::set_hard_fork_heights_to_generator(test_generator& generator) const -{ - generator.set_hardfork_height(1, m_hardfork_01_height); - generator.set_hardfork_height(2, m_hardfork_02_height); -} - //------------------------------------------------------------------------------ hard_fork_2_tx_payer_in_wallet::hard_fork_2_tx_payer_in_wallet() diff --git a/tests/core_tests/hard_fork_2.h b/tests/core_tests/hard_fork_2.h index bcca582e..caeb0eaf 100644 --- a/tests/core_tests/hard_fork_2.h +++ b/tests/core_tests/hard_fork_2.h @@ -13,8 +13,6 @@ struct hard_fork_2_base_test : virtual public test_chain_unit_enchanced hard_fork_2_base_test(size_t hardfork_01_height, size_t hardfork_02_height); bool configure_core(currency::core& c, size_t ev_index, const std::vector& events); - void set_hard_fork_heights_to_generator(test_generator& generator) const; - size_t m_hardfork_01_height; size_t m_hardfork_02_height; size_t m_hardfork_03_height;