diff --git a/binding.gyp b/binding.gyp index 8795957..ff6fdd5 100644 --- a/binding.gyp +++ b/binding.gyp @@ -6,7 +6,7 @@ "src/main.cc", "src/cryptonote_core/cryptonote_format_utils.cpp", "src/offshore/pricing_record.cpp", - "src/oracle/pricing_record.cpp", + "src/zephyr_oracle/pricing_record.cpp", "src/crypto/tree-hash.c", "src/crypto/crypto.cpp", "src/crypto/crypto-ops.c", diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 57bea85..06b3beb 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -33,5 +33,5 @@ enum BLOB_TYPE { BLOB_TYPE_CRYPTONOTE_TUBE = 10, // TUBE BLOB_TYPE_CRYPTONOTE_XHV = 11, // Haven BLOB_TYPE_CRYPTONOTE_XTA = 12, // ITALO - BLOB_TYPE_CRYPTONOTE_ZEPH = 13, // ZEPH + BLOB_TYPE_CRYPTONOTE_ZEPHYR = 13, // ZEPHYR }; diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index 9dcccb3..7a7a9a5 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -16,7 +16,7 @@ #include "serialization/binary_archive.h" #include "serialization/crypto.h" #include "serialization/pricing_record.h" -#include "serialization/pricing_record_zeph.h" +#include "serialization/zephyr_pricing_record.h" #include "serialization/keyvalue_serialization.h" // eepe named serialization #include "string_tools.h" #include "cryptonote_config.h" @@ -27,7 +27,7 @@ #include "ringct/rctTypes.h" #include "cryptonote_protocol/blobdatatype.h" #include "offshore/pricing_record.h" -#include "oracle/pricing_record.h" +#include "zephyr_oracle/pricing_record.h" namespace cryptonote @@ -109,6 +109,22 @@ namespace cryptonote END_SERIALIZE() }; + // ZEPHYR + struct txout_zephyr_tagged_key + { + txout_zephyr_tagged_key() { } + txout_zephyr_tagged_key(const crypto::public_key &_key, const std::string &_asset_type, const crypto::view_tag &_view_tag) : key(_key), asset_type(_asset_type), view_tag(_view_tag) { } + crypto::public_key key; + std::string asset_type; + crypto::view_tag view_tag; // optimization to reduce scanning time + + BEGIN_SERIALIZE_OBJECT() + FIELD(key) + FIELD(asset_type) + FIELD(view_tag) + END_SERIALIZE() + }; + /* inputs */ struct txin_gen @@ -216,30 +232,14 @@ namespace cryptonote FIELD(k_image) END_SERIALIZE() }; - - struct txout_zephyr_tagged_key - { - txout_zephyr_tagged_key() { } - txout_zephyr_tagged_key(const crypto::public_key &_key, const std::string &_asset_type, const crypto::view_tag &_view_tag) : key(_key), asset_type(_asset_type), view_tag(_view_tag) { } - crypto::public_key key; - std::string asset_type; - crypto::view_tag view_tag; // optimization to reduce scanning time - - BEGIN_SERIALIZE_OBJECT() - FIELD(key) - FIELD(asset_type) - FIELD(view_tag) - END_SERIALIZE() - }; - typedef boost::variant txin_v; - - typedef boost::variant txin_zeph_v; - typedef boost::variant txout_zeph_target_v; + typedef boost::variant txin_v; typedef boost::variant txout_target_v; typedef boost::variant txout_xhv_target_v; + typedef boost::variant txout_stablero_target_v; + struct tx_out { uint64_t amount; @@ -262,10 +262,10 @@ namespace cryptonote END_SERIALIZE() }; - struct tx_out_zeph + struct tx_out_zephyr { uint64_t amount; - txout_zeph_target_v target; + txout_stablero_target_v target; BEGIN_SERIALIZE_OBJECT() VARINT_FIELD(amount) @@ -293,10 +293,9 @@ namespace cryptonote uint64_t unlock_time; //number of block (or time), used as a limitation like: spend this tx not early then block/time std::vector vin; - std::vector vin_zeph; std::vector vout; std::vector vout_xhv; - std::vector vout_zeph; + std::vector vout_zephyr; //extra std::vector extra; // Block height to use PR from @@ -335,14 +334,12 @@ namespace cryptonote } if (blob_type != BLOB_TYPE_CRYPTONOTE_XHV || version < POU_TRANSACTION_VERSION) VARINT_FIELD(unlock_time) - if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) - FIELD(vin_zeph) - else - FIELD(vin) - if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) + FIELD(vin) + + if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) + FIELD(vout_zephyr) + else if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) FIELD(vout_xhv) - else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) - FIELD(vout_zeph) else FIELD(vout) @@ -356,6 +353,11 @@ namespace cryptonote VARINT_FIELD(type) if (static_cast(type) >= loki_type_count) return false; } + if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { + VARINT_FIELD(pricing_record_height) + VARINT_FIELD(amount_burnt) + VARINT_FIELD(amount_minted) + } if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV && version >= OFFSHORE_TRANSACTION_VERSION) { VARINT_FIELD(pricing_record_height) if (version < 5) @@ -377,10 +379,6 @@ namespace cryptonote return false; } } - } else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) { - VARINT_FIELD(pricing_record_height) - VARINT_FIELD(amount_burnt) - VARINT_FIELD(amount_minted) } END_SERIALIZE() @@ -439,29 +437,22 @@ namespace cryptonote if (!vin.empty()) { ar.begin_object(); - bool r; - if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) - r = rct_signatures.serialize_rctsig_base(ar, vin.size(), vout_xhv.size()); - else if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) - r = rct_signatures.serialize_rctsig_base(ar, vin_zeph.size(), vout_zeph.size()); - else - r = rct_signatures.serialize_rctsig_base(ar, vin.size(), vout.size()); + bool r = rct_signatures.serialize_rctsig_base(ar, vin.size(), blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR ? vout_zephyr.size() : blob_type != BLOB_TYPE_CRYPTONOTE_XHV ? vout.size() : vout_xhv.size()); if (!r || !ar.stream().good()) return false; ar.end_object(); if (rct_signatures.type != rct::RCTTypeNull) { ar.tag("rctsig_prunable"); ar.begin_object(); - if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { + if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { + r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin.size(), vout_zephyr.size(), + vin[0].type() == typeid(txin_zephyr_key) ? boost::get(vin[0]).key_offsets.size() - 1 : 0); + } else if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin.size(), vout_xhv.size(), vin.size() > 0 && vin[0].type() == typeid(txin_to_key) ? boost::get(vin[0]).key_offsets.size() - 1 : vin.size() > 0 && vin[0].type() == typeid(txin_offshore) ? boost::get(vin[0]).key_offsets.size() - 1 : vin.size() > 0 && vin[0].type() == typeid(txin_onshore) ? boost::get(vin[0]).key_offsets.size() - 1 : - vin.size() > 0 && vin[0].type() == typeid(txin_xasset) ? boost::get(vin[0]).key_offsets.size() - 1 : - 0); - } else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) { - r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin_zeph.size(), vout_zeph.size(), - vin_zeph.size() > 0 && vin_zeph[0].type() == typeid(txin_zephyr_key) ? boost::get(vin_zeph[0]).key_offsets.size() - 1 : 0); + vin.size() > 0 && vin[0].type() == typeid(txin_xasset) ? boost::get(vin[0]).key_offsets.size() - 1 : 0); } else { r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin.size(), vout.size(), vin[0].type() == typeid(txin_to_key) ? boost::get(vin[0]).key_offsets.size() - 1 : 0); @@ -495,10 +486,9 @@ namespace cryptonote version = 0; unlock_time = 0; vin.clear(); - vin_zeph.clear(); vout.clear(); vout_xhv.clear(); - vout_zeph.clear(); + vout_zephyr.clear(); extra.clear(); signatures.clear(); pricing_record_height = 0; @@ -642,7 +632,7 @@ namespace cryptonote uint64_t nonce; uint64_t nonce8; offshore::pricing_record pricing_record; - oracle::pricing_record pricing_record_zeph; + zephyr_oracle::pricing_record zephyr_pricing_record; crypto::cycle cycle; crypto::cycle40 cycle40; crypto::cycle48 cycle48; @@ -654,7 +644,7 @@ namespace cryptonote FIELD(prev_id) if (blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO || blob_type == BLOB_TYPE_CRYPTONOTE_TUBE || blob_type == BLOB_TYPE_CRYPTONOTE_XTA) FIELD(nonce8) if (blob_type != BLOB_TYPE_FORKNOTE2) { - if (blob_type == BLOB_TYPE_AEON || blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) { + if (blob_type == BLOB_TYPE_AEON) { FIELD(nonce) } else { uint32_t nonce32; @@ -667,7 +657,7 @@ 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_ZEPH) FIELD(pricing_record_zeph) + if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) FIELD_N("pricing_record", zephyr_pricing_record) END_SERIALIZE() }; @@ -737,12 +727,6 @@ namespace cryptonote KV_SERIALIZE(payment_id) END_KV_SERIALIZE_MAP() }; - - struct keypair - { - crypto::public_key pub; - crypto::secret_key sec; - }; //--------------------------------------------------------------- } diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 3599def..943727f 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -185,17 +185,17 @@ namespace cryptonote { BOOST_FOREACH(const auto& in, tx.vin) { - if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { - CHECK_AND_ASSERT_MES(in.type() == typeid(txin_to_key) || in.type() == typeid(txin_offshore) || in.type() == typeid(txin_onshore) || in.type() == typeid(txin_xasset), false, "wrong variant type: " + if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { + CHECK_AND_ASSERT_MES(in.type() == typeid(txin_zephyr_key), false, "wrong variant type: " + << in.type().name() << ", expected " << typeid(txin_zephyr_key).name() + << ", in transaction id=" << get_transaction_hash(tx)); + } else if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { + CHECK_AND_ASSERT_MES(in.type() == typeid(txin_to_key) || in.type() == typeid(txin_offshore) || in.type() == typeid(txin_onshore) || in.type() == typeid(txin_xasset), false, "wrong variant type: " << in.type().name() << ", expected " << typeid(txin_to_key).name() << "or " << typeid(txin_offshore).name() << "or " << typeid(txin_onshore).name() << "or " << typeid(txin_xasset).name() - << ", in transaction id=" << get_transaction_hash(tx)); - } else if (tx.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) { - CHECK_AND_ASSERT_MES(in.type() == typeid(txin_zephyr_key), false, "wrong variant type: " - << in.type().name() << ", expected " << typeid(txin_zephyr_key).name() - << ", in transaction id=" << get_transaction_hash(tx)); + << ", in transaction id=" << get_transaction_hash(tx)); } else { CHECK_AND_ASSERT_MES(in.type() == typeid(txin_to_key), false, "wrong variant type: " << in.type().name() << ", expected " << typeid(txin_to_key).name() @@ -263,7 +263,7 @@ namespace cryptonote std::stringstream ss; binary_archive ba(ss); const size_t inputs = t.vin.size(); - const size_t outputs = t.blob_type != BLOB_TYPE_CRYPTONOTE_XHV ? t.vout.size() : t.vout_xhv.size(); + const size_t outputs = t.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR ? t.vout_zephyr.size() : t.blob_type != BLOB_TYPE_CRYPTONOTE_XHV ? t.vout.size() : t.vout_xhv.size(); bool r = tt.rct_signatures.serialize_rctsig_base(ba, inputs, outputs); CHECK_AND_ASSERT_MES(r, false, "Failed to serialize rct signatures base"); cryptonote::get_blob_hash(ss.str(), hashes[1]); @@ -279,17 +279,17 @@ namespace cryptonote std::stringstream ss; binary_archive ba(ss); const size_t inputs = t.vin.size(); - const size_t outputs = t.blob_type != BLOB_TYPE_CRYPTONOTE_XHV ? t.vout.size() : t.vout_xhv.size(); + const size_t outputs = t.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR ? t.vout_zephyr.size() : t.blob_type != BLOB_TYPE_CRYPTONOTE_XHV ? t.vout.size() : t.vout_xhv.size(); size_t mixin; - if (t.blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { + if (t.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) { + mixin = t.vin.empty() ? 0 : t.vin[0].type() == typeid(txin_zephyr_key) ? boost::get(t.vin[0]).key_offsets.size() - 1 : 0; + } else if (t.blob_type == BLOB_TYPE_CRYPTONOTE_XHV) { mixin = t.vin.empty() ? 0 : - t.vin[0].type() == typeid(txin_to_key) ? boost::get(t.vin[0]).key_offsets.size() - 1 : - t.vin[0].type() == typeid(txin_offshore) ? boost::get(t.vin[0]).key_offsets.size() - 1 : - t.vin[0].type() == typeid(txin_onshore) ? boost::get(t.vin[0]).key_offsets.size() - 1 : - t.vin[0].type() == typeid(txin_xasset) ? boost::get(t.vin[0]).key_offsets.size() - 1 : - 0; - } else if (t.blob_type == BLOB_TYPE_CRYPTONOTE_ZEPH) { - mixin = t.vin_zeph.empty() ? 0 : t.vin_zeph[0].type() == typeid(txin_to_key) ? boost::get(t.vin_zeph[0]).key_offsets.size() - 1 : 0; + t.vin[0].type() == typeid(txin_to_key) ? boost::get(t.vin[0]).key_offsets.size() - 1 : + t.vin[0].type() == typeid(txin_offshore) ? boost::get(t.vin[0]).key_offsets.size() - 1 : + t.vin[0].type() == typeid(txin_onshore) ? boost::get(t.vin[0]).key_offsets.size() - 1 : + t.vin[0].type() == typeid(txin_xasset) ? boost::get(t.vin[0]).key_offsets.size() - 1 : + 0; } else { mixin = t.vin.empty() ? 0 : t.vin[0].type() == typeid(txin_to_key) ? boost::get(t.vin[0]).key_offsets.size() - 1 : 0; } diff --git a/src/oracle/pricing_record.cpp b/src/oracle/pricing_record.cpp deleted file mode 100644 index 2cb6830..0000000 --- a/src/oracle/pricing_record.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2019, Haven Protocol -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Portions of this code based upon code Copyright (c) 2019, The Monero Project - -#include "pricing_record.h" - -#include "serialization/keyvalue_serialization.h" -#include "storages/portable_storage.h" - -#include "string_tools.h" - -#define COIN ((uint64_t)1000000000000) // pow(10, 12) - -namespace oracle -{ - - namespace - { - struct pr_serialized - { - uint64_t zEPHUSD; - uint64_t zEPHRSV; - uint64_t timestamp; - - BEGIN_KV_SERIALIZE_MAP() - KV_SERIALIZE(zEPHUSD) - KV_SERIALIZE(zEPHRSV) - KV_SERIALIZE(timestamp) - END_KV_SERIALIZE_MAP() - }; - } - - pricing_record::pricing_record() noexcept - : zEPHUSD(0) - , zEPHRSV(0) - , timestamp(0) {} - - bool pricing_record::_load(epee::serialization::portable_storage& src, epee::serialization::section* hparent) - { - pr_serialized in{}; - if (in._load(src, hparent)) - { - // Copy everything into the local instance - zEPHUSD = in.zEPHUSD; - zEPHRSV = in.zEPHRSV; - timestamp = in.timestamp; - return true; - } - - // Report error here? - return false; - } - - bool pricing_record::store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const - { - const pr_serialized out{zEPHUSD,zEPHRSV,timestamp}; - return out.store(dest, hparent); - } - - pricing_record::pricing_record(const pricing_record& orig) noexcept - : zEPHUSD(orig.zEPHUSD) - , zEPHRSV(orig.zEPHRSV) - , timestamp(orig.timestamp) {} - - pricing_record& pricing_record::operator=(const pricing_record& orig) noexcept - { - zEPHUSD = orig.zEPHUSD; - zEPHRSV = orig.zEPHRSV; - timestamp = orig.timestamp; - return *this; - } - - uint64_t pricing_record::operator[](const std::string& asset_type) const - { - if (asset_type == "ZEPH") { - return zEPHUSD; // ZEPH spot price - } else if (asset_type == "ZEPHUSD") { - return COIN; // 1 - } else if (asset_type == "ZEPHRSV") { - return zEPHRSV; // ZEPHRSV spot price - } else { - CHECK_AND_ASSERT_THROW_MES(false, "Asset type doesn't exist in pricing record!"); - } - } - - bool pricing_record::equal(const pricing_record& other) const noexcept - { - return ((zEPHUSD == other.zEPHUSD) && - (zEPHRSV == other.zEPHRSV) && - (timestamp == other.timestamp)); - } - - bool pricing_record::empty() const noexcept - { - const pricing_record empty_pr = oracle::pricing_record(); - return (*this).equal(empty_pr); - } -} \ No newline at end of file diff --git a/src/oracle/pricing_record.h b/src/oracle/pricing_record.h deleted file mode 100644 index b353318..0000000 --- a/src/oracle/pricing_record.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2019, Haven Protocol -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Portions of this code based upon code Copyright (c) 2019, The Monero Project - -#pragma once -#include "common/pod-class.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "cryptonote_config.h" -#include "crypto/hash.h" - -namespace epee -{ - namespace serialization - { - class portable_storage; - struct section; - } -} - -namespace oracle -{ - class pricing_record - { - - public: - - // Fields - uint64_t zEPHUSD; - uint64_t zEPHRSV; - uint64_t timestamp; - // Default c'tor - pricing_record() noexcept; - //! Load from epee p2p format - bool _load(epee::serialization::portable_storage& src, epee::serialization::section* hparent); - //! Store in epee p2p format - bool store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const; - pricing_record(const pricing_record& orig) noexcept; - ~pricing_record() = default; - bool equal(const pricing_record& other) const noexcept; - bool empty() const noexcept; - - pricing_record& operator=(const pricing_record& orig) noexcept; - uint64_t operator[](const std::string& asset_type) const; - }; - - inline bool operator==(const pricing_record& a, const pricing_record& b) noexcept - { - return a.equal(b); - } - - inline bool operator!=(const pricing_record& a, const pricing_record& b) noexcept - { - return !a.equal(b); - } - -} // oracle \ No newline at end of file