diff --git a/src/carrot_impl/CMakeLists.txt b/src/carrot_impl/CMakeLists.txt index 1d4065c..93dd262 100644 --- a/src/carrot_impl/CMakeLists.txt +++ b/src/carrot_impl/CMakeLists.txt @@ -29,9 +29,10 @@ set(carrot_impl_sources address_device_ram_borrowed.cpp address_utils_compat.cpp - carrot_tx_builder_utils.cpp - carrot_tx_format_utils.cpp + format_utils.cpp input_selection.cpp + tx_builder_outputs.cpp + tx_proposal_utils.cpp ) monero_find_all_headers(carrot_impl_headers, "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/src/carrot_impl/carrot_boost_serialization.h b/src/carrot_impl/carrot_boost_serialization.h index 176f097..86e0864 100644 --- a/src/carrot_impl/carrot_boost_serialization.h +++ b/src/carrot_impl/carrot_boost_serialization.h @@ -33,8 +33,8 @@ //local headers #include "carrot_chain_serialization.h" #include "carrot_core/payment_proposal.h" -#include "carrot_tx_builder_types.h" #include "subaddress_index.h" +#include "tx_proposal.h" //third party headers #include diff --git a/src/carrot_impl/carrot_offchain_serialization.h b/src/carrot_impl/carrot_offchain_serialization.h index 345a3f3..d016f58 100644 --- a/src/carrot_impl/carrot_offchain_serialization.h +++ b/src/carrot_impl/carrot_offchain_serialization.h @@ -31,10 +31,10 @@ //local headers #include "carrot_chain_serialization.h" #include "carrot_core/payment_proposal.h" -#include "carrot_tx_builder_types.h" #include "serialization/crypto.h" #include "serialization/optional.h" #include "subaddress_index.h" +#include "tx_proposal.h" //third party headers diff --git a/src/carrot_impl/carrot_tx_format_utils.cpp b/src/carrot_impl/format_utils.cpp similarity index 99% rename from src/carrot_impl/carrot_tx_format_utils.cpp rename to src/carrot_impl/format_utils.cpp index edd5959..126ad24 100644 --- a/src/carrot_impl/carrot_tx_format_utils.cpp +++ b/src/carrot_impl/format_utils.cpp @@ -27,7 +27,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //paired header -#include "carrot_tx_format_utils.h" +#include "format_utils.h" //local headers #include "carrot_core/enote_utils.h" diff --git a/src/carrot_impl/carrot_tx_format_utils.h b/src/carrot_impl/format_utils.h similarity index 100% rename from src/carrot_impl/carrot_tx_format_utils.h rename to src/carrot_impl/format_utils.h diff --git a/src/carrot_impl/input_selection.cpp b/src/carrot_impl/input_selection.cpp index 928b06b..de98606 100644 --- a/src/carrot_impl/input_selection.cpp +++ b/src/carrot_impl/input_selection.cpp @@ -84,19 +84,6 @@ static void stable_sort_indices_by_amount(const epee::span input_candidates, - std::vector &indices_inout) -{ - std::stable_sort(indices_inout.begin(), indices_inout.end(), - [input_candidates](const std::size_t a, const std::size_t b) -> bool - { - CARROT_CHECK_AND_THROW(a < input_candidates.size() && b < input_candidates.size(), - std::out_of_range, "input candidate index out of range"); - return input_candidates[a].block_index < input_candidates[b].block_index; - }); -} -//------------------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------------------- static std::pair input_count_for_max_usable_money( const epee::span input_candidates, const std::set &selectable_inputs, @@ -463,7 +450,7 @@ select_inputs_func_t make_single_transfer_input_selector( // Filter all dust out of subset unless ALLOW_DUST flag is provided std::set candidate_subset_filtered = input_candidate_subset; - if (!(flags * ALLOW_DUST)) + if (!(flags & ALLOW_DUST)) { const rct::xmr_amount dust_threshold = fee_by_input_count.at(n_inputs) - (n_inputs > CARROT_MIN_TX_INPUTS ? fee_by_input_count.at(n_inputs - 1) : 0); diff --git a/src/carrot_impl/input_selection.h b/src/carrot_impl/input_selection.h index b21ec93..953324d 100644 --- a/src/carrot_impl/input_selection.h +++ b/src/carrot_impl/input_selection.h @@ -29,7 +29,7 @@ #pragma once //local headers -#include "carrot_tx_builder_types.h" +#include "tx_proposal_utils.h" //third party headers diff --git a/src/carrot_impl/tx_builder_outputs.cpp b/src/carrot_impl/tx_builder_outputs.cpp new file mode 100644 index 0000000..52c957b --- /dev/null +++ b/src/carrot_impl/tx_builder_outputs.cpp @@ -0,0 +1,136 @@ +// Copyright (c) 2024, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//paired header +#include "tx_builder_outputs.h" + +//local headers +#include "carrot_core/output_set_finalization.h" +#include "cryptonote_basic/cryptonote_format_utils.h" +#include "format_utils.h" +#include "ringct/rctSigs.h" + +//third party headers + +//standard headers + +#undef MONERO_DEFAULT_LOG_CATEGORY +#define MONERO_DEFAULT_LOG_CATEGORY "carrot_impl.tbo" + +namespace carrot +{ +//------------------------------------------------------------------------------------------------------------------- +void get_output_enote_proposals_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + std::vector &output_enote_proposals_out, + encrypted_payment_id_t &encrypted_payment_id_out, + std::vector> *payment_proposal_order_out) +{ + // collect self-sends proposal cores + std::vector selfsend_payment_proposal_cores; + selfsend_payment_proposal_cores.reserve(tx_proposal.selfsend_payment_proposals.size()); + for (const auto &selfsend_payment_proposal : tx_proposal.selfsend_payment_proposals) + selfsend_payment_proposal_cores.push_back(selfsend_payment_proposal.proposal); + + // derive enote proposals + get_output_enote_proposals(tx_proposal.normal_payment_proposals, + selfsend_payment_proposal_cores, + tx_proposal.dummy_encrypted_payment_id, + s_view_balance_dev, + k_view_dev, + tx_proposal.key_images_sorted.at(0), + output_enote_proposals_out, + encrypted_payment_id_out, + payment_proposal_order_out); +} +//------------------------------------------------------------------------------------------------------------------- +void make_signable_tx_hash_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + crypto::hash &signable_tx_hash_out) +{ + //! @TODO: there's a more efficient way to do this than constructing&serializing a whole cryptonote::transaction + // HW devices will need to implement this function to sign tx proposals, and most of these devices don't have a lot of memory + + cryptonote::transaction pruned_tx; + make_pruned_transaction_from_proposal_v1(tx_proposal, + s_view_balance_dev, + k_view_dev, + pruned_tx); + + //! @TODO: better input number calculation in get_pre_mlsag_hash. possible? + pruned_tx.rct_signatures.p.pseudoOuts.resize(pruned_tx.vin.size()); + + // see cryptonote::Blockchain::expand_transaction_2() + pruned_tx.rct_signatures.message = rct::hash2rct(cryptonote::get_transaction_prefix_hash(pruned_tx)); + + hw::device &hwdev = hw::get_device("default"); + const rct::key signable_tx_hash_k = rct::get_pre_mlsag_hash(pruned_tx.rct_signatures, hwdev); + + signable_tx_hash_out = rct::rct2hash(signable_tx_hash_k); +} +//------------------------------------------------------------------------------------------------------------------- +void make_pruned_transaction_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + cryptonote::transaction &pruned_tx_out) +{ + // derive enote proposals + std::vector output_enote_proposals; + encrypted_payment_id_t encrypted_payment_id; + get_output_enote_proposals_from_proposal_v1(tx_proposal, + s_view_balance_dev, + k_view_dev, + output_enote_proposals, + encrypted_payment_id); + + // collect enotes + std::vector enotes; + enotes.reserve(output_enote_proposals.size()); + for (const RCTOutputEnoteProposal &output_enote_proposal : output_enote_proposals) + enotes.push_back(output_enote_proposal.enote); + + // serialize tx + pruned_tx_out = store_carrot_to_transaction_v1(enotes, + tx_proposal.key_images_sorted, + tx_proposal.fee, + encrypted_payment_id); + + // add extra payload and sort + if (!tx_proposal.extra.empty()) + { + std::vector sorted_extra; + pruned_tx_out.extra.insert(pruned_tx_out.extra.end(), tx_proposal.extra.cbegin(), tx_proposal.extra.cend()); + CHECK_AND_ASSERT_THROW_MES(cryptonote::sort_tx_extra(pruned_tx_out.extra, sorted_extra), + "make_pruned_transaction_from_proposal_v1: failed to sort tx extra"); + pruned_tx_out.extra = std::move(sorted_extra); + } +} +//------------------------------------------------------------------------------------------------------------------- +} //namespace carrot diff --git a/src/carrot_impl/tx_builder_outputs.h b/src/carrot_impl/tx_builder_outputs.h new file mode 100644 index 0000000..cff641f --- /dev/null +++ b/src/carrot_impl/tx_builder_outputs.h @@ -0,0 +1,59 @@ +// Copyright (c) 2025, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#pragma once + +//local headers +#include "cryptonote_basic/cryptonote_basic.h" +#include "tx_proposal.h" + +//third party headers + +//standard headers + +//forward declarations + +namespace carrot +{ +void get_output_enote_proposals_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + std::vector &output_enote_proposals_out, + encrypted_payment_id_t &encrypted_payment_id_out, + std::vector> *payment_proposal_order_out = nullptr); + +void make_signable_tx_hash_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + crypto::hash &signable_tx_hash_out); + +void make_pruned_transaction_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, + const view_balance_secret_device *s_view_balance_dev, + const view_incoming_key_device *k_view_dev, + cryptonote::transaction &pruned_tx_out); +} //namespace carrot diff --git a/src/carrot_impl/carrot_tx_builder_types.h b/src/carrot_impl/tx_proposal.h similarity index 61% rename from src/carrot_impl/carrot_tx_builder_types.h rename to src/carrot_impl/tx_proposal.h index 23e393c..a31bbe4 100644 --- a/src/carrot_impl/carrot_tx_builder_types.h +++ b/src/carrot_impl/tx_proposal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2024, The Monero Project +// Copyright (c) 2025, The Monero Project // // All rights reserved. // @@ -30,56 +30,23 @@ //local headers #include "carrot_core/payment_proposal.h" -#include "crypto/crypto.h" -#include "ringct/rctTypes.h" #include "subaddress_index.h" //third party headers -#include //standard headers -#include -#include +#include //forward declarations namespace carrot { -struct CarrotSelectedInput -{ - rct::xmr_amount amount; - crypto::key_image key_image; -}; -static inline bool operator==(const CarrotSelectedInput &a, const CarrotSelectedInput &b) -{ - return a.amount == b.amount && a.key_image == b.key_image; -} -static inline bool operator!=(const CarrotSelectedInput &a, const CarrotSelectedInput &b) -{ - return !(a == b); -} - struct CarrotPaymentProposalVerifiableSelfSendV1 { CarrotPaymentProposalSelfSendV1 proposal; subaddress_index_extended subaddr_index; }; -using select_inputs_func_t = std::function&, // absolute fee per input count - const std::size_t, // number of normal payment proposals - const std::size_t, // number of self-send payment proposals - std::vector& // selected inputs result - )>; - -using carve_fees_and_balance_func_t = std::function&, // normal payment proposals [inout] - std::vector& // selfsend payment proposals [inout] - )>; - /** * brief: CarrotTransactionProposalV1 */ @@ -94,5 +61,4 @@ struct CarrotTransactionProposalV1 std::vector extra; }; - } //namespace carrot diff --git a/src/carrot_impl/carrot_tx_builder_utils.cpp b/src/carrot_impl/tx_proposal_utils.cpp similarity index 85% rename from src/carrot_impl/carrot_tx_builder_utils.cpp rename to src/carrot_impl/tx_proposal_utils.cpp index 948972b..fb5476a 100644 --- a/src/carrot_impl/carrot_tx_builder_utils.cpp +++ b/src/carrot_impl/tx_proposal_utils.cpp @@ -27,25 +27,19 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //paired header -#include "carrot_tx_builder_utils.h" +#include "tx_proposal_utils.h" //local headers #include "carrot_core/output_set_finalization.h" -#include "carrot_tx_format_utils.h" -extern "C" -{ -#include "crypto/crypto-ops.h" -} #include "cryptonote_basic/cryptonote_format_utils.h" -#include "ringct/rctSigs.h" -#include "ringct/rctOps.h" +#include "misc_log_ex.h" //third party headers //standard headers #undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "carrot_impl" +#define MONERO_DEFAULT_LOG_CATEGORY "carrot_impl.tpu" namespace carrot { @@ -489,89 +483,4 @@ void make_carrot_transaction_proposal_v1_sweep( tx_proposal_out); } //------------------------------------------------------------------------------------------------------------------- -void get_output_enote_proposals_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - std::vector &output_enote_proposals_out, - encrypted_payment_id_t &encrypted_payment_id_out, - std::vector> *payment_proposal_order_out) -{ - // collect self-sends proposal cores - std::vector selfsend_payment_proposal_cores; - selfsend_payment_proposal_cores.reserve(tx_proposal.selfsend_payment_proposals.size()); - for (const auto &selfsend_payment_proposal : tx_proposal.selfsend_payment_proposals) - selfsend_payment_proposal_cores.push_back(selfsend_payment_proposal.proposal); - - // derive enote proposals - get_output_enote_proposals(tx_proposal.normal_payment_proposals, - selfsend_payment_proposal_cores, - tx_proposal.dummy_encrypted_payment_id, - s_view_balance_dev, - k_view_dev, - tx_proposal.key_images_sorted.at(0), - output_enote_proposals_out, - encrypted_payment_id_out, - payment_proposal_order_out); -} -//------------------------------------------------------------------------------------------------------------------- -void make_signable_tx_hash_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - crypto::hash &signable_tx_hash_out) -{ - //! @TODO: there's a more efficient way to do this than constructing&serializing a whole cryptonote::transaction - // HW devices will need to implement this function to sign tx proposals, and most of these devices don't have a lot of memory - - cryptonote::transaction pruned_tx; - make_pruned_transaction_from_proposal_v1(tx_proposal, - s_view_balance_dev, - k_view_dev, - pruned_tx); - - //! @TODO: better input number calculation in get_pre_mlsag_hash. possible? - pruned_tx.rct_signatures.p.pseudoOuts.resize(pruned_tx.vin.size()); - - hw::device &hwdev = hw::get_device("default"); - const rct::key signable_tx_hash_k = rct::get_pre_mlsag_hash(pruned_tx.rct_signatures, hwdev); - - signable_tx_hash_out = rct::rct2hash(signable_tx_hash_k); -} -//------------------------------------------------------------------------------------------------------------------- -void make_pruned_transaction_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - cryptonote::transaction &pruned_tx_out) -{ - // derive enote proposals - std::vector output_enote_proposals; - encrypted_payment_id_t encrypted_payment_id; - get_output_enote_proposals_from_proposal_v1(tx_proposal, - s_view_balance_dev, - k_view_dev, - output_enote_proposals, - encrypted_payment_id); - - // collect enotes - std::vector enotes; - enotes.reserve(output_enote_proposals.size()); - for (const RCTOutputEnoteProposal &output_enote_proposal : output_enote_proposals) - enotes.push_back(output_enote_proposal.enote); - - // serialize tx - pruned_tx_out = store_carrot_to_transaction_v1(enotes, - tx_proposal.key_images_sorted, - tx_proposal.fee, - encrypted_payment_id); - - // add extra payload and sort - if (!tx_proposal.extra.empty()) - { - std::vector sorted_extra; - pruned_tx_out.extra.insert(pruned_tx_out.extra.end(), tx_proposal.extra.cbegin(), tx_proposal.extra.cend()); - CHECK_AND_ASSERT_THROW_MES(cryptonote::sort_tx_extra(pruned_tx_out.extra, sorted_extra), - "make_pruned_transaction_from_proposal_v1: failed to sort tx extra"); - pruned_tx_out.extra = std::move(sorted_extra); - } -} -//------------------------------------------------------------------------------------------------------------------- } //namespace carrot diff --git a/src/carrot_impl/carrot_tx_builder_utils.h b/src/carrot_impl/tx_proposal_utils.h similarity index 72% rename from src/carrot_impl/carrot_tx_builder_utils.h rename to src/carrot_impl/tx_proposal_utils.h index 9b6a5dd..6d9b9a6 100644 --- a/src/carrot_impl/carrot_tx_builder_utils.h +++ b/src/carrot_impl/tx_proposal_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2024, The Monero Project +// Copyright (c) 2025, The Monero Project // // All rights reserved. // @@ -29,10 +29,10 @@ #pragma once //local headers -#include "carrot_tx_builder_types.h" -#include "cryptonote_basic/cryptonote_basic.h" +#include "tx_proposal.h" //third party headers +#include //standard headers #include @@ -41,6 +41,34 @@ namespace carrot { +struct CarrotSelectedInput +{ + rct::xmr_amount amount; + crypto::key_image key_image; +}; +static inline bool operator==(const CarrotSelectedInput &a, const CarrotSelectedInput &b) +{ + return a.amount == b.amount && a.key_image == b.key_image; +} +static inline bool operator!=(const CarrotSelectedInput &a, const CarrotSelectedInput &b) +{ + return !(a == b); +} + +using select_inputs_func_t = std::function&, // absolute fee per input count + const std::size_t, // number of normal payment proposals + const std::size_t, // number of self-send payment proposals + std::vector& // selected inputs result + )>; + +using carve_fees_and_balance_func_t = std::function&, // normal payment proposals [inout] + std::vector& // selfsend payment proposals [inout] + )>; std::uint64_t get_carrot_default_tx_extra_size(const std::size_t n_outputs); @@ -84,21 +112,4 @@ void make_carrot_transaction_proposal_v1_sweep( const subaddress_index_extended &change_address_index, CarrotTransactionProposalV1 &tx_proposal_out); -void get_output_enote_proposals_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - std::vector &output_enote_proposals_out, - encrypted_payment_id_t &encrypted_payment_id_out, - std::vector> *payment_proposal_order_out = nullptr); - -void make_signable_tx_hash_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - crypto::hash &signable_tx_hash_out); - -void make_pruned_transaction_from_proposal_v1(const CarrotTransactionProposalV1 &tx_proposal, - const view_balance_secret_device *s_view_balance_dev, - const view_incoming_key_device *k_view_dev, - cryptonote::transaction &pruned_tx_out); - } //namespace carrot diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 561cdb8..1e6d521 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -35,7 +35,7 @@ #include "string_tools.h" using namespace epee; -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" #include "common/apply_permutation.h" #include "cryptonote_tx_utils.h" #include "cryptonote_config.h" diff --git a/src/wallet/scanning_tools.cpp b/src/wallet/scanning_tools.cpp index 7472b06..775a9d4 100644 --- a/src/wallet/scanning_tools.cpp +++ b/src/wallet/scanning_tools.cpp @@ -35,7 +35,7 @@ #include "carrot_core/enote_utils.h" #include "carrot_core/lazy_amount_commitment.h" #include "carrot_core/scan.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" #include "common/container_helpers.h" #include "crypto/generators.h" #include "cryptonote_basic/cryptonote_format_utils.h" diff --git a/src/wallet/tx_builder.cpp b/src/wallet/tx_builder.cpp index 206afcd..f746f72 100644 --- a/src/wallet/tx_builder.cpp +++ b/src/wallet/tx_builder.cpp @@ -33,8 +33,8 @@ #include "carrot_core/config.h" #include "carrot_core/device_ram_borrowed.h" #include "carrot_core/enote_utils.h" -#include "carrot_impl/carrot_tx_builder_utils.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/tx_builder_outputs.h" +#include "carrot_impl/format_utils.h" #include "carrot_impl/input_selection.h" #include "cryptonote_basic/cryptonote_format_utils.h" #include "common/container_helpers.h" diff --git a/src/wallet/tx_builder.h b/src/wallet/tx_builder.h index 9cbb62c..52adfdd 100644 --- a/src/wallet/tx_builder.h +++ b/src/wallet/tx_builder.h @@ -29,7 +29,7 @@ #pragma once //local headers -#include "carrot_impl/carrot_tx_builder_types.h" +#include "carrot_impl/tx_proposal_utils.h" #include "wallet2.h" //third party headers diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 4394d11..40865a3 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -95,7 +95,7 @@ using namespace epee; #include "device/device_cold.hpp" #include "device_trezor/device_trezor.hpp" #include "net/socks_connect.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" extern "C" { diff --git a/tests/unit_tests/carrot_fcmp.cpp b/tests/unit_tests/carrot_fcmp.cpp index 45af377..b31288d 100644 --- a/tests/unit_tests/carrot_fcmp.cpp +++ b/tests/unit_tests/carrot_fcmp.cpp @@ -30,10 +30,10 @@ #include "carrot_core/output_set_finalization.h" #include "carrot_core/payment_proposal.h" -#include "carrot_impl/carrot_tx_builder_inputs.h" -#include "carrot_impl/carrot_tx_builder_utils.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" #include "carrot_impl/input_selection.h" +#include "carrot_impl/tx_builder_inputs.h" +#include "carrot_impl/tx_proposal_utils.h" #include "carrot_mock_helpers.h" #include "common/container_helpers.h" #include "crypto/generators.h" diff --git a/tests/unit_tests/carrot_impl.cpp b/tests/unit_tests/carrot_impl.cpp index 621b1bf..29bb05a 100644 --- a/tests/unit_tests/carrot_impl.cpp +++ b/tests/unit_tests/carrot_impl.cpp @@ -33,8 +33,9 @@ #include "carrot_core/exceptions.h" #include "carrot_core/output_set_finalization.h" #include "carrot_core/payment_proposal.h" -#include "carrot_impl/carrot_tx_builder_utils.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" +#include "carrot_impl/tx_builder_outputs.h" +#include "carrot_impl/tx_proposal_utils.h" #include "carrot_impl/input_selection.h" #include "carrot_mock_helpers.h" #include "common/container_helpers.h" diff --git a/tests/unit_tests/carrot_tx_builder.cpp b/tests/unit_tests/carrot_tx_builder.cpp index 860faec..e1bae4f 100644 --- a/tests/unit_tests/carrot_tx_builder.cpp +++ b/tests/unit_tests/carrot_tx_builder.cpp @@ -29,7 +29,7 @@ #include "gtest/gtest.h" #include "carrot_impl/address_device_ram_borrowed.h" -#include "carrot_impl/carrot_tx_builder_inputs.h" +#include "carrot_impl/tx_builder_inputs.h" #include "carrot_mock_helpers.h" using namespace carrot; diff --git a/tests/unit_tests/tx_construction_helpers.cpp b/tests/unit_tests/tx_construction_helpers.cpp index 29de60e..e989923 100644 --- a/tests/unit_tests/tx_construction_helpers.cpp +++ b/tests/unit_tests/tx_construction_helpers.cpp @@ -32,8 +32,9 @@ //local headers #include "carrot_core/device_ram_borrowed.h" #include "carrot_core/output_set_finalization.h" -#include "carrot_impl/carrot_tx_builder_utils.h" -#include "carrot_impl/carrot_tx_format_utils.h" +#include "carrot_impl/format_utils.h" +#include "carrot_impl/tx_builder_outputs.h" +#include "carrot_impl/tx_proposal_utils.h" #include "crypto/generators.h" #include "wallet/scanning_tools.h" diff --git a/tests/unit_tests/tx_construction_helpers.h b/tests/unit_tests/tx_construction_helpers.h index 4d51470..398ae71 100644 --- a/tests/unit_tests/tx_construction_helpers.h +++ b/tests/unit_tests/tx_construction_helpers.h @@ -29,7 +29,8 @@ #pragma once //local headers -#include "carrot_impl/carrot_tx_builder_types.h" +#include "carrot_core/payment_proposal.h" +#include "carrot_impl/tx_proposal.h" #include "cryptonote_core/cryptonote_tx_utils.h" //third party headers diff --git a/tests/unit_tests/wallet_scanning.cpp b/tests/unit_tests/wallet_scanning.cpp index 2ca53db..f9042a5 100644 --- a/tests/unit_tests/wallet_scanning.cpp +++ b/tests/unit_tests/wallet_scanning.cpp @@ -29,7 +29,6 @@ #include "gtest/gtest.h" #include "carrot_impl/address_device_ram_borrowed.h" -#include "carrot_impl/carrot_tx_builder_inputs.h" #include "carrot_mock_helpers.h" #include "cryptonote_basic/cryptonote_basic_impl.h" #include "fake_pruned_blockchain.h"