diff --git a/tests/core_tests/wallet_tests.cpp b/tests/core_tests/wallet_tests.cpp index 74c9f24e..3bee8148 100644 --- a/tests/core_tests/wallet_tests.cpp +++ b/tests/core_tests/wallet_tests.cpp @@ -22,18 +22,6 @@ const std::string g_wallet_password = "dofatibmzibeziyekigo"; const currency::account_base null_account = AUTO_VAL_INIT(null_account); -struct wlt_lambda_on_transfer2_wrapper : public tools::i_wallet2_callback -{ - typedef std::function Func; - wlt_lambda_on_transfer2_wrapper(Func callback) : m_result(false), m_callback(callback) {} - virtual void on_transfer2(const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) override - { - m_result = m_callback(wti, balance, unlocked_balance, total_mined); - } - bool m_result; - Func m_callback; -}; - POD_MAKE_COMPARABLE(currency, tx_out); // Determines which output is real and actually spent in tx inputs, when there are fake outputs. diff --git a/tests/core_tests/wallet_tests_basic.cpp b/tests/core_tests/wallet_tests_basic.cpp index 5c2744e2..fe4ec260 100644 --- a/tests/core_tests/wallet_tests_basic.cpp +++ b/tests/core_tests/wallet_tests_basic.cpp @@ -72,6 +72,7 @@ bool wallet_test::check_balance(currency::core& c, size_t ev_index, const std::v return true; } + std::shared_ptr wallet_test::init_playtime_test_wallet(const std::vector& events, currency::core& c, const account_base& acc) const { CHECK_AND_ASSERT_THROW_MES(events.size() > 0 && events[0].type() == typeid(currency::block), "Invalid events queue, can't find genesis block at the beginning"); @@ -84,6 +85,7 @@ std::shared_ptr wallet_test::init_playtime_test_wallet(const std w->set_core_proxy(m_core_proxy); return w; } + std::shared_ptr wallet_test::init_playtime_test_wallet(const std::vector& events, currency::core& c, size_t account_index) const { CHECK_AND_ASSERT_THROW_MES(account_index < m_accounts.size(), "Invalid account index"); diff --git a/tests/core_tests/wallet_tests_basic.h b/tests/core_tests/wallet_tests_basic.h index 4627284c..1e921b29 100644 --- a/tests/core_tests/wallet_tests_basic.h +++ b/tests/core_tests/wallet_tests_basic.h @@ -87,3 +87,15 @@ struct wallet_callback_balance_checker : public tools::i_wallet2_callback uint64_t m_unlocked_balance; uint64_t m_total_mined; }; + +struct wlt_lambda_on_transfer2_wrapper : public tools::i_wallet2_callback +{ + typedef std::function Func; + wlt_lambda_on_transfer2_wrapper(Func callback) : m_result(false), m_callback(callback) {} + virtual void on_transfer2(const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) override + { + m_result = m_callback(wti, balance, unlocked_balance, total_mined); + } + bool m_result; + Func m_callback; +};