From 711bd43446d0f74493ae77eaf57076b0aba55c64 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 19 Apr 2024 13:05:13 +0100 Subject: [PATCH] feat: bubble up set_subscription_status --- crates/rpc-client/src/call.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/rpc-client/src/call.rs b/crates/rpc-client/src/call.rs index 327a473fe00..f00005c5d15 100644 --- a/crates/rpc-client/src/call.rs +++ b/crates/rpc-client/src/call.rs @@ -192,23 +192,28 @@ where Self { state: CallState::Prepared { request: Some(req), connection }, _pd: PhantomData } } - /// Set the request to be a non-standard subscription (i.e. not - /// "eth_subscribe"). + /// Returns `true` if the request is a subscription. /// /// # Panics /// /// Panics if called after the request has been sent. - pub fn set_is_subscription(&mut self) { - self.request_mut().meta.set_is_subscription(); + pub fn is_subscription(&self) -> bool { + self.request().meta.is_subscription() } - /// Returns `true` if the request is a subscription. + /// Set the request to be a non-standard subscription (i.e. not + /// "eth_subscribe"). /// /// # Panics /// /// Panics if called after the request has been sent. - pub fn is_subscription(&self) -> bool { - self.request().meta.is_subscription() + pub fn set_is_subscription(&mut self) { + self.request_mut().meta.set_is_subscription(); + } + + /// Set the subscription status of the request. + pub fn set_subscription_status(&mut self, status: bool) { + self.request_mut().meta.set_subscription_status(status); } /// Get a mutable reference to the params of the request.