From 278654276efd1d7ee970463620a4b79eab47beea Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 1 Oct 2023 14:24:39 +0000 Subject: [PATCH] Added ZEPH fork support --- package.json | 2 +- src/cryptonote_core/cryptonote_basic.h | 21 ++- src/serialization/zephyr_pricing_record.h | 78 +++++++-- src/zephyr_oracle/pricing_record.cpp | 183 +++++++++++++++++----- src/zephyr_oracle/pricing_record.h | 49 +++++- 5 files changed, 283 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 97cbc6a..c81d8a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cryptoforknote-util", - "version": "15.1.0", + "version": "15.2.0", "main": "cryptoforknote-util", "author": { "name": "LucasJones", diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index fef4d7f..8de387b 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -957,7 +957,26 @@ namespace cryptonote if (blob_type == BLOB_TYPE_CRYPTONOTE_TUBE) FIELD(cycle40) if (blob_type == BLOB_TYPE_CRYPTONOTE_XTA) FIELD(cycle48) if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) FIELD(pricing_record) - if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) FIELD_N("pricing_record", zephyr_pricing_record) + if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { + if (major_version >= 3) + { + FIELD_N("pricing_record", zephyr_pricing_record) + } + else + { + zephyr_oracle::pricing_record_v1 pr_v1; + if (!typename Archive::is_saving()) + { + FIELD(pr_v1) + pr_v1.write_to_pr(zephyr_pricing_record); + } + else + { + pr_v1.read_from_pr(zephyr_pricing_record); + FIELD(pr_v1) + } + } + } if (blob_type == BLOB_TYPE_CRYPTONOTE_XLA && major_version >= 13) FIELD(signature) END_SERIALIZE() diff --git a/src/serialization/zephyr_pricing_record.h b/src/serialization/zephyr_pricing_record.h index e40572b..df8302f 100644 --- a/src/serialization/zephyr_pricing_record.h +++ b/src/serialization/zephyr_pricing_record.h @@ -40,16 +40,33 @@ template