diff --git a/src/carrot_core/payment_proposal.cpp b/src/carrot_core/payment_proposal.cpp index a012b3fc0..e20b50504 100644 --- a/src/carrot_core/payment_proposal.cpp +++ b/src/carrot_core/payment_proposal.cpp @@ -219,6 +219,7 @@ bool operator==(const CarrotPaymentProposalV1 &a, const CarrotPaymentProposalV1 { return a.destination == b.destination && a.amount == b.amount && + a.asset_type == b.asset_type && a.randomness == b.randomness; } //------------------------------------------------------------------------------------------------------------------- @@ -228,6 +229,7 @@ bool operator==(const CarrotPaymentProposalSelfSendV1 &a, const CarrotPaymentPro a.amount == b.amount && a.enote_type == b.enote_type && a.internal_message == b.internal_message && + a.asset_type == b.asset_type && 0 == memcmp(&a.enote_ephemeral_pubkey, &b.enote_ephemeral_pubkey, sizeof(mx25519_pubkey)); } //------------------------------------------------------------------------------------------------------------------- diff --git a/src/carrot_core/payment_proposal.h b/src/carrot_core/payment_proposal.h index 4c45cc1e9..fc5deadbe 100644 --- a/src/carrot_core/payment_proposal.h +++ b/src/carrot_core/payment_proposal.h @@ -82,6 +82,8 @@ struct CarrotPaymentProposalSelfSendV1 final std::optional enote_ephemeral_pubkey; /// anchor: arbitrary, pre-encrypted message for _internal_ selfsends std::optional internal_message; + /// asset type + std::string asset_type; }; struct RCTOutputEnoteProposal diff --git a/src/carrot_core/scan.cpp b/src/carrot_core/scan.cpp index dadfe3177..0138f4469 100644 --- a/src/carrot_core/scan.cpp +++ b/src/carrot_core/scan.cpp @@ -387,6 +387,12 @@ bool try_scan_carrot_enote_external_sender(const CarrotEnoteV1 &enote, CarrotEnoteType &enote_type_out, const bool check_pid) { + epee::span main_address_spend_pubkeys; + if (destination.is_subaddress) + main_address_spend_pubkeys = {}; + else + main_address_spend_pubkeys = {&destination.address_spend_pubkey, 1}; + crypto::public_key recovered_address_spend_pubkey; payment_id_t recovered_payment_id; CarrotEnoteType recovered_enote_type; @@ -395,7 +401,7 @@ bool try_scan_carrot_enote_external_sender(const CarrotEnoteV1 &enote, if (!try_scan_carrot_enote_external_normal_checked(enote, encrypted_payment_id, s_sender_receiver_unctx, - {&destination.address_spend_pubkey, 1}, + main_address_spend_pubkeys, sender_extension_g_out, sender_extension_t_out, recovered_address_spend_pubkey, diff --git a/src/carrot_impl/tx_proposal_utils.cpp b/src/carrot_impl/tx_proposal_utils.cpp index 3cde12aab..50026fcf8 100644 --- a/src/carrot_impl/tx_proposal_utils.cpp +++ b/src/carrot_impl/tx_proposal_utils.cpp @@ -275,7 +275,8 @@ void make_carrot_transaction_proposal_v1_transfer( .proposal = CarrotPaymentProposalSelfSendV1{ .destination_address_spend_pubkey = change_address_spend_pubkey, .amount = 0, - .enote_type = add_payment_type_selfsend ? CarrotEnoteType::PAYMENT : CarrotEnoteType::CHANGE + .enote_type = add_payment_type_selfsend ? CarrotEnoteType::PAYMENT : CarrotEnoteType::CHANGE, + .asset_type = "SAL1" }, .subaddr_index = change_address_index }); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 40c21feac..b8ba4c13c 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -10116,7 +10116,9 @@ bool simple_wallet::show_transfers(const std::vector &args_) transfer.type == "burnt" ? console_color_yellow : transfer.type == "stake" ? console_color_cyan : transfer.type == "yield" ? console_color_magenta : - transfer.confirmed ? ((transfer.direction == "in" || transfer.direction == "block") ? console_color_green : console_color_white) : console_color_default; + transfer.confirmed ? + ((transfer.direction == "in" || transfer.direction == "block") ? + (transfer.asset_type == "SAL" ? console_color_green : console_color_blue) : console_color_white) : console_color_default; std::string destinations = "-"; if (!transfer.outputs.empty()) diff --git a/src/wallet/tx_builder.cpp b/src/wallet/tx_builder.cpp index 873aa4a29..8bfcd6e9d 100644 --- a/src/wallet/tx_builder.cpp +++ b/src/wallet/tx_builder.cpp @@ -151,6 +151,7 @@ static cryptonote::tx_destination_entry make_tx_destination_entry( {payment_proposal.destination.address_spend_pubkey, payment_proposal.destination.address_view_pubkey, /*m_is_carrot*/true}, payment_proposal.destination.is_subaddress); dest.is_integrated = payment_proposal.destination.payment_id != carrot::null_payment_id; + dest.asset_type = payment_proposal.asset_type; return dest; } //------------------------------------------------------------------------------------------------------------------- @@ -165,9 +166,11 @@ static cryptonote::tx_destination_entry make_tx_destination_entry( address_view_pubkey), "make_tx_destination_entry: view-key multiplication failed"); - return cryptonote::tx_destination_entry(payment_proposal.proposal.amount, + cryptonote::tx_destination_entry dest = cryptonote::tx_destination_entry(payment_proposal.proposal.amount, {payment_proposal.proposal.destination_address_spend_pubkey, address_view_pubkey, /*m_is_carrot*/true}, payment_proposal.subaddr_index.index.is_subaddress()); + dest.asset_type = payment_proposal.proposal.asset_type; + return dest; } //------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------