From 035a441efeae3aaa530d75fe71112c63b1c189e3 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 8 Jul 2025 02:42:42 +0300 Subject: [PATCH] wallet2: dump_transfers now prints asset id instead of key images +typo fixed --- src/simplewallet/simplewallet.cpp | 6 ++-- src/simplewallet/simplewallet.h | 2 +- src/wallet/wallet2.cpp | 24 ++++++++++------ src/wallet/wallet2.h | 4 +-- tests/core_tests/chaingen.cpp | 6 ++-- .../escrow_wallet_altchain_test.cpp | 4 +-- tests/core_tests/escrow_wallet_tests.cpp | 28 +++++++++---------- tests/core_tests/multisig_wallet_tests.cpp | 4 +-- tests/core_tests/offers_test.cpp | 4 +-- tests/core_tests/pos_validation.cpp | 6 ++-- tests/core_tests/wallet_tests.cpp | 2 +- 11 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index b1c6ec19..4178ddee 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -298,7 +298,7 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("export_recent_transfers", boost::bind(&simple_wallet::export_recent_transfers, this, ph::_1), "list_recent_transfers_tx - Write recent transfer in json to wallet_recent_transfers.txt"); m_cmd_binder.set_handler("list_outputs", boost::bind(&simple_wallet::list_outputs, this, ph::_1), "list_outputs [spent|unspent] [ticker=ZANO] [unknown] - Lists all the outputs. The result may be filtered by spent status, asset ticker or unknown asset ids."); m_cmd_binder.set_handler("lo", boost::bind(&simple_wallet::list_outputs, this, ph::_1), "alias for list_outputs"); - m_cmd_binder.set_handler("dump_transfers", boost::bind(&simple_wallet::dump_trunsfers, this, ph::_1), "dump_transfers - Write transfers in json to dump_transfers.txt"); + m_cmd_binder.set_handler("dump_transfers", boost::bind(&simple_wallet::dump_transfers, this, ph::_1), "dump_transfers - Write transfers in json to dump_transfers.txt"); m_cmd_binder.set_handler("dump_keyimages", boost::bind(&simple_wallet::dump_key_images, this, ph::_1), "dump_keyimages - Write key_images in json to dump_key_images.txt"); m_cmd_binder.set_handler("payments", boost::bind(&simple_wallet::show_payments, this, ph::_1), "payments [ ... ] - Show payments , ... "); m_cmd_binder.set_handler("bc_height", boost::bind(&simple_wallet::show_blockchain_height, this,ph::_1), "Show blockchain height"); @@ -1184,12 +1184,12 @@ bool simple_wallet::export_recent_transfers(const std::vector& args return true; } //---------------------------------------------------------------------------------------------------- -bool simple_wallet::dump_trunsfers(const std::vector& args) +bool simple_wallet::dump_transfers(const std::vector& args) { stringstream ss; success_msg_writer() << "Generating text...."; - m_wallet->dump_trunsfers(ss); + m_wallet->dump_transfers(ss); success_msg_writer() << "Storing text to dump_transfers.txt...."; file_io_utils::save_string_to_file(log_space::log_singletone::get_default_log_folder() + "/dump_transfers.txt", ss.str()); success_msg_writer() << "Done...."; diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index afc07ec8..6577b6a7 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -58,7 +58,7 @@ namespace currency bool show_balance(const std::vector &args = std::vector()); bool list_recent_transfers(const std::vector& args); bool export_recent_transfers(const std::vector& args); - bool dump_trunsfers(const std::vector& args); + bool dump_transfers(const std::vector& args); bool dump_key_images(const std::vector& args); bool show_incoming_transfers(const std::vector &args); bool show_staking_history(const std::vector& args); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6e6b939f..59107e5f 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5921,9 +5921,9 @@ struct local_transfers_struct END_KV_SERIALIZE_MAP() }; -void wallet2::dump_trunsfers(std::stringstream& ss, bool verbose, const crypto::public_key& asset_id) const +void wallet2::dump_transfers(std::stringstream& ss, bool verbose, const crypto::public_key& asset_id_to_filter) const { - bool filter_by_asset_id = asset_id != currency::null_pkey; + bool filter_by_asset_id = asset_id_to_filter != currency::null_pkey; if (verbose) { @@ -5933,7 +5933,7 @@ void wallet2::dump_trunsfers(std::stringstream& ss, bool verbose, const crypto:: { uint64_t i = tr.first; const transfer_details& td = tr.second; - if (filter_by_asset_id && td.get_asset_id() != asset_id) + if (filter_by_asset_id && td.get_asset_id() != asset_id_to_filter) continue; ss << "{ \"i\": " << i << "," << ENDL; ss << "\"entry\": " << epee::serialization::store_t_to_json(td) << "}," << ENDL; @@ -5942,16 +5942,22 @@ void wallet2::dump_trunsfers(std::stringstream& ss, bool verbose, const crypto:: else { boost::io::ios_flags_saver ifs(ss); - ss << "index amount spent_h g_index block block_ts flg tx out# key image" << ENDL; + ss << "index amount spent_h g_index block block_ts flg tx out# asset id" << ENDL; for (const auto& tr : m_transfers) { uint64_t i = tr.first; const transfer_details& td = tr.second; - if (filter_by_asset_id && td.get_asset_id() != asset_id) + const crypto::public_key asset_id = td.get_asset_id(); + if (filter_by_asset_id && asset_id != asset_id_to_filter) continue; + + uint32_t asset_flags = 0; + currency::asset_descriptor_base asset_info{}; + get_asset_info(asset_id, asset_info, asset_flags); + ss << std::right << std::setw(5) << i << " " << - std::setw(21) << print_money(td.amount()) << " " << + std::setw(21) << print_money(td.amount(), asset_info.decimal_point) << " " << std::setw(7) << td.m_spent_height << " " << std::setw(7) << td.m_global_output_index << " " << std::setw(6) << td.m_ptx_wallet_info->m_block_height << " " << @@ -5959,15 +5965,15 @@ void wallet2::dump_trunsfers(std::stringstream& ss, bool verbose, const crypto:: std::setw(4) << td.m_flags << " " << get_transaction_hash(td.m_ptx_wallet_info->m_tx) << " " << std::setw(4) << td.m_internal_output_index << " " << - td.m_key_image << ENDL; + (asset_id == native_coin_asset_id ? std::string() : crypto::pod_to_hex(asset_id)) << ENDL; } } } //---------------------------------------------------------------------------------------------------- -std::string wallet2::dump_trunsfers(bool verbose, const crypto::public_key& asset_id) const +std::string wallet2::dump_transfers(bool verbose, const crypto::public_key& asset_id) const { std::stringstream ss; - dump_trunsfers(ss, verbose, asset_id); + dump_transfers(ss, verbose, asset_id); return ss.str(); } //---------------------------------------------------------------------------------------------------- diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 9f440c8a..4d3fa218 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -683,8 +683,8 @@ namespace tools void scan_tx_to_key_inputs(std::vector& found_transfers, const currency::transaction& tx); // asset_id = null_pkey means no filtering by asset id - void dump_trunsfers(std::stringstream& ss, bool verbose = true, const crypto::public_key& asset_id = currency::null_pkey) const; - std::string dump_trunsfers(bool verbose = false, const crypto::public_key& asset_id = currency::null_pkey) const; + void dump_transfers(std::stringstream& ss, bool verbose = true, const crypto::public_key& asset_id = currency::null_pkey) const; + std::string dump_transfers(bool verbose = false, const crypto::public_key& asset_id = currency::null_pkey) const; void dump_key_images(std::stringstream& ss); void get_multisig_transfers(multisig_transfer_container& ms_transfers); const multisig_transfer_container& get_multisig_transfers() const { return m_multisig_transfers; } diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index cf9c1af1..d6931f65 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -684,7 +684,7 @@ bool test_generator::find_kernel(const std::list& accs, for (size_t wallet_index = 0, size = wallets.size(); wallet_index < size; ++wallet_index) { std::shared_ptr w = wallets[wallet_index].wallet; - LOG_PRINT_L0("wallet #" << wallet_index << " @ block " << w->get_top_block_height() << ENDL << wallets[wallet_index].wallet->dump_trunsfers()); + LOG_PRINT_L0("wallet #" << wallet_index << " @ block " << w->get_top_block_height() << ENDL << wallets[wallet_index].wallet->dump_transfers()); } return false; @@ -2190,7 +2190,7 @@ bool check_balance_via_wallet(const tools::wallet2& w, const char* account_name, if (!r) { - LOG_PRINT(account_name << "'s transfers for asset_id " << asset_id << ": " << ENDL << w.dump_trunsfers(false, asset_id), LOG_LEVEL_0); + LOG_PRINT(account_name << "'s transfers for asset_id " << asset_id << ": " << ENDL << w.dump_transfers(false, asset_id), LOG_LEVEL_0); } return r; @@ -2451,7 +2451,7 @@ bool refresh_wallet_and_check_balance(const char* intro_log_message, const char* if (print_transfers) { - LOG_PRINT_CYAN(wallet_name << "'s transfers: " << ENDL << wallet->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN(wallet_name << "'s transfers: " << ENDL << wallet->dump_transfers(), LOG_LEVEL_0); } CHECK_AND_ASSERT_MES(check_balance_via_wallet(*wallet.get(), wallet_name, expected_total, expected_mined, expected_unlocked, expected_awaiting_in, expected_awaiting_out), false, ""); diff --git a/tests/core_tests/escrow_wallet_altchain_test.cpp b/tests/core_tests/escrow_wallet_altchain_test.cpp index 514ebc82..69fd0ab4 100644 --- a/tests/core_tests/escrow_wallet_altchain_test.cpp +++ b/tests/core_tests/escrow_wallet_altchain_test.cpp @@ -319,7 +319,7 @@ bool escrow_altchain_meta_impl::c1(currency::core& c, size_t ev_index, const std alice_wlt->refresh(blocks_fetched); //fetched blocks disabled since resync might happened on different situation and number of blocks_fetched might be unexpected //CHECK_AND_ASSERT_MES(blocks_fetched == se.expected_blocks, false, "Alice got " << blocks_fetched << " after refresh, but " << se.expected_blocks << " is expected"); - LOG_PRINT_GREEN("Alice's transfers:" << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_1); + LOG_PRINT_GREEN("Alice's transfers:" << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_1); if (se.a_balance != UINT64_MAX) { uint64_t alice_balance = alice_wlt->balance(); @@ -338,7 +338,7 @@ bool escrow_altchain_meta_impl::c1(currency::core& c, size_t ev_index, const std bob_wlt->refresh(blocks_fetched); //fetched blocks disabled since resync might happened on different situation and number of blocks_fetched might be unexpected //CHECK_AND_ASSERT_MES(blocks_fetched == se.expected_blocks, false, "Bob got " << blocks_fetched << " after refresh, but " << se.expected_blocks << " is expected"); - LOG_PRINT_GREEN("Bob's transfers:" << ENDL << bob_wlt->dump_trunsfers(), LOG_LEVEL_1); + LOG_PRINT_GREEN("Bob's transfers:" << ENDL << bob_wlt->dump_transfers(), LOG_LEVEL_1); if (se.b_balance != UINT64_MAX) { uint64_t bob_balance = bob_wlt->balance(); diff --git a/tests/core_tests/escrow_wallet_tests.cpp b/tests/core_tests/escrow_wallet_tests.cpp index b5c71e29..0f0bbd6c 100644 --- a/tests/core_tests/escrow_wallet_tests.cpp +++ b/tests/core_tests/escrow_wallet_tests.cpp @@ -759,7 +759,7 @@ bool escrow_proposal_expiration::c1(currency::core& c, size_t ev_index, const st bob_wlt->refresh(); uint64_t alice_start_balance = alice_wlt->balance(); - LOG_PRINT_CYAN("Alice's wallet transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("Alice's wallet transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool"); @@ -777,7 +777,7 @@ bool escrow_proposal_expiration::c1(currency::core& c, size_t ev_index, const st transaction proposal_tx = AUTO_VAL_INIT(proposal_tx); transaction escrow_template_tx = AUTO_VAL_INIT(escrow_template_tx); alice_wlt->send_escrow_proposal(cpd, 0, 0, expiration_period, TESTS_DEFAULT_FEE, TESTS_DEFAULT_FEE, "", proposal_tx, escrow_template_tx); - LOG_PRINT_CYAN("alice transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("alice transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); uint64_t alice_post_proposal_balance = alice_wlt->balance(); uint64_t alice_post_proposal_balance_expected = alice_start_balance - TESTS_DEFAULT_FEE; CHECK_AND_ASSERT_MES(alice_post_proposal_balance == alice_post_proposal_balance_expected, false, "Incorrect alice_post_proposal_balance: " << print_money(alice_post_proposal_balance) << ", expected: " << print_money(alice_post_proposal_balance_expected)); @@ -840,9 +840,9 @@ bool escrow_proposal_expiration::c2(currency::core& c, size_t ev_index, const st bob_wlt->refresh(); uint64_t alice_start_balance = alice_wlt->balance(); - LOG_PRINT_CYAN("Alice's wallet transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("Alice's wallet transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); uint64_t bob_start_balance = bob_wlt->balance(); - LOG_PRINT_CYAN("Bob's wallet transfers: " << ENDL << bob_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("Bob's wallet transfers: " << ENDL << bob_wlt->dump_transfers(), LOG_LEVEL_0); CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); @@ -860,7 +860,7 @@ bool escrow_proposal_expiration::c2(currency::core& c, size_t ev_index, const st transaction proposal_tx = AUTO_VAL_INIT(proposal_tx); transaction escrow_template_tx = AUTO_VAL_INIT(escrow_template_tx); alice_wlt->send_escrow_proposal(cpd, 0, 0, expiration_period, TESTS_DEFAULT_FEE, TESTS_DEFAULT_FEE, "", proposal_tx, escrow_template_tx); - LOG_PRINT_CYAN("%%%%% Escrow proposal sent, Alice's transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow proposal sent, Alice's transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); CHECK_AND_ASSERT_MES(check_wallet_balance_blocked_for_escrow(*alice_wlt.get(), "Alice", cpd.amount_a_pledge + cpd.amount_to_pay), false, ""); crypto::hash ms_id = get_multisig_out_id(escrow_template_tx, get_multisig_out_index(escrow_template_tx.vout)); CHECK_AND_ASSERT_MES(ms_id != null_hash, false, "Can't obtain multisig id from escrow template tx"); @@ -996,7 +996,7 @@ bool escrow_proposal_and_accept_expiration::c1(currency::core& c, size_t ev_inde transaction proposal_tx = AUTO_VAL_INIT(proposal_tx); transaction escrow_template_tx = AUTO_VAL_INIT(escrow_template_tx); alice_wlt->send_escrow_proposal(cpd, 0, 0, expiration_period, TESTS_DEFAULT_FEE, b_release_fee, "", proposal_tx, escrow_template_tx); - LOG_PRINT_CYAN("%%%%% Escrow proposal sent, Alice's transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow proposal sent, Alice's transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); CHECK_AND_ASSERT_MES(check_wallet_balance_blocked_for_escrow(*alice_wlt.get(), "Alice", cpd.amount_a_pledge + cpd.amount_to_pay), false, ""); crypto::hash ms_id = get_multisig_out_id(escrow_template_tx, get_multisig_out_index(escrow_template_tx.vout)); @@ -1021,8 +1021,8 @@ bool escrow_proposal_and_accept_expiration::c1(currency::core& c, size_t ev_inde CHECK_AND_ASSERT_MES(refresh_wallet_and_check_contract_state("Alice", alice_wlt, tools::wallet_public::escrow_contract_details::contract_accepted, ms_id, 0), false, ""); CHECK_AND_ASSERT_MES(refresh_wallet_and_check_contract_state("Bob", bob_wlt, tools::wallet_public::escrow_contract_details::contract_accepted, ms_id, 0), false, ""); - LOG_PRINT_CYAN("%%%%% Escrow proposal accepted (unconfirmed), Alice's transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); - LOG_PRINT_CYAN("%%%%% Escrow proposal accepted (unconfirmed), Bob's transfers: " << ENDL << bob_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow proposal accepted (unconfirmed), Alice's transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow proposal accepted (unconfirmed), Bob's transfers: " << ENDL << bob_wlt->dump_transfers(), LOG_LEVEL_0); // mine a few blocks with no txs @@ -1047,8 +1047,8 @@ bool escrow_proposal_and_accept_expiration::c1(currency::core& c, size_t ev_inde CHECK_AND_ASSERT_MES(refresh_wallet_and_check_contract_state("Alice", alice_wlt, tools::wallet_public::escrow_contract_details::contract_accepted, ms_id, TX_EXPIRATION_TIMESTAMP_CHECK_WINDOW + 1), false, ""); CHECK_AND_ASSERT_MES(refresh_wallet_and_check_contract_state("Bob", bob_wlt, tools::wallet_public::escrow_contract_details::contract_accepted, ms_id, TX_EXPIRATION_TIMESTAMP_CHECK_WINDOW + 1), false, ""); - LOG_PRINT_CYAN("%%%%% Escrow acceptance tx expired and removed from tx pool, Alice's transfers: " << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); - LOG_PRINT_CYAN("%%%%% Escrow acceptance tx expired and removed from tx pool, Bob's transfers: " << ENDL << bob_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow acceptance tx expired and removed from tx pool, Alice's transfers: " << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("%%%%% Escrow acceptance tx expired and removed from tx pool, Bob's transfers: " << ENDL << bob_wlt->dump_transfers(), LOG_LEVEL_0); // try to accept expired proposal once again -- an exception should be thrown r = false; @@ -1318,7 +1318,7 @@ bool escrow_incorrect_proposal_acceptance::check_normal_acceptance(currency::cor std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, ALICE_ACC_IDX); alice_wlt->refresh(); std::stringstream ss; - alice_wlt->dump_trunsfers(ss, false); + alice_wlt->dump_transfers(ss, false); LOG_PRINT_L0("check_normal_acceptance(" << release_instruction << "):" << ENDL << "Alice transfers: " << ENDL << ss.str()); uint64_t alice_balance = alice_wlt->balance(); uint64_t alice_balance_expected = m_alice_bob_start_amount - m_cpd.amount_a_pledge - m_cpd.amount_to_pay - TESTS_DEFAULT_FEE; @@ -1392,7 +1392,7 @@ bool escrow_incorrect_proposal_acceptance::check_incorrect_acceptance(currency:: alice_wlt->refresh(); uint64_t alice_balance = alice_wlt->balance(); std::stringstream ss; - alice_wlt->dump_trunsfers(ss, false); + alice_wlt->dump_transfers(ss, false); LOG_PRINT_L0("check_incorrect_acceptance(" << param << "):" << ENDL << "Alice balance: " << print_money(alice_balance) << ", transfers: " << ENDL << ss.str()); tools::escrow_contracts_container contracts; @@ -2110,7 +2110,7 @@ bool escrow_incorrect_cancel_proposal::check_normal_cancel_proposal(currency::co std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, ALICE_ACC_IDX); alice_wlt->refresh(); std::stringstream ss; - alice_wlt->dump_trunsfers(ss, false); + alice_wlt->dump_transfers(ss, false); LOG_PRINT_L0("check_normal_cancel_proposal:" << ENDL << "Alice transfers: " << ENDL << ss.str()); uint64_t alice_balance = alice_wlt->balance(); uint64_t alice_balance_expected = m_alice_bob_start_amount - m_cpd.amount_a_pledge - m_cpd.amount_to_pay - TESTS_DEFAULT_FEE - TESTS_DEFAULT_FEE; // one fee for escrow request, second - for cancel request @@ -2198,7 +2198,7 @@ bool escrow_incorrect_cancel_proposal::check_incorrect_cancel_proposal_internal( std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, ALICE_ACC_IDX); alice_wlt->refresh(); std::stringstream ss; - alice_wlt->dump_trunsfers(ss, false); + alice_wlt->dump_transfers(ss, false); LOG_PRINT_L0("Alice transfers: " << ENDL << ss.str()); uint64_t alice_balance = alice_wlt->balance(); uint64_t alice_balance_expected = m_alice_bob_start_amount - m_cpd.amount_a_pledge - m_cpd.amount_to_pay - TESTS_DEFAULT_FEE - TESTS_DEFAULT_FEE; // one fee for escrow request, second - for cancel request diff --git a/tests/core_tests/multisig_wallet_tests.cpp b/tests/core_tests/multisig_wallet_tests.cpp index 4c2dc2dc..55afd1f0 100644 --- a/tests/core_tests/multisig_wallet_tests.cpp +++ b/tests/core_tests/multisig_wallet_tests.cpp @@ -2576,7 +2576,7 @@ bool multisig_unconfirmed_transfer_and_multiple_scan_pool_calls::c1(currency::co alice_wlt->scan_tx_pool(stub); alice_wlt->get_transfers(transfers); - CHECK_AND_ASSERT_MES(transfers.size() == 0, false, "incorrect transfers size for Alice: " << transfers.size() << "\n" << alice_wlt->dump_trunsfers()); + CHECK_AND_ASSERT_MES(transfers.size() == 0, false, "incorrect transfers size for Alice: " << transfers.size() << "\n" << alice_wlt->dump_transfers()); alice_wlt->get_unconfirmed_transfers(unconfirmed_transfers); CHECK_AND_ASSERT_MES(unconfirmed_transfers.size() == 1, false, "incorrect unconfirmed transfers size for Alice: " << unconfirmed_transfers.size()); CHECK_AND_ASSERT_MES(alice_wlt->get_multisig_transfers().size() == 1, false, "incorrect multisig transfers size for Alice: " << alice_wlt->get_multisig_transfers().size()); @@ -2590,7 +2590,7 @@ bool multisig_unconfirmed_transfer_and_multiple_scan_pool_calls::c1(currency::co transfers.clear(); unconfirmed_transfers.clear(); alice_wlt->get_transfers(transfers); - CHECK_AND_ASSERT_MES(transfers.size() == 0, false, "incorrect transfers size for Alice: " << transfers.size() << "\n" << alice_wlt->dump_trunsfers()); + CHECK_AND_ASSERT_MES(transfers.size() == 0, false, "incorrect transfers size for Alice: " << transfers.size() << "\n" << alice_wlt->dump_transfers()); alice_wlt->get_unconfirmed_transfers(unconfirmed_transfers); CHECK_AND_ASSERT_MES(unconfirmed_transfers.size() == 1, false, "incorrect unconfirmed transfers size for Alice: " << unconfirmed_transfers.size()); CHECK_AND_ASSERT_MES(alice_wlt->get_multisig_transfers().size() == 1, false, "incorrect multisig transfers size for Alice: " << alice_wlt->get_multisig_transfers().size()); diff --git a/tests/core_tests/offers_test.cpp b/tests/core_tests/offers_test.cpp index 39c115ae..2812838b 100644 --- a/tests/core_tests/offers_test.cpp +++ b/tests/core_tests/offers_test.cpp @@ -658,7 +658,7 @@ bool offer_removing_and_selected_output::check_offers(currency::core& c, size_t std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); alice_wlt->refresh(); - LOG_PRINT_CYAN("Alice's transfers:" << ENDL << alice_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("Alice's transfers:" << ENDL << alice_wlt->dump_transfers(), LOG_LEVEL_0); uint64_t alice_start_balance = alice_wlt->balance(); CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); @@ -1354,7 +1354,7 @@ bool offer_cancellation_with_zero_fee::c1(currency::core& c, size_t ev_index, co bool r = false; std::shared_ptr miner_wlt = init_playtime_test_wallet(events, c, m_accounts[MINER_ACC_IDX]); miner_wlt->refresh(); - LOG_PRINT_CYAN("Miners's transfers:" << ENDL << miner_wlt->dump_trunsfers(), LOG_LEVEL_0); + LOG_PRINT_CYAN("Miners's transfers:" << ENDL << miner_wlt->dump_transfers(), LOG_LEVEL_0); uint64_t miner_start_balance = miner_wlt->balance(); CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); diff --git a/tests/core_tests/pos_validation.cpp b/tests/core_tests/pos_validation.cpp index 539b9259..d02d4bbc 100644 --- a/tests/core_tests/pos_validation.cpp +++ b/tests/core_tests/pos_validation.cpp @@ -53,7 +53,7 @@ bool gen_pos_coinstake_already_spent::generate(std::vector& ev CREATE_TEST_WALLET(miner_wlt, miner, blk_0); REFRESH_TEST_WALLET_AT_GEN_TIME(events, miner_wlt, blk_2, CURRENCY_MINED_MONEY_UNLOCK_WINDOW + 1); - LOG_PRINT_L0("miner's transfers:" << ENDL << miner_wlt->dump_trunsfers(false)); + LOG_PRINT_L0("miner's transfers:" << ENDL << miner_wlt->dump_transfers(false)); // Legend: (n) - PoW block, [m] - PoS block // 0 1 11 12 13 <-- blockchain height (assuming CURRENCY_MINED_MONEY_UNLOCK_WINDOW == 10) @@ -782,7 +782,7 @@ void pos_wallet_minting_same_amount_diff_outs::dump_wallets_entries(const std::v LOG_PRINT2(LOG2_FILENAME, ENDL << ENDL << ENDL << ENDL << ENDL << ENDL, LOG_LEVEL_0); for (size_t i = 0; i < minting_wallets.size(); ++i) { - LOG_PRINT2(LOG2_FILENAME, "wallet #" << i << ":" << ENDL << minting_wallets[i].w->dump_trunsfers() << ENDL, LOG_LEVEL_0); + LOG_PRINT2(LOG2_FILENAME, "wallet #" << i << ":" << ENDL << minting_wallets[i].w->dump_transfers() << ENDL, LOG_LEVEL_0); } #undef LOG2_FILENAME } @@ -860,7 +860,7 @@ bool pos_wallet_big_block_test::c1(currency::core& c, size_t ev_index, const std miner_wlt->refresh(); miner_wlt->scan_tx_pool(stub_bool); - LOG_PRINT_L0("miner transfers:" << ENDL << miner_wlt->dump_trunsfers(false)); + LOG_PRINT_L0("miner transfers:" << ENDL << miner_wlt->dump_transfers(false)); CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 2, false, "Incorrect number of txs in the pool: " << c.get_pool_transactions_count()); diff --git a/tests/core_tests/wallet_tests.cpp b/tests/core_tests/wallet_tests.cpp index f7d10647..88da1f6e 100644 --- a/tests/core_tests/wallet_tests.cpp +++ b/tests/core_tests/wallet_tests.cpp @@ -2988,7 +2988,7 @@ bool mined_balance_wallet_test::c1(currency::core& c, size_t ev_index, const std miner_wlt->refresh(); std::stringstream ss; - miner_wlt->dump_trunsfers(ss, false); + miner_wlt->dump_transfers(ss, false); LOG_PRINT_CYAN("miner transfers: " << ENDL << ss.str(), LOG_LEVEL_0); CHECK_AND_ASSERT_MES(check_balance_via_wallet(*miner_wlt.get(), "miner", miner_mined_money, miner_mined_money), false, "wrong balance");