File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,33 @@ class CDeterministicMNStateDiffLegacy
356356 s >> *this ;
357357 }
358358
359+ // Used for testing only
360+ template <typename Stream>
361+ void Serialize (Stream& s) const
362+ {
363+ s << VARINT (fields);
364+
365+ boost::hana::for_each (legacy_members, [&](auto && member) {
366+ using BaseType = std::decay_t <decltype (member)>;
367+ if constexpr (BaseType::mask == LegacyField_pubKeyOperator) {
368+ if (fields & member.mask ) {
369+ // We serialize it as is, no version wrapper is used here
370+ s << state.pubKeyOperator ;
371+ }
372+ } else if constexpr (BaseType::mask == LegacyField_netInfo) {
373+ if (fields & member.mask ) {
374+ // Legacy format supports non-extended addresses only
375+ s << NetInfoSerWrapper (const_cast <std::shared_ptr<NetInfoInterface>&>(state.netInfo ),
376+ /* is_extended=*/ false );
377+ }
378+ } else {
379+ if (fields & member.mask ) {
380+ s << member.get (state);
381+ }
382+ }
383+ });
384+ }
385+
359386 // Deserialize using legacy format
360387 template <typename Stream>
361388 void Unserialize (Stream& s)
You can’t perform that action at this time.
0 commit comments