From f9c4fce3985abacb3df0b2b623b642ab875557d8 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Tue, 11 Jun 2024 18:33:08 +0100 Subject: [PATCH] Stopped double-encoding the SignedOp --- side-node/src/websocket.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/side-node/src/websocket.rs b/side-node/src/websocket.rs index 67a3f89..eecafe0 100644 --- a/side-node/src/websocket.rs +++ b/side-node/src/websocket.rs @@ -32,6 +32,9 @@ impl WebSocketClient { #[async_trait] impl ezsockets::ClientExt for WebSocketClient { + // Right now we're only using the Call type for sending signed ops + // change this to an enum if we need to send other types of calls, and + // match on it. type Call = String; async fn on_text(&mut self, text: String) -> Result<(), ezsockets::Error> { @@ -47,9 +50,8 @@ impl ezsockets::ClientExt for WebSocketClient { } async fn on_call(&mut self, call: Self::Call) -> Result<(), ezsockets::Error> { - let to_send = serde_json::to_string(&call).unwrap(); - tracing::info!("sending signed op: {to_send:?}"); - self.handle.text(to_send)?; + tracing::info!("sending signed op: {call:?}"); + self.handle.text(call)?; Ok(()) } }