diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index fb78099e3..7636f9d29 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -389,12 +389,14 @@ typedef struct circ_supply_tally { } circ_supply_tally; typedef struct yield_tx_data { + uint64_t block_height; crypto::hash tx_hash; crypto::public_key return_address; uint64_t amount; } yield_tx_data; typedef struct yield_block_data { + uint64_t block_height; uint64_t slippage_total; uint64_t locked_coins_total; uint8_t network_health_percentage; diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index 6357bc6eb..f887bd80f 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -491,69 +491,6 @@ namespace cryptonote return boost::apply_visitor(txin_signature_size_visitor(), tx_in); } - /************************************************************************/ - /* */ - /************************************************************************/ - /* - struct asset_data { - std::string asset_type; - uint64_t spot_price; - uint64_t ma_price; - - public: - - BEGIN_SERIALIZE_OBJECT() - FIELD(asset_type) - VARINT_FIELD(spot_price) - VARINT_FIELD(ma_price) - END_SERIALIZE() - }; - - inline bool operator==(const asset_data& a, const asset_data& b) noexcept - { - return (a.asset_type == b.asset_type && - a.spot_price == b.spot_price && - a.ma_price == b.ma_price); - } - - struct pricing_record - { - uint64_t pr_version; - std::vector assets; - uint64_t timestamp; - std::string signature; - - public: - - //! 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; - - inline uint64_t operator[](const std::string& asset_type) const - { - return 0; - } - - inline bool operator==(const pricing_record& other) noexcept - { - return ((pr_version == other.pr_version) && - (assets == other.assets) && - (timestamp == other.timestamp) && - (signature == other.signature)); - } - - - BEGIN_SERIALIZE_OBJECT() - VARINT_FIELD(pr_version) - FIELD(assets) - VARINT_FIELD(timestamp) - FIELD(signature) - END_SERIALIZE() - }; - */ - /************************************************************************/ /* */ /************************************************************************/ diff --git a/src/cryptonote_basic/cryptonote_boost_serialization.h b/src/cryptonote_basic/cryptonote_boost_serialization.h index 753e359f6..c6aa00c6d 100644 --- a/src/cryptonote_basic/cryptonote_boost_serialization.h +++ b/src/cryptonote_basic/cryptonote_boost_serialization.h @@ -200,6 +200,13 @@ namespace boost } } + template + inline void serialize(Archive &a, oracle::supply_data &sd, const boost::serialization::version_type ver) + { + a & sd.fulm; + a & sd.fusd; + } + template inline void serialize(Archive &a, oracle::asset_data &ad, const boost::serialization::version_type ver) { @@ -212,6 +219,8 @@ namespace boost inline void serialize(Archive &a, oracle::pricing_record &pr, const boost::serialization::version_type ver) { a & pr.pr_version; + a & pr.height; + a & pr.supply; a & pr.assets; a & pr.timestamp; a & pr.signature; diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index ce97c20a4..d490fab79 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -260,11 +260,7 @@ namespace config 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10 } }; // Bender's nightmare - //std::string const GENESIS_TX = "023c01ff000180c09e90acbb1402ba4fcfcff0d4a91441c87615e514be3938e173179ac34a7fc98c0286e7320fdc0446554c4d3c0000000000000021019e809607ceda9ae7ae6755e05bcdc9c555acc8e95dcaede402eca1166a032e1a0100000000000000000000000000000000000000000000000000000000000000000000000000"; - //M2 - //std::string const GENESIS_TX = "023c01ff000180c09e90acbb1402ae6cfc932cab508d92455942efbb2ec5a8632e33ff6bcac04a8e31be271efb8c0446554c4d3c0000000000000021015a71ac0441d4ee3f321df5ffd4bd3d0f04755152e7e6485a3b6c965356cb92ed0100000000000000000000000000000000000000000000000000000000000000000000000000"; - //M3 - std::string const GENESIS_TX = "020001ff000180c09e90acbb1402fd5c232c394e6ea4e99672cae46d28b0dc56e1883637fc9445018b1e282901000446554c4d3c0000000000000021017c46e0a3f65ec0de58a78350f6dceddd77a9a1bebf94685009a7c7e5e2cdc8ce0100000000000000000000000000000000000000000000000000000000000000000000000000"; + std::string const GENESIS_TX = "020001ff000180c09e90acbb1402e8ee31433aa5ef7eb19af9740660381fe858b541d8c87e5ed38044d061c7072c0446554c4d3c0000000000000021019d1150e5f49422643dfeab470b89c6266f2b1b4469ab969f3bfba0bed74bcd1f0100000000000000000000000000000000000000000000000000000000000000000000000000"; uint32_t const GENESIS_NONCE = 10000; diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index dd6af6121..d969233e1 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2706,19 +2706,19 @@ bool Blockchain::get_pricing_record(oracle::pricing_record &pr, std::map& dest, const std::pair>& entry); -//void fromJsonValue(const rapidjson::Value& val, std::pair>& entry); void toJsonValue(rapidjson::Writer& dest, const oracle::supply_data& supply_data); void fromJsonValue(const rapidjson::Value& val, oracle::supply_data& supply_data); void toJsonValue(rapidjson::Writer& dest, const oracle::asset_data& asset_data); diff --git a/src/serialization/pricing_record.h b/src/serialization/pricing_record.h index 27674035e..3e7cf02c4 100644 --- a/src/serialization/pricing_record.h +++ b/src/serialization/pricing_record.h @@ -39,21 +39,27 @@ // read template