diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6122c6be..684b56e8 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1890,6 +1890,21 @@ void wallet2::transfer(uint64_t amount, const currency::account_public_address& this->transfer(dst, 0, 0, TX_DEFAULT_FEE, extra, attachments, get_current_split_strategy(), tools::tx_dust_policy(DEFAULT_DUST_THRESHOLD), result_tx); } //---------------------------------------------------------------------------------------------------- +void wallet2::transfer(uint64_t amount, size_t fake_outs_count, const currency::account_public_address& acc, uint64_t fee /* = TX_DEFAULT_FEE*/, + const crypto::hash& asset_id /* = currency::null_hash */) +{ + std::vector extra; + std::vector attachments; + transaction result_tx = AUTO_VAL_INIT(result_tx); + + std::vector dst; + dst.resize(1); + dst.back().addr.push_back(acc); + dst.back().amount = amount; + dst.back().asset_id = asset_id; + this->transfer(dst, fake_outs_count, 0, fee, extra, attachments, get_current_split_strategy(), tools::tx_dust_policy(DEFAULT_DUST_THRESHOLD), result_tx); +} +//---------------------------------------------------------------------------------------------------- void wallet2::transfer(uint64_t amount, const currency::account_public_address& acc, const crypto::hash& asset_id) { transaction result_tx = AUTO_VAL_INIT(result_tx); diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 6d1d470a..79b90037 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -571,6 +571,7 @@ namespace tools uint64_t unlocked_balance() const; void transfer(uint64_t amount, const currency::account_public_address& acc, const crypto::hash& asset_id = currency::null_hash); + void transfer(uint64_t amount, size_t fake_outs_count, const currency::account_public_address& acc, uint64_t fee = TX_DEFAULT_FEE, const crypto::hash& asset_id = currency::null_hash); void transfer(uint64_t amount, const currency::account_public_address& acc, currency::transaction& result_tx, const crypto::hash& asset_id = currency::null_hash); void transfer(const std::vector& dsts, diff --git a/tests/core_tests/zarcanum_test.cpp b/tests/core_tests/zarcanum_test.cpp index 2a28a062..099f55c8 100644 --- a/tests/core_tests/zarcanum_test.cpp +++ b/tests/core_tests/zarcanum_test.cpp @@ -131,9 +131,10 @@ bool zarcanum_basic_test::c1(currency::core& c, size_t ev_index, const std::vect CHECK_AND_ASSERT_MES(check_balance_via_wallet(*alice_wlt, "Alice", transfer_amount * batches_to_Alice_count, UINT64_MAX, transfer_amount * batches_to_Alice_count), false, ""); - //create transfer from post-zarcanum inputs to post-zarcanum inputs + //create transfer from post-zarcanum inputs to post-zarcanum inputs with mixins uint64_t transfer_amount2 = AMOUNT_TO_TRANSFER_ZARCANUM_BASIC; - alice_wlt->transfer(transfer_amount2, m_accounts[BOB_ACC_IDX].get_public_address()); + size_t nmix = 10; + alice_wlt->transfer(transfer_amount2, nmix, m_accounts[BOB_ACC_IDX].get_public_address()); LOG_PRINT_MAGENTA("Zarcanum-2-zarcanum transaction sent from Alice to Bob " << print_money_brief(transfer_amount2), LOG_LEVEL_0);