From f75f3f8d2f8bf9a5735686875f982e014a8eb34a Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 21 Jun 2023 10:00:05 -0700 Subject: [PATCH] serialize caches in a list --- web3_proxy/src/rpcs/many.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/web3_proxy/src/rpcs/many.rs b/web3_proxy/src/rpcs/many.rs index 7cf193c2..dc876523 100644 --- a/web3_proxy/src/rpcs/many.rs +++ b/web3_proxy/src/rpcs/many.rs @@ -1327,7 +1327,7 @@ impl Serialize for Web3Rpcs { where S: Serializer, { - let mut state = serializer.serialize_struct("Web3Rpcs", 8)?; + let mut state = serializer.serialize_struct("Web3Rpcs", 6)?; { let by_name = self.by_name.read(); @@ -1347,14 +1347,13 @@ impl Serialize for Web3Rpcs { } } - state.serialize_field("blocks_by_hash", &MokaCacheSerializer(&self.blocks_by_hash))?; state.serialize_field( - "blocks_by_number", - &MokaCacheSerializer(&self.blocks_by_number), - )?; - state.serialize_field( - "pending_transaction_cache", - &MokaCacheSerializer(&self.pending_transaction_cache), + "caches", + &[ + MokaCacheSerializer(&self.blocks_by_hash), + MokaCacheSerializer(&self.blocks_by_number), + MokaCacheSerializer(&self.pending_transaction_cache), + ], )?; state.serialize_field("block_sender_len", &self.block_sender.len())?;