forked from lthn/blockchain
wallet2: dump_transfers now prints asset id instead of key images +typo fixed
This commit is contained in:
parent
c637e16848
commit
035a441efe
11 changed files with 48 additions and 42 deletions
|
|
@ -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 <payment_id_1> [<payment_id_2> ... <payment_id_N>] - Show payments <payment_id_1>, ... <payment_id_N>");
|
||||
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<std::string>& args
|
|||
return true;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
bool simple_wallet::dump_trunsfers(const std::vector<std::string>& args)
|
||||
bool simple_wallet::dump_transfers(const std::vector<std::string>& 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....";
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace currency
|
|||
bool show_balance(const std::vector<std::string> &args = std::vector<std::string>());
|
||||
bool list_recent_transfers(const std::vector<std::string>& args);
|
||||
bool export_recent_transfers(const std::vector<std::string>& args);
|
||||
bool dump_trunsfers(const std::vector<std::string>& args);
|
||||
bool dump_transfers(const std::vector<std::string>& args);
|
||||
bool dump_key_images(const std::vector<std::string>& args);
|
||||
bool show_incoming_transfers(const std::vector<std::string> &args);
|
||||
bool show_staking_history(const std::vector<std::string>& args);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -683,8 +683,8 @@ namespace tools
|
|||
|
||||
void scan_tx_to_key_inputs(std::vector<uint64_t>& 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; }
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@ bool test_generator::find_kernel(const std::list<currency::account_base>& accs,
|
|||
for (size_t wallet_index = 0, size = wallets.size(); wallet_index < size; ++wallet_index)
|
||||
{
|
||||
std::shared_ptr<tools::wallet2> 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, "");
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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<tools::wallet2> 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<tools::wallet2> 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<tools::wallet2> 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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -658,7 +658,7 @@ bool offer_removing_and_selected_output::check_offers(currency::core& c, size_t
|
|||
|
||||
std::shared_ptr<tools::wallet2> 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<tools::wallet2> 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());
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ bool gen_pos_coinstake_already_spent::generate(std::vector<test_event_entry>& 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());
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue