From 0677548653c8efcb3a51c52342e8851ccbc15e26 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Thu, 17 Aug 2023 21:46:37 +0200 Subject: [PATCH] Fixed few bugs with emmit opertion, still not working --- src/currency_core/currency_format_utils.cpp | 2 +- src/currency_core/currency_format_utils_transactions.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index 137898fa..1a152ebd 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -635,7 +635,7 @@ namespace currency crypto::point_t sum_of_pseudo_out_amount_commitments = crypto::c_point_0; // take into account newly emitted assets asset_descriptor_operation ado = AUTO_VAL_INIT(ado); - if (get_type_in_variant_container(tx.extra, ado) && ado.operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER) // @#@ TODO: Support other asset operations + if (get_type_in_variant_container(tx.extra, ado) && (ado.operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER || ado.operation_type == ASSET_DESCRIPTOR_OPERATION_EMMIT)) { // opt_amount_commitment supposed to be validated earlier in validate_asset_operation() CHECK_AND_ASSERT_MES(ado.opt_amount_commitment.has_value(), false, "opt_amount_commitment is not set"); diff --git a/src/currency_core/currency_format_utils_transactions.cpp b/src/currency_core/currency_format_utils_transactions.cpp index 2b5850fe..eeee2f8d 100644 --- a/src/currency_core/currency_format_utils_transactions.cpp +++ b/src/currency_core/currency_format_utils_transactions.cpp @@ -333,11 +333,10 @@ namespace currency if (!get_type_in_variant_container(tx.extra, *p_ado)) return false; - // TODO @#@# change to ASSET_DESCRIPTOR_OPERATION_EMMIT ! - if (p_ado->operation_type != ASSET_DESCRIPTOR_OPERATION_REGISTER) - return false; + if (p_ado->operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER || p_ado->operation_type == ASSET_DESCRIPTOR_OPERATION_EMMIT) + return true; - return true; + return false; } //--------------------------------------------------------------- // Prepapres vector of output_entry to be used in key_offsets in a transaction input: