Skip to content

Commit 870e751

Browse files
committed
fcmp++: remove Boost serialization definitions
1 parent 8c2790c commit 870e751

File tree

3 files changed

+1
-85
lines changed

3 files changed

+1
-85
lines changed

src/fcmp_pp/curve_trees.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ struct OutputPair final
9898

9999
bool operator==(const OutputPair &other) const { return output_pubkey == other.output_pubkey && commitment == other.commitment; }
100100

101-
template <class Archive>
102-
inline void serialize(Archive &a, const unsigned int ver)
103-
{
104-
a & output_pubkey;
105-
a & commitment;
106-
}
107-
108101
BEGIN_SERIALIZE_OBJECT()
109102
FIELD(output_pubkey)
110103
FIELD(commitment)
@@ -133,14 +126,6 @@ struct OutputContext final
133126

134127
bool operator==(const OutputContext &other) const { return output_id == other.output_id && output_pair == other.output_pair; }
135128

136-
template <class Archive>
137-
inline void serialize(Archive &a, const unsigned int ver)
138-
{
139-
a & output_id;
140-
a & torsion_checked;
141-
a & output_pair;
142-
}
143-
144129
BEGIN_SERIALIZE_OBJECT()
145130
FIELD(output_id)
146131
FIELD(torsion_checked)

src/fcmp_pp/tree_cache.h

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#pragma once
3030

31-
#include "common/unordered_containers_boost_serialization.h"
3231
#include "cryptonote_config.h"
3332
#include "cryptonote_basic/cryptonote_basic.h"
3433
#include "curve_trees.h"
@@ -40,9 +39,6 @@
4039
#include "serialization/serialization.h"
4140
#include "tree_sync.h"
4241

43-
#include <boost/serialization/deque.hpp>
44-
#include <boost/serialization/vector.hpp>
45-
#include <boost/serialization/version.hpp>
4642
#include <deque>
4743
#include <memory>
4844
#include <unordered_map>
@@ -72,14 +68,6 @@ struct BlockMeta final
7268
BlockHash blk_hash;
7369
uint64_t n_leaf_tuples;
7470

75-
template <class Archive>
76-
inline void serialize(Archive &a, const unsigned int ver)
77-
{
78-
a & blk_hash;
79-
a & blk_idx;
80-
a & n_leaf_tuples;
81-
}
82-
8371
BEGIN_SERIALIZE_OBJECT()
8472
FIELD(blk_idx)
8573
FIELD(blk_hash)
@@ -96,13 +84,6 @@ struct CachedLeafChunk final
9684
std::vector<OutputPair> leaves;
9785
uint64_t ref_count;
9886

99-
template <class Archive>
100-
inline void serialize(Archive &a, const unsigned int ver)
101-
{
102-
a & leaves;
103-
a & ref_count;
104-
}
105-
10687
BEGIN_SERIALIZE_OBJECT()
10788
FIELD(leaves)
10889
FIELD(ref_count)
@@ -114,13 +95,6 @@ struct CachedTreeElemChunk final
11495
std::vector<crypto::ec_point> tree_elems;
11596
uint64_t ref_count;
11697

117-
template <class Archive>
118-
inline void serialize(Archive &a, const unsigned int ver)
119-
{
120-
a & tree_elems;
121-
a & ref_count;
122-
}
123-
12498
BEGIN_SERIALIZE_OBJECT()
12599
FIELD(tree_elems)
126100
FIELD(ref_count)
@@ -135,13 +109,6 @@ struct AssignedLeafIdx final
135109
void assign_leaf(const LeafIdx idx) { leaf_idx = idx; assigned_leaf_idx = true; }
136110
void unassign_leaf() { leaf_idx = 0; assigned_leaf_idx = false; }
137111

138-
template <class Archive>
139-
inline void serialize(Archive &a, const unsigned int ver)
140-
{
141-
a & assigned_leaf_idx;
142-
a & leaf_idx;
143-
}
144-
145112
BEGIN_SERIALIZE_OBJECT()
146113
FIELD(assigned_leaf_idx)
147114
FIELD(leaf_idx)
@@ -289,18 +256,6 @@ class TreeCache final : public TreeSync<C1, C2>
289256

290257
// Serialization
291258
public:
292-
template <class Archive>
293-
inline void serialize(Archive &a, const unsigned int ver)
294-
{
295-
a & m_locked_outputs;
296-
a & m_locked_output_refs;
297-
a & m_output_count;
298-
a & m_registered_outputs;
299-
a & m_leaf_cache;
300-
a & m_tree_elem_cache;
301-
a & m_cached_blocks;
302-
}
303-
304259
BEGIN_SERIALIZE_OBJECT()
305260
VERSION_FIELD(TREE_CACHE_VERSION)
306261
FIELD(m_locked_outputs)
@@ -320,24 +275,3 @@ using TreeCacheV1 = TreeCache<Selene, Helios>;
320275
//----------------------------------------------------------------------------------------------------------------------
321276
}//namespace curve_trees
322277
}//namespace fcmp_pp
323-
324-
// Since BOOST_CLASS_VERSION does not work for templated class, implement it
325-
namespace boost
326-
{
327-
namespace serialization
328-
{
329-
template<typename C1, typename C2>
330-
struct version<fcmp_pp::curve_trees::TreeCache<C1, C2>>
331-
{
332-
typedef mpl::int_<fcmp_pp::curve_trees::TREE_CACHE_VERSION> type;
333-
typedef mpl::integral_c_tag tag;
334-
static constexpr int value = version::type::value;
335-
BOOST_MPL_ASSERT((
336-
boost::mpl::less<
337-
boost::mpl::int_<fcmp_pp::curve_trees::TREE_CACHE_VERSION>,
338-
boost::mpl::int_<256>
339-
>
340-
));
341-
};
342-
}
343-
}

src/wallet/wallet2.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,6 @@ namespace tools
900900
return;
901901
}
902902
a & m_background_sync_data;
903-
if(ver < 32)
904-
return;
905-
a & m_tree_cache;
906903
}
907904

908905
BEGIN_SERIALIZE_OBJECT()
@@ -1645,7 +1642,7 @@ namespace tools
16451642
TreeCacheV1 m_tree_cache;
16461643
};
16471644
}
1648-
BOOST_CLASS_VERSION(tools::wallet2, 32)
1645+
BOOST_CLASS_VERSION(tools::wallet2, 31)
16491646

16501647
namespace tools
16511648
{

0 commit comments

Comments
 (0)