From 9270c427e9c34a147b4c0734d15b2eb9cf53ba13 Mon Sep 17 00:00:00 2001 From: Martin Ondejka Date: Mon, 2 Dec 2024 13:39:58 +0100 Subject: [PATCH] Remove dead code --- src/app/zeko/sequencer/archive_relay/run.ml | 58 +++------------------ 1 file changed, 6 insertions(+), 52 deletions(-) diff --git a/src/app/zeko/sequencer/archive_relay/run.ml b/src/app/zeko/sequencer/archive_relay/run.ml index 98b1160d51..eb0433f040 100644 --- a/src/app/zeko/sequencer/archive_relay/run.ml +++ b/src/app/zeko/sequencer/archive_relay/run.ml @@ -77,52 +77,6 @@ module State = struct () end -module Graphql_ws = struct - type client_message = - | Gql_connection_init - | Gql_start of - { id : int - ; query : string - ; variables : Yojson.Safe.t - ; operation_name : string option - } - - type server_message = - | Gql_connection_ack - | Gql_data of { data : Yojson.Safe.t } - | Gql_unknown of string - - let client_message_to_string = - Fn.compose Yojson.Safe.to_string (function - | Gql_connection_init -> - `Assoc [ ("type", `String "connection_init"); ("payload", `Assoc []) ] - | Gql_start { id; query; variables; operation_name } -> - `Assoc - [ ("type", `String "start") - ; ("id", `String (Int.to_string id)) - ; ( "payload" - , `Assoc - [ ("query", `String query) - ; ("variables", variables) - ; ( "operationName" - , Option.value ~default:`Null - @@ Option.map ~f:(fun s -> `String s) operation_name ) - ] ) - ] ) - - let server_message_of_string s = - let open Yojson.Safe.Util in - let json = Yojson.Safe.from_string s in - let type_ = json |> member "type" |> to_string in - match type_ with - | "connection_ack" -> - Gql_connection_ack - | "data" -> - Gql_data { data = json |> member "payload" |> member "data" } - | _ -> - Gql_unknown s -end - let sync_archive ~(state : State.t) ~hash = let logger = state.logger in let%bind.Deferred.Result diffs = @@ -190,12 +144,12 @@ let sync_archive ~(state : State.t) ~hash = let fetch_current_ledger_hash ~zeko_uri () = let query = {| - query { - stateHashes { - unprovedLedgerHash - } - } - |} + query { + stateHashes { + unprovedLedgerHash + } + } + |} in let body = Yojson.Safe.to_string