From a0d2044b5d59f53165b5f1948c7c25162972f38a Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Wed, 17 Jan 2024 14:54:41 +0000 Subject: [PATCH] fixed a bug with serialization of the pricing record when communicating between daemon and wallet for conversions --- src/oracle/pricing_record.cpp | 9 ++++----- src/rpc/core_rpc_server.cpp | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/oracle/pricing_record.cpp b/src/oracle/pricing_record.cpp index c9dc355ef..5700c2317 100644 --- a/src/oracle/pricing_record.cpp +++ b/src/oracle/pricing_record.cpp @@ -95,7 +95,6 @@ namespace oracle pricing_record::~pricing_record() noexcept { - pr_version = 99; } bool supply_data::_load(epee::serialization::portable_storage& src, epee::serialization::section* hparent) @@ -114,8 +113,8 @@ namespace oracle bool supply_data::store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const { - assert(false); - return true; + const supply_data_serialized out{fulm, fusd}; + return out.store(dest, hparent); } bool asset_data::_load(epee::serialization::portable_storage& src, epee::serialization::section* hparent) @@ -135,8 +134,8 @@ namespace oracle bool asset_data::store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const { - assert(false); - return true; + const asset_data_serialized out{asset_type, spot_price, ma_price}; + return out.store(dest, hparent); } bool pricing_record::_load(epee::serialization::portable_storage& src, epee::serialization::section* hparent) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index d2fd516ad..2f02f05f1 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2270,6 +2270,7 @@ namespace cryptonote response.timestamp = blk.timestamp; response.prev_hash = string_tools::pod_to_hex(blk.prev_id); response.nonce = blk.nonce; + response.pricing_record = blk.pricing_record; response.orphan_status = orphan_status; response.height = height; response.depth = m_core.get_current_blockchain_height() - height - 1;