Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinOndejka committed Dec 2, 2024
1 parent 6f8f4f1 commit 9270c42
Showing 1 changed file with 6 additions and 52 deletions.
58 changes: 6 additions & 52 deletions src/app/zeko/sequencer/archive_relay/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9270c42

Please sign in to comment.