coretests: set_playtime_test_wallet_options() minor refactoring

This commit is contained in:
sowle 2025-05-15 05:39:34 +03:00
parent 915d01fa7d
commit 92ea96a41d
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 12 additions and 8 deletions

View file

@ -21,6 +21,7 @@
#include "currency_core/bc_offers_service.h"
#include "wallet/wallet2.h"
#include "wallet_test_core_proxy.h"
#include "wallet_tests_basic.h"
#include "pos_block_builder.h"
using namespace epee;
@ -1002,10 +1003,7 @@ bool test_generator::init_test_wallet(const currency::account_base& account, con
w->assign_account(account);
w->set_genesis(genesis_hash);
w->set_core_proxy(m_wallet_test_core_proxy);
w->set_disable_tor_relay(true);
w->set_concise_mode(true);
w->set_concise_mode_reorg_max_reorg_blocks(TESTS_CONCISE_MODE_REORG_MAX_REORG_BLOCK);
w->set_use_assets_whitelisting(false);
set_playtime_test_wallet_options(w);
result = w;
return true;

View file

@ -11,6 +11,15 @@
#include "currency_core/bc_offers_service.h"
#include "rpc/core_rpc_server.h"
template<typename wallet_t>
void set_playtime_test_wallet_options(std::shared_ptr<wallet_t> w)
{
w->set_disable_tor_relay(true);
w->set_concise_mode(true);
w->set_concise_mode_reorg_max_reorg_blocks(TESTS_CONCISE_MODE_REORG_MAX_REORG_BLOCK);
w->set_use_assets_whitelisting(false);
}
struct wallet_test : virtual public test_chain_unit_enchanced
{
enum { MINER_ACC_IDX = 0, ALICE_ACC_IDX = 1, BOB_ACC_IDX = 2, CAROL_ACC_IDX = 3, DAN_ACC_IDX = 4, TOTAL_ACCS_COUNT = 5 }; // to be used as index for m_accounts
@ -59,10 +68,7 @@ struct wallet_test : virtual public test_chain_unit_enchanced
w->assign_account(acc);
w->set_genesis(genesis_hash);
w->set_core_proxy(m_core_proxy);
w->set_disable_tor_relay(true);
w->set_concise_mode(true);
w->set_concise_mode_reorg_max_reorg_blocks(TESTS_CONCISE_MODE_REORG_MAX_REORG_BLOCK);
w->set_use_assets_whitelisting(false);
set_playtime_test_wallet_options(w);
return w;
#undef LOCAL_HOST_CSTR