diff --git a/src/carrot_core/payment_proposal.cpp b/src/carrot_core/payment_proposal.cpp index 377035e7e..3f34a8ce8 100644 --- a/src/carrot_core/payment_proposal.cpp +++ b/src/carrot_core/payment_proposal.cpp @@ -37,8 +37,6 @@ #include "misc_log_ex.h" #include "ringct/rctOps.h" -#include "string_tools.h" - //third party headers //standard headers @@ -119,15 +117,6 @@ static void get_normal_proposal_ecdh_parts(const CarrotPaymentProposalV1 &propos make_carrot_uncontextualized_shared_key_sender(enote_ephemeral_privkey, proposal.destination.address_view_pubkey, s_sender_receiver_unctx_out); - - /* - std::cerr << "Random:" << epee::string_tools::pod_to_hex(proposal.randomness) << std::endl; - std::cerr << "K_s: " << proposal.destination.address_spend_pubkey << std::endl; - std::cerr << "K_v: " << proposal.destination.address_view_pubkey << std::endl; - std::cerr << "d_e: " << epee::string_tools::pod_to_hex(unwrap(unwrap(enote_ephemeral_privkey))) << std::endl; - std::cerr << "D_e: " << epee::string_tools::pod_to_hex(enote_ephemeral_pubkey_out) << std::endl; - std::cerr << "s_sr: " << epee::string_tools::pod_to_hex(s_sender_receiver_unctx_out) << std::endl; - */ } //------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------------- diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 761b00144..d11ecead2 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1460,22 +1460,16 @@ std::tuple Blockchain::validate_treasury_payout(const transaction& return {false, 0}; } - /* - if (target.unlock_time != CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW) { - MERROR_VER("Miner transaction contains treasury output with invalid target key"); - return {false, 0}; - } - */ - return {true, output - tx.vout.begin()}; } //------------------------------------------------------------------ // This function validates the miner transaction reward -bool Blockchain::validate_miner_transaction(const block& b, const uint64_t height, size_t cumulative_block_weight, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version) +bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_block_weight, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version) { LOG_PRINT_L3("Blockchain::" << __func__); // check for treasury payouts + const uint64_t height = boost::get(b.miner_tx.vin[0]).height; const auto treasury_payout_data = get_config(m_nettype).TREASURY_SAL1_MINT_OUTPUT_DATA; const bool treasury_payout_exists = (treasury_payout_data.count(height) == 1); size_t treasury_index_in_tx_outputs = 0; @@ -5157,7 +5151,7 @@ leave: TIME_MEASURE_START(vmt); uint64_t base_reward = 0; uint64_t already_generated_coins = blockchain_height ? m_db->get_block_already_generated_coins(blockchain_height - 1) : 0; - if(!validate_miner_transaction(bl, blockchain_height, cumulative_block_weight, fee_summary, base_reward, already_generated_coins, bvc.m_partial_block_reward, m_hardfork->get_current_version())) + if(!validate_miner_transaction(bl, cumulative_block_weight, fee_summary, base_reward, already_generated_coins, bvc.m_partial_block_reward, m_hardfork->get_current_version())) { MERROR_VER("Block with id: " << id << " has incorrect miner transaction"); bvc.m_verifivation_failed = true; diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index bb00ece7a..a393b735b 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -1546,7 +1546,7 @@ namespace cryptonote * * @return false if anything is found wrong with the miner transaction, otherwise true */ - bool validate_miner_transaction(const block& b, const uint64_t height, size_t cumulative_block_weight, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version); + bool validate_miner_transaction(const block& b, size_t cumulative_block_weight, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins, bool &partial_block_reward, uint8_t version); /** * @brief validates a protocol (coinbase) transaction diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index e3e935692..b54de211f 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -337,34 +337,6 @@ namespace cryptonote } */ //--------------------------------------------------------------- - std::tuple check_treasury_payout( - network_type nettype, - uint64_t height, - const std::vector& hardforks, - const uint8_t hf_version - ) { - if (hf_version >= HF_VERSION_CARROT) { - // find the hardfork height - const auto& hf = std::find_if(hardforks.begin(), hardforks.end(), [](const hardfork_t& hf) { - return hf.version == HF_VERSION_CARROT; - }); - - // since we are at least at the hard fork HF_VERSION_CARROT, we assume height >= hf->height - const auto diff = height - hf->height; - const auto mint_period = get_config(nettype).TREASURY_SAL1_MINT_PERIOD; - - // pay per period - if (diff % mint_period == 0) { - const auto payout_index = diff / mint_period; - if (payout_index < TREASURY_SAL1_MINT_COUNT) { - return {true, payout_index}; - } - } - } - - return {false, 0}; - } - //--------------------------------------------------------------- bool construct_protocol_tx( const size_t height, transaction& tx, @@ -634,28 +606,7 @@ namespace cryptonote } CHECK_AND_ASSERT_MES(summary_amounts == block_reward, false, "Failed to construct miner tx, summary_amounts = " << summary_amounts << " not equal block_reward = " << block_reward); - /* - // add the treasury payout if needed - if (treasury_payout_exist) { - std::vector additional_tx_public_keys = {txkey.pub}; - const auto output_keys = get_config(nettype).TREASURY_SAL1_MINT_OUTPUT_KEYS; - const auto keys = output_keys[treasury_payout_index]; - crypto::public_key tx_key; - CHECK_AND_ASSERT_MES(epee::string_tools::hex_to_pod(keys.first, tx_key), false, "fail to deserialize treasury tx key"); - crypto::public_key output_key; - CHECK_AND_ASSERT_MES(epee::string_tools::hex_to_pod(keys.second, output_key), false, "fail to deserialize treasury output key"); - - // Create the TX output for this payout - tx_out out; - cryptonote::set_tx_out(TREASURY_SAL1_MINT_AMOUNT, "SAL1", CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, output_key, false, crypto::view_tag{}, out); - tx.vout.push_back(out); - - // add tx pub key to tx extra - additional_tx_public_keys.push_back(tx_key); - add_additional_tx_pub_keys_to_extra(tx.extra, additional_tx_public_keys); - } - */ tx.version = 2; tx.vin.push_back(in); tx.invalidate_hashes(); diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h index e782a4a45..02506214f 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.h +++ b/src/cryptonote_core/cryptonote_tx_utils.h @@ -75,8 +75,6 @@ namespace cryptonote bool construct_protocol_tx(const size_t height, transaction& tx, std::vector& protocol_data, const uint8_t hf_version); //--------------------------------------------------------------- bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight, uint64_t fee, const account_public_address &miner_address, transaction& tx, network_type nettype = network_type::FAKECHAIN, const std::vector& hardforks = {}, const blobdata& extra_nonce = blobdata(), size_t max_outs = 999, uint8_t hard_fork_version = 1); - //--------------------------------------------------------------- - std::tuple check_treasury_payout(network_type nettype, uint64_t height, const std::vector& hardforks, const uint8_t hf_version); struct tx_source_entry { diff --git a/src/wallet/scanning_tools.cpp b/src/wallet/scanning_tools.cpp index 7b37158f0..0c200eac0 100644 --- a/src/wallet/scanning_tools.cpp +++ b/src/wallet/scanning_tools.cpp @@ -280,18 +280,6 @@ static std::optional view_incoming_scan_carrot_ res.amount_blinding_factor = rct::I; res.main_tx_pubkey_index = 0; res.is_carrot = true; - - /* - LOG_ERROR("wallet scanning values:" << std::endl << - " height : " << std::to_string(enote.block_index) << std::endl << - " Ko : " << epee::string_tools::pod_to_hex(enote.onetime_address) << std::endl << - " C_a : " << epee::string_tools::pod_to_hex(rct::commit(res.amount, res.amount_blinding_factor)) << std::endl << - " D_e : " << epee::string_tools::pod_to_hex(enote.enote_ephemeral_pubkey) << std::endl << - " s_sr : " << epee::string_tools::pod_to_hex(s_sender_receiver_unctx.data) << std::endl << - " k^o_g : " << epee::string_tools::pod_to_hex(res.sender_extension_g.data) << std::endl << - " k^o_t : " << epee::string_tools::pod_to_hex(res.sender_extension_t.data) << std::endl << - " K^j_s : " << epee::string_tools::pod_to_hex(res.address_spend_pubkey) << std::endl); - */ return res; } //------------------------------------------------------------------------------------------------------------------- @@ -887,19 +875,23 @@ std::optional try_derive_enote_key_image( // k^j_subext rct::key subaddress_extension; if (enote_scan_info.subaddr_index->index.is_subaddress()) - { + { const cryptonote::subaddress_index subaddr_index_cn{enote_scan_info.subaddr_index->index.major, - enote_scan_info.subaddr_index->index.minor}; - subaddress_extension = rct::sk2rct(acc.get_keys().get_device().get_subaddress_secret_key(acc.get_keys().m_view_secret_key, subaddr_index_cn)); - } + enote_scan_info.subaddr_index->index.minor}; + subaddress_extension = rct::sk2rct( + acc.get_keys().get_device().get_subaddress_secret_key(acc.get_keys().m_view_secret_key, subaddr_index_cn) + ); + } else // !subaddr_index_cn.is_zero() - { + { subaddress_extension = rct::Z; - } + } // O = K^j_s + k^g_o G + k^t_o T - rct::key onetime_address = rct::scalarmultKey(rct::pk2rct(crypto::get_T()), - rct::sk2rct(enote_scan_info.sender_extension_t)); + rct::key onetime_address = rct::scalarmultKey( + rct::pk2rct(crypto::get_T()), + rct::sk2rct(enote_scan_info.sender_extension_t) + ); rct::addKeys1(onetime_address, rct::sk2rct(enote_scan_info.sender_extension_g), onetime_address); rct::addKeys(onetime_address, onetime_address, rct::pk2rct(enote_scan_info.address_spend_pubkey)); @@ -911,7 +903,6 @@ std::optional try_derive_enote_key_image( // x = k_s + k^j_subext + k^g_o rct::key x; if (enote_scan_info.is_carrot) { - return acc.derive_key_image(enote_scan_info.address_spend_pubkey, enote_scan_info.sender_extension_g, enote_scan_info.sender_extension_t, diff --git a/src/wallet/scanning_tools.h b/src/wallet/scanning_tools.h index b55c2e326..9cbd7cb1c 100644 --- a/src/wallet/scanning_tools.h +++ b/src/wallet/scanning_tools.h @@ -77,7 +77,8 @@ struct enote_view_incoming_scan_info_t // the cold signing code used to have a bug which added multiple main tx pubkeys to extra std::size_t main_tx_pubkey_index; - bool is_carrot; + // whether this output is to a carrot address or not + bool is_carrot; }; struct PreCarrotEnote diff --git a/src/wallet/tx_builder.cpp b/src/wallet/tx_builder.cpp index 4a8fbba16..f55dc6beb 100644 --- a/src/wallet/tx_builder.cpp +++ b/src/wallet/tx_builder.cpp @@ -755,6 +755,95 @@ std::vector make_carrot_transaction_proposa top_block_index); } //------------------------------------------------------------------------------------------------------------------- +bool get_address_openings_x_y( + const cryptonote::transaction &tx, + const cryptonote::tx_source_entry &src, + const wallet2 &w, + crypto::secret_key &x_out, + crypto::secret_key &y_out) +{ + const std::vector v_pubkeys{src.real_out_tx_key}; + const epee::span main_tx_ephemeral_pubkeys = + epee::to_span(v_pubkeys); + const epee::span additional_tx_ephemeral_pubkeys = + epee::to_span(src.real_out_additional_tx_keys); + + // 2. perform ECDH derivations + std::vector main_derivations; + std::vector additional_derivations; + wallet::perform_ecdh_derivations( + main_tx_ephemeral_pubkeys, + additional_tx_ephemeral_pubkeys, + w.get_account().get_keys().m_view_secret_key, + w.get_account().get_keys().get_device(), + carrot::is_carrot_transaction_v1(tx), + main_derivations, + additional_derivations + ); + + crypto::hash s_sender_receiver; + const crypto::key_derivation &kd = main_derivations.size() + ? main_derivations[0] + : additional_derivations[src.real_output_in_tx_index]; + const mx25519_pubkey s_sender_receiver_unctx = carrot::raw_byte_convert(kd); + + // ephemeral pubkeys + const epee::span enote_ephemeral_pubkeys_pk = + main_tx_ephemeral_pubkeys.empty() ? additional_tx_ephemeral_pubkeys : main_tx_ephemeral_pubkeys; + const epee::span enote_ephemeral_pubkeys = { + reinterpret_cast(enote_ephemeral_pubkeys_pk.data()), + enote_ephemeral_pubkeys_pk.size() + }; + + const bool shared_ephemeral_pubkey = enote_ephemeral_pubkeys.size() == 1; + const size_t ephemeral_pubkey_index = shared_ephemeral_pubkey ? 0 : src.real_output_in_tx_index; + + // input_context + carrot::input_context_t input_context; + if (src.coinbase) { + input_context = carrot::make_carrot_input_context_coinbase(src.block_index); + } else { + input_context = carrot::make_carrot_input_context(src.first_rct_key_image); + } + + // s^ctx_sr = H_32(s_sr, D_e, input_context) + make_carrot_sender_receiver_secret(s_sender_receiver_unctx.data, + enote_ephemeral_pubkeys[ephemeral_pubkey_index], + input_context, + s_sender_receiver); + + // get the k_og and k_ot + crypto::secret_key sender_extension_g_out; + crypto::secret_key sender_extension_t_out; + crypto::public_key address_spend_pubkey_out; + carrot::payment_id_t nominal_payment_id_out; + carrot::janus_anchor_t nominal_janus_anchor_out; + carrot::encrypted_janus_anchor_t encrypted_janus_anchor; + carrot::encrypted_payment_id_t encrypted_payment_id; + carrot::scan_carrot_dest_info( + rct::rct2pk(src.outputs[src.real_output].second.dest), + src.outputs[src.real_output].second.mask, + encrypted_janus_anchor, + encrypted_payment_id, + s_sender_receiver, + sender_extension_g_out, + sender_extension_t_out, + address_spend_pubkey_out, + nominal_payment_id_out, + nominal_janus_anchor_out + ); + bool r = w.get_account().try_searching_for_opening_for_onetime_address( + src.address_spend_pubkey, + sender_extension_g_out, + sender_extension_t_out, + x_out, + y_out + ); + CHECK_AND_ASSERT_THROW_MES(r, "Failed to obtain openings for onetime address"); + + return true; +} +//------------------------------------------------------------------------------------------------------------------- cryptonote::transaction finalize_all_proofs_from_transfer_details( const carrot::CarrotTransactionProposalV1 &tx_proposal, const cryptonote::transaction_type tx_type, @@ -843,118 +932,21 @@ cryptonote::transaction finalize_all_proofs_from_transfer_details( inSk.reserve(sources.size()); std::vector inamounts; std::vector index; - for (size_t i = 0; i < sources.size(); ++i) + for (const auto& src: sources) { - amount_in += sources[i].amount; - inamounts.push_back(sources[i].amount); - index.push_back(sources[i].real_output); + amount_in += src.amount; + inamounts.push_back(src.amount); + index.push_back(src.real_output); // inSk: (x, y, mask) rct::carrot_ctkey ctkey; - ctkey.mask = sources[i].mask; - if (sources[i].carrot) { + ctkey.mask = src.mask; + if (src.carrot) { - const std::vector v_pubkeys{sources[i].real_out_tx_key}; - const epee::span main_tx_ephemeral_pubkeys = - epee::to_span(v_pubkeys); - const epee::span additional_tx_ephemeral_pubkeys = - epee::to_span(sources[i].real_out_additional_tx_keys); - - // 2. perform ECDH derivations - std::vector main_derivations; - std::vector additional_derivations; - wallet::perform_ecdh_derivations( - main_tx_ephemeral_pubkeys, - additional_tx_ephemeral_pubkeys, - acc_keys.m_view_secret_key, - hwdev, - carrot::is_carrot_transaction_v1(tx), - main_derivations, - additional_derivations - ); - - crypto::hash s_sender_receiver; - const crypto::key_derivation &kd = main_derivations.size() - ? main_derivations[0] - : additional_derivations[sources[i].real_output_in_tx_index]; - const mx25519_pubkey s_sender_receiver_unctx = carrot::raw_byte_convert(kd); - - // ephemeral pubkeys - const epee::span enote_ephemeral_pubkeys_pk = - main_tx_ephemeral_pubkeys.empty() ? additional_tx_ephemeral_pubkeys : main_tx_ephemeral_pubkeys; - const epee::span enote_ephemeral_pubkeys = { - reinterpret_cast(enote_ephemeral_pubkeys_pk.data()), - enote_ephemeral_pubkeys_pk.size() - }; - - const bool shared_ephemeral_pubkey = enote_ephemeral_pubkeys.size() == 1; - const size_t ephemeral_pubkey_index = shared_ephemeral_pubkey ? 0 : sources[i].real_output_in_tx_index; - - // input_context - carrot::input_context_t input_context; - if (sources[i].coinbase) { - input_context = carrot::make_carrot_input_context_coinbase(sources[i].block_index); - } else { - input_context = carrot::make_carrot_input_context(sources[i].first_rct_key_image); - } - - // s^ctx_sr = H_32(s_sr, D_e, input_context) - make_carrot_sender_receiver_secret(s_sender_receiver_unctx.data, - enote_ephemeral_pubkeys[ephemeral_pubkey_index], - input_context, - s_sender_receiver); - - // get the k_og and k_ot - crypto::secret_key sender_extension_g_out; - crypto::secret_key sender_extension_t_out; - crypto::public_key address_spend_pubkey_out; - carrot::payment_id_t nominal_payment_id_out; - carrot::janus_anchor_t nominal_janus_anchor_out; - carrot::encrypted_janus_anchor_t encrypted_janus_anchor; - carrot::encrypted_payment_id_t encrypted_payment_id; - carrot::scan_carrot_dest_info( - rct::rct2pk(sources[i].outputs[sources[i].real_output].second.dest), - sources[i].outputs[sources[i].real_output].second.mask, - encrypted_janus_anchor, - encrypted_payment_id, - s_sender_receiver, - sender_extension_g_out, - sender_extension_t_out, - address_spend_pubkey_out, - nominal_payment_id_out, - nominal_janus_anchor_out - ); - - /* - LOG_ERROR("tx_builder values:" << std::endl << - " Ko : " << epee::string_tools::pod_to_hex(sources[i].outputs[sources[i].real_output].second.dest) << std::endl << - " C_a : " << epee::string_tools::pod_to_hex(sources[i].outputs[sources[i].real_output].second.mask) << std::endl << - " D_e : " << epee::string_tools::pod_to_hex(sources[i].real_out_tx_key) << std::endl << - " s_sr : " << epee::string_tools::pod_to_hex(s_sender_receiver_unctx.data) << std::endl << - " s^ctx_sr : " << epee::string_tools::pod_to_hex(s_sender_receiver.data) << std::endl << - " k^o_g : " << epee::string_tools::pod_to_hex(sender_extension_g_out.data) << std::endl << - " k^o_t : " << epee::string_tools::pod_to_hex(sender_extension_t_out.data) << std::endl << - " K^j_s : " << epee::string_tools::pod_to_hex(sources[i].address_spend_pubkey) << std::endl); - */ - - bool r = w.get_account().can_open_fcmp_onetime_address( - sources[i].address_spend_pubkey, - sender_extension_g_out, - sender_extension_t_out, - rct::rct2pk(sources[i].outputs[sources[i].real_output].second.dest) - ); - THROW_WALLET_EXCEPTION_IF(!r, error::wallet_internal_error, - "Failed to open onetime address"); crypto::secret_key x, y; - r = w.get_account().try_searching_for_opening_for_onetime_address( - sources[i].address_spend_pubkey, - sender_extension_g_out, - sender_extension_t_out, - x, - y - ); - THROW_WALLET_EXCEPTION_IF(!r, error::wallet_internal_error, - "Failed to obtain openings for onetime address"); + THROW_WALLET_EXCEPTION_IF(!get_address_openings_x_y(tx, src, w, x, y), + error::wallet_internal_error, "Failed to get x and y for input"); + ctkey.x = rct::sk2rct(x); ctkey.y = rct::sk2rct(y); } else { @@ -962,21 +954,21 @@ cryptonote::transaction finalize_all_proofs_from_transfer_details( cryptonote::keypair in_ephemeral; crypto::key_image img; rct::salvium_input_data_t sid; - const auto& out_key = reinterpret_cast(sources[i].outputs[sources[i].real_output].second.dest); - bool use_origin_data = (sources[i].origin_tx_data.tx_type != cryptonote::transaction_type::UNSET); - sid.origin_tx_type = sources[i].origin_tx_data.tx_type; + const auto& out_key = reinterpret_cast(src.outputs[src.real_output].second.dest); + bool use_origin_data = (src.origin_tx_data.tx_type != cryptonote::transaction_type::UNSET); + sid.origin_tx_type = src.origin_tx_data.tx_type; bool r = cryptonote::generate_key_image_helper( w.get_account().get_keys(), w.get_subaddress_map_ref(), out_key, - sources[i].real_out_tx_key, - sources[i].real_out_additional_tx_keys, - sources[i].real_output_in_tx_index, + src.real_out_tx_key, + src.real_out_additional_tx_keys, + src.real_output_in_tx_index, in_ephemeral, img, hwdev, use_origin_data, - sources[i].origin_tx_data, sid + src.origin_tx_data, sid ); THROW_WALLET_EXCEPTION_IF(!r, error::wallet_internal_error, "Failed to generate key image helper"); @@ -1035,7 +1027,7 @@ cryptonote::transaction finalize_all_proofs_from_transfer_details( change_y ); THROW_WALLET_EXCEPTION_IF(!r, error::wallet_internal_error, - "Failed to search for opening for onetime address"); + "Failed to obtain opening for onetime change address"); // mixRing indexing is done the other way round for simple rct::ctkeyM mixRing(sources.size()); diff --git a/tests/core_tests/CMakeLists.txt b/tests/core_tests/CMakeLists.txt index eb87dc76e..1b4ae8f07 100644 --- a/tests/core_tests/CMakeLists.txt +++ b/tests/core_tests/CMakeLists.txt @@ -45,8 +45,8 @@ set(core_tests_sources rct.cpp bulletproofs.cpp bulletproof_plus.cpp - rct2.cpp) -# wallet_tools.cpp) + rct2.cpp + wallet_tools.cpp) set(core_tests_headers block_reward.h @@ -67,8 +67,8 @@ set(core_tests_headers rct.h bulletproofs.h bulletproof_plus.h - rct2.h) -# wallet_tools.h) + rct2.h + wallet_tools.h) monero_add_minimal_executable(core_tests ${core_tests_sources} diff --git a/tests/core_tests/wallet_tools.cpp b/tests/core_tests/wallet_tools.cpp index 884cb88b8..0751f7314 100644 --- a/tests/core_tests/wallet_tools.cpp +++ b/tests/core_tests/wallet_tools.cpp @@ -13,7 +13,7 @@ using namespace cryptonote; void wallet_accessor_test::set_account(tools::wallet2 * wallet, cryptonote::account_base& account) { wallet->clear(); - wallet->m_account = reinterpret_cast(account); + // wallet->m_account = reinterpret_cast(account); wallet->m_key_device_type = account.get_device().get_type(); wallet->m_account_public_address = account.get_keys().m_account_address; diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 79b115cf8..25ffbd4fd 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -39,7 +39,7 @@ set(unit_tests_sources bulletproofs_plus.cpp canonical_amounts.cpp carrot_core.cpp -# carrot_impl.cpp + carrot_impl.cpp carrot_legacy.cpp carrot_mock_helpers.cpp carrot_sparc.cpp @@ -95,7 +95,7 @@ set(unit_tests_sources test_peerlist.cpp test_protocol_pack.cpp threadpool.cpp -# tx_construction_helpers.cpp + tx_construction_helpers.cpp tx_proof.cpp hardfork.cpp unbound.cpp @@ -106,9 +106,9 @@ set(unit_tests_sources output_selection.cpp vercmp.cpp ringdb.cpp -# wallet_scanning.cpp + wallet_scanning.cpp wallet_storage.cpp -# wallet_tx_builder.cpp + wallet_tx_builder.cpp wipeable_string.cpp is_hdd.cpp aligned.cpp @@ -168,6 +168,3 @@ add_test( monero_add_minimal_executable(test_notifier test_notifier.cpp) target_link_libraries(test_notifier ${EXTRA_LIBRARIES}) set_property(TARGET test_notifier PROPERTY FOLDER "tests") - -# Salvium tests -add_subdirectory(salvium) diff --git a/tests/unit_tests/wallet_scanning.cpp b/tests/unit_tests/wallet_scanning.cpp index a29ccd1fe..23eec16e6 100644 --- a/tests/unit_tests/wallet_scanning.cpp +++ b/tests/unit_tests/wallet_scanning.cpp @@ -245,16 +245,9 @@ TEST(wallet_scanning, view_scan_short_payment_id) std::vector> enote_scan_infos(tx.vout.size()); tools::keystore keystore; tools::wallet::view_incoming_scan_transaction(tx, -<<<<<<< Updated upstream - bob.get_keys(), - // {{bob_main_spend_pubkey, {}}}, // use a fake subaddress map with just the provided address in it - keystore, - epee::to_mut_span(enote_scan_infos)); -======= bob.get_keys(), keystore, epee::to_mut_span(enote_scan_infos)); ->>>>>>> Stashed changes bool matched = false; for (const auto &enote_scan_info : enote_scan_infos)