From 116011fdcf584115e3198ca36e6b6015e9183d93 Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 9 May 2022 17:29:25 +0200 Subject: [PATCH] tx_out_zarcanum --- src/currency_core/currency_basic.h | 27 +++++++++++++++++++ .../currency_boost_serialization.h | 9 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/currency_core/currency_basic.h b/src/currency_core/currency_basic.h index dc973a66..99cd0f96 100644 --- a/src/currency_core/currency_basic.h +++ b/src/currency_core/currency_basic.h @@ -294,6 +294,31 @@ namespace currency }; +#pragma pack(push, 1) + struct tx_out_zarcanum + { + tx_out_zarcanum() {} + + // Boost's Assignable concept + tx_out_zarcanum(const tx_out_zarcanum&) = default; + tx_out_zarcanum& operator=(const tx_out_zarcanum&) = default; + + crypto::public_key stealth_address; + crypto::public_key concealing_point; + crypto::public_key commitment; + uint64_t encrypted_amount; + + BEGIN_SERIALIZE_OBJECT() + FIELD(stealth_address) + FIELD(concealing_point) + FIELD(commitment) + FIELD(encrypted_amount) + END_SERIALIZE() + }; +#pragma pack(pop) + + typedef boost::variant tx_out_v; + struct tx_comment { @@ -814,6 +839,8 @@ SET_VARIANT_TAGS(currency::extra_alias_entry, 33, "alias_entry2"); SET_VARIANT_TAGS(currency::txin_htlc, 34, "txin_htlc"); SET_VARIANT_TAGS(currency::txout_htlc, 35, "txout_htlc"); +// Zarcanum +SET_VARIANT_TAGS(currency::tx_out_zarcanum, 36, "tx_out_zarcanum"); #undef SET_VARIANT_TAGS diff --git a/src/currency_core/currency_boost_serialization.h b/src/currency_core/currency_boost_serialization.h index 96f95bdc..9b241bec 100644 --- a/src/currency_core/currency_boost_serialization.h +++ b/src/currency_core/currency_boost_serialization.h @@ -110,7 +110,14 @@ namespace boost a & x.target; } - + template + inline void serialize(Archive &a, currency::tx_out_zarcanum &x, const boost::serialization::version_type ver) + { + a & x.stealth_address; + a & x.concealing_point; + a & x.commitment; + a & x.encrypted_amount; + } template inline void serialize(Archive &a, currency::tx_comment &x, const boost::serialization::version_type ver)