From 0289c86b59d544789cba27763aa37aac8115c1a9 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 3 Aug 2024 21:26:33 +0200 Subject: [PATCH] Make alloy_rpc_types_eth::SubscriptionResult generic over tx --- crates/rpc-types-eth/src/pubsub.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/rpc-types-eth/src/pubsub.rs b/crates/rpc-types-eth/src/pubsub.rs index da8f41563c5..d4417954a2d 100644 --- a/crates/rpc-types-eth/src/pubsub.rs +++ b/crates/rpc-types-eth/src/pubsub.rs @@ -7,7 +7,7 @@ use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; /// Subscription result. #[derive(Clone, Debug, PartialEq, Eq, Deserialize)] #[serde(untagged)] -pub enum SubscriptionResult { +pub enum SubscriptionResult { /// New block header. Header(Box), /// Log @@ -15,7 +15,7 @@ pub enum SubscriptionResult { /// Transaction hash TransactionHash(B256), /// Full Transaction - FullTransaction(Box), + FullTransaction(Box), /// SyncStatus SyncState(PubSubSyncStatus), } @@ -45,7 +45,10 @@ pub struct SyncStatusMetadata { pub highest_block: Option, } -impl Serialize for SubscriptionResult { +impl Serialize for SubscriptionResult +where + T: Serialize, +{ fn serialize(&self, serializer: S) -> Result where S: Serializer,