From b50579ea3a9376d2502784f064f3bcf76d87d7f6 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 7 Jun 2023 12:04:39 -0700 Subject: [PATCH] add block caches to web3rpcs serializer --- web3_proxy/src/rpcs/many.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web3_proxy/src/rpcs/many.rs b/web3_proxy/src/rpcs/many.rs index 3abc8fb6..72f4c082 100644 --- a/web3_proxy/src/rpcs/many.rs +++ b/web3_proxy/src/rpcs/many.rs @@ -1202,7 +1202,7 @@ impl Serialize for Web3Rpcs { where S: Serializer, { - let mut state = serializer.serialize_struct("Web3Rpcs", 2)?; + let mut state = serializer.serialize_struct("Web3Rpcs", 4)?; { let by_name = self.by_name.load(); @@ -1222,12 +1222,9 @@ impl Serialize for Web3Rpcs { } } - // self.blocks_by_hash.sync(); - // self.blocks_by_number.sync(); - // state.serialize_field("block_hashes_count", &self.blocks_by_hash.entry_count())?; - // state.serialize_field("block_hashes_size", &self.blocks_by_hash.weighted_size())?; - // state.serialize_field("block_numbers_count", &self.blocks_by_number.entry_count())?; - // state.serialize_field("block_numbers_size", &self.blocks_by_number.weighted_size())?; + state.serialize_field("blocks_by_hash", &self.blocks_by_hash)?; + state.serialize_field("blocks_by_number", &self.blocks_by_number)?; + state.end() } }