diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index baa73799..c07fc4f3 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -2105,6 +2105,25 @@ namespace currency p_result_point->to_public_key(*p_result_pub_key); } + const asset_descriptor_base& get_native_coin_asset_descriptor() + { + static asset_descriptor_base native_coin_asset_descriptor = [](){ + asset_descriptor_base adb{}; + adb.total_max_supply = UINT64_MAX; + adb.current_supply = 0; + adb.decimal_point = CURRENCY_DISPLAY_DECIMAL_POINT; + adb.ticker = CURRENCY_NAME_ABR; + adb.full_name = CURRENCY_NAME_BASE; + adb.meta_info = ""; + adb.owner = currency::null_pkey; + adb.hidden_supply = false; + adb.version = 0; + return adb; + }(); + + return native_coin_asset_descriptor; + } + bool construct_tx_handle_ado(const account_keys& sender_account_keys, const finalize_tx_param& ftp, asset_descriptor_operation& ado, diff --git a/src/currency_core/currency_format_utils.h b/src/currency_core/currency_format_utils.h index 5a2ca910..5baad2aa 100644 --- a/src/currency_core/currency_format_utils.h +++ b/src/currency_core/currency_format_utils.h @@ -329,8 +329,7 @@ namespace currency uint64_t get_tx_version(uint64_t tx_expected_block_height, const hard_forks_descriptor& hfd); // returns tx version based on the height of the block where the transaction is expected to be bool construct_tx(const account_keys& sender_account_keys, const finalize_tx_param& param, finalized_tx& result); void calculate_asset_id(const crypto::public_key& asset_owner, crypto::point_t* p_result_point, crypto::public_key* p_result_pub_key); - - + const asset_descriptor_base& get_native_coin_asset_descriptor(); bool sign_multisig_input_in_tx(currency::transaction& tx, size_t ms_input_index, const currency::account_keys& keys, const currency::transaction& source_tx, bool *p_is_input_fully_signed = nullptr);