From a22d79f761893dd3f6b7996dee4e50dcfacdcbe1 Mon Sep 17 00:00:00 2001 From: SCARYGOOSE <81907382+RadGoodNowYT@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:54:55 +0400 Subject: [PATCH] Update zephyr-cryptoforknote-util --- .../cryptonote_core/cryptonote_basic.h | 18 ++++- .../serialization/zephyr_pricing_record.h | 75 ++++++++++++++++--- .../zephyr_oracle/pricing_record.cpp | 52 ++++++++++--- .../zephyr_oracle/pricing_record.h | 61 ++++++++++++++- 4 files changed, 179 insertions(+), 27 deletions(-) diff --git a/src/Native/libcryptonote/cryptonote_core/cryptonote_basic.h b/src/Native/libcryptonote/cryptonote_core/cryptonote_basic.h index da8ff08bc..4b07d0e1d 100644 --- a/src/Native/libcryptonote/cryptonote_core/cryptonote_basic.h +++ b/src/Native/libcryptonote/cryptonote_core/cryptonote_basic.h @@ -659,10 +659,24 @@ namespace cryptonote if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) FIELD(pricing_record) if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { - if (major_version >= 3) + if (major_version >= 4) { FIELD_N("pricing_record", zephyr_pricing_record) } + else if (major_version >= 3) + { + zephyr_oracle::pricing_record_v2 pr_v2; + if (!typename Archive::is_saving()) + { + FIELD(pr_v2) + pr_v2.write_to_pr(zephyr_pricing_record); + } + else + { + pr_v2.read_from_pr(zephyr_pricing_record); + FIELD(pr_v2) + } + } else { zephyr_oracle::pricing_record_v1 pr_v1; @@ -777,4 +791,4 @@ VARIANT_TAG(binary_archive, cryptonote::txout_to_tagged_key, 0x3); VARIANT_TAG(binary_archive, cryptonote::txout_offshore, 0x3); VARIANT_TAG(binary_archive, cryptonote::txout_xasset, 0x5); VARIANT_TAG(binary_archive, cryptonote::transaction, 0xcc); -VARIANT_TAG(binary_archive, cryptonote::block, 0xbb); +VARIANT_TAG(binary_archive, cryptonote::block, 0xbb); \ No newline at end of file diff --git a/src/Native/libcryptonote/serialization/zephyr_pricing_record.h b/src/Native/libcryptonote/serialization/zephyr_pricing_record.h index df8302fc9..018fc454c 100644 --- a/src/Native/libcryptonote/serialization/zephyr_pricing_record.h +++ b/src/Native/libcryptonote/serialization/zephyr_pricing_record.h @@ -40,31 +40,46 @@ template