From 2525200185e6b470c6e6cec3c3c8044a0eb0ecc0 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Mon, 27 Nov 2023 19:28:08 -0600 Subject: serialization: remove container wrappers and serialize directly Some downstream code (most notably PR https://github.com/UkoeHB/monero/pull/25) wants to use the src/serialization lib for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class field types. By serializing STL containers directly, we can abstract the serialization details away, making for much cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators, and Hashers are serializable. `std::multimap` is added to the list of serializable containers. Depends upon https://github.com/monero-project/monero/pull/9069. --- src/rpc/rpc_payment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/rpc_payment.h b/src/rpc/rpc_payment.h index 4ead5a344..a4cc6db57 100644 --- a/src/rpc/rpc_payment.h +++ b/src/rpc/rpc_payment.h @@ -148,8 +148,8 @@ namespace cryptonote template inline void serialize(t_archive &a, const unsigned int ver) { - a & m_client_info.parent(); - a & m_hashrate.parent(); + a & m_client_info; + a & m_hashrate; a & m_credits_total; a & m_credits_used; a & m_nonces_good; @@ -177,9 +177,9 @@ namespace cryptonote cryptonote::account_public_address m_address; uint64_t m_diff; uint64_t m_credits_per_hash_found; - serializable_unordered_map m_client_info; + std::unordered_map m_client_info; std::string m_directory; - serializable_map m_hashrate; + std::map m_hashrate; uint64_t m_credits_total; uint64_t m_credits_used; uint64_t m_nonces_good; -- cgit v1.2.3