From 32862937adea58e9848fce163aead0a3877505e5 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 5 Oct 2023 10:58:00 -0700 Subject: [PATCH] fix newHead serialization --- web3_proxy/src/app/ws.rs | 2 +- web3_proxy/src/rpcs/blockchain.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/app/ws.rs b/web3_proxy/src/app/ws.rs index c1db9e59..f060f3ff 100644 --- a/web3_proxy/src/app/ws.rs +++ b/web3_proxy/src/app/ws.rs @@ -104,7 +104,7 @@ impl Web3ProxyApp { "params": { "subscription": subscription_id, // TODO: option to include full transaction objects instead of just the hashes? - "result": subscription_web3_request.head_block, + "result": subscription_web3_request.head_block.as_ref().map(|x| &x.0), }, }); diff --git a/web3_proxy/src/rpcs/blockchain.rs b/web3_proxy/src/rpcs/blockchain.rs index 967c141a..956aec15 100644 --- a/web3_proxy/src/rpcs/blockchain.rs +++ b/web3_proxy/src/rpcs/blockchain.rs @@ -24,7 +24,7 @@ pub type BlocksByNumberCache = Cache; /// A block and its age with a less verbose serialized format #[derive(Clone, Debug, Default)] -pub struct Web3ProxyBlock(ArcBlock); +pub struct Web3ProxyBlock(pub ArcBlock); impl Serialize for Web3ProxyBlock { fn serialize(&self, serializer: S) -> Result