diff --git a/lib_embedded_protocol_alpha/src/services_registration.ml b/lib_embedded_protocol_alpha/src/services_registration.ml index 99c055555..d95f83342 100644 --- a/lib_embedded_protocol_alpha/src/services_registration.ml +++ b/lib_embedded_protocol_alpha/src/services_registration.ml @@ -26,7 +26,7 @@ let rpc_init Tezos_context.init ~level ~timestamp ~fitness context >>=? fun context -> return { block_hash ; block_header ; operation_hashes ; operations ; context } -let rpc_services = ref (RPC.Directory.empty : Updater.rpc_context RPC.directory) +let rpc_services = ref (RPC.Directory.empty : Updater.rpc_context RPC.Directory.t) let register0_fullctxt s f = rpc_services := diff --git a/lib_embedded_protocol_demo/src/services.ml b/lib_embedded_protocol_demo/src/services.ml index 2463b6e0f..a25f8f33b 100644 --- a/lib_embedded_protocol_demo/src/services.ml +++ b/lib_embedded_protocol_demo/src/services.ml @@ -49,7 +49,7 @@ let failing_service custom_root = ~error: Data_encoding.empty RPC.Path.(custom_root / "failing") -let rpc_services : Updater.rpc_context RPC.directory = +let rpc_services : Updater.rpc_context RPC.Directory.t = let dir = RPC.Directory.empty in let dir = RPC.register diff --git a/lib_embedded_protocol_genesis/src/services.ml b/lib_embedded_protocol_genesis/src/services.ml index 2b8abd987..1cffda146 100644 --- a/lib_embedded_protocol_genesis/src/services.ml +++ b/lib_embedded_protocol_genesis/src/services.ml @@ -60,7 +60,7 @@ let int64_to_bytes i = let operations_hash = Operation_list_list_hash.compute [] -let rpc_services : Updater.rpc_context RPC.directory = +let rpc_services : Updater.rpc_context RPC.Directory.t = let dir = RPC.Directory.empty in let dir = RPC.register diff --git a/lib_node_http/RPC_server.ml b/lib_node_http/RPC_server.ml index 181d6aca8..56d10877e 100644 --- a/lib_node_http/RPC_server.ml +++ b/lib_node_http/RPC_server.ml @@ -50,8 +50,6 @@ let octet_stream = { (* Compatibility layer, to be removed ASAP. *) -type 'a directory = 'a Directory.t - let empty = Directory.empty let register d s f = Directory.register d s (fun p () i -> f p i) diff --git a/lib_node_http/RPC_server.mli b/lib_node_http/RPC_server.mli index 5b8d9a1ea..898b60d33 100644 --- a/lib_node_http/RPC_server.mli +++ b/lib_node_http/RPC_server.mli @@ -46,36 +46,34 @@ val shutdown : server -> unit Lwt.t (** Compatibility layer, to be removed ASAP. *) -type 'a directory = 'a Directory.t -val empty: 'a directory val register: - 'prefix directory -> + 'prefix Directory.t -> ([`POST], 'prefix, 'params, unit, 'input, 'output, unit) RPC.Service.t -> ('params -> 'input -> [< ('output, unit) RestoDirectory.Answer.t ] Lwt.t) -> - 'prefix directory + 'prefix Directory.t val register0: - unit directory -> + unit Directory.t -> ([`POST], unit, unit, unit, 'i, 'o, unit) RPC.Service.t -> ('i -> [< ('o, unit) Answer.t ] Lwt.t) -> - unit directory + unit Directory.t val register1: - 'prefix directory -> + 'prefix Directory.t -> ([`POST], 'prefix, unit * 'a, unit, 'i, 'o, unit) RPC.Service.t -> ('a -> 'i -> [< ('o, unit) Answer.t ] Lwt.t) -> - 'prefix directory + 'prefix Directory.t val register2: - 'prefix directory -> + 'prefix Directory.t -> ([`POST], 'prefix, (unit * 'a) * 'b, unit, 'i, 'o, unit) RPC.Service.t -> ('a -> 'b -> 'i -> [< ('o, unit) Answer.t ] Lwt.t) -> - 'prefix directory + 'prefix Directory.t val register_dynamic_directory1: ?descr:string -> - 'prefix directory -> + 'prefix Directory.t -> ('prefix, unit * 'a) RPC.Path.path -> - ('a -> (unit * 'a) directory Lwt.t) -> - 'prefix directory + ('a -> (unit * 'a) Directory.t Lwt.t) -> + 'prefix Directory.t diff --git a/lib_node_shell/node.mli b/lib_node_shell/node.mli index 1a1565981..84abacb42 100644 --- a/lib_node_shell/node.mli +++ b/lib_node_shell/node.mli @@ -89,7 +89,7 @@ module RPC : sig t -> (Protocol_hash.t * Protocol.t) Lwt_stream.t * Lwt_watcher.stopper val context_dir: - t -> block -> 'a RPC_server.directory option Lwt.t + t -> block -> 'a RPC_server.Directory.t option Lwt.t val preapply: t -> block -> @@ -98,7 +98,7 @@ module RPC : sig (Block_header.shell_header * error Preapply_result.t) tzresult Lwt.t val context_dir: - t -> block -> 'a RPC_server.directory option Lwt.t + t -> block -> 'a RPC_server.Directory.t option Lwt.t val complete: t -> ?block:block -> string -> string list Lwt.t diff --git a/lib_node_shell/node_rpc.ml b/lib_node_shell/node_rpc.ml index 1333c942b..635090bb0 100644 --- a/lib_node_shell/node_rpc.ml +++ b/lib_node_shell/node_rpc.ml @@ -140,7 +140,7 @@ let register_bi_dir node dir = dir let ops_dir _node = - let ops_dir = RPC_server.empty in + let ops_dir = RPC_server.Directory.empty in ops_dir let rec insert_future_block (bi: Services.Blocks.block_info) = function @@ -369,7 +369,7 @@ let get_protocols node hash () = | Error _ -> raise Not_found let build_rpc_directory node = - let dir = RPC_server.empty in + let dir = RPC_server.Directory.empty in let dir = RPC_server.register0 dir Services.Blocks.list (list_blocks node) in let dir = @@ -381,7 +381,7 @@ let build_rpc_directory node = Node.RPC.context_dir node block >>= function | None -> Lwt.fail Not_found | Some context_dir -> Lwt.return context_dir) - (fun _ -> Lwt.return RPC_server.empty) in + (fun _ -> Lwt.return RPC_server.Directory.empty) in RPC_server.register_dynamic_directory1 ~descr: "All the RPCs which are specific to the protocol version." diff --git a/lib_node_shell/node_rpc.mli b/lib_node_shell/node_rpc.mli index 2f7b2603f..46b9904ed 100644 --- a/lib_node_shell/node_rpc.mli +++ b/lib_node_shell/node_rpc.mli @@ -7,4 +7,4 @@ (* *) (**************************************************************************) -val build_rpc_directory: Node.t -> unit RPC_server.directory +val build_rpc_directory: Node.t -> unit RPC_server.Directory.t diff --git a/lib_node_updater/updater.ml b/lib_node_updater/updater.ml index d04f96b68..a34908ec6 100644 --- a/lib_node_updater/updater.ml +++ b/lib_node_updater/updater.ml @@ -153,7 +153,7 @@ module type RAW_PROTOCOL = sig validation_state -> operation -> validation_state tzresult Lwt.t val finalize_block: validation_state -> validation_result tzresult Lwt.t - val rpc_services: rpc_context RPC_server.directory + val rpc_services: rpc_context RPC_server.Directory.t val configure_sandbox: Context.t -> Data_encoding.json option -> Context.t tzresult Lwt.t end diff --git a/lib_node_updater/updater.mli b/lib_node_updater/updater.mli index ba859ecd9..be5536dc2 100644 --- a/lib_node_updater/updater.mli +++ b/lib_node_updater/updater.mli @@ -67,7 +67,7 @@ module type RAW_PROTOCOL = sig validation_state -> operation -> validation_state tzresult Lwt.t val finalize_block: validation_state -> validation_result tzresult Lwt.t - val rpc_services: rpc_context RPC_server.directory + val rpc_services: rpc_context RPC_server.Directory.t val configure_sandbox: Context.t -> Data_encoding.json option -> Context.t tzresult Lwt.t end diff --git a/lib_protocol_environment_sigs/v1/RPC.mli b/lib_protocol_environment_sigs/v1/RPC.mli index a35a61673..3cdc8a2ca 100644 --- a/lib_protocol_environment_sigs/v1/RPC.mli +++ b/lib_protocol_environment_sigs/v1/RPC.mli @@ -288,39 +288,3 @@ module Directory : sig 'prefix directory end - -(** Compatibility layer, to be removed ASAP. *) - -type 'a directory = 'a Directory.t - -val register: - 'prefix directory -> - ([ `POST ], 'prefix, - 'params, unit, 'input, - 'output, unit) Service.t -> - ('params -> 'input -> [< ('output, unit) Answer.t ] Lwt.t) -> - 'prefix directory - -val register0: - unit directory -> - ([ `POST ], unit, - unit, unit, 'i, - 'o, unit) Service.t -> - ('i -> [< ('o, unit) Answer.t ] Lwt.t) -> - unit directory - -val register1: - 'prefix directory -> - ([ `POST ], 'prefix, - unit * 'a, unit, 'i, - 'o, unit) Service.t -> - ('a -> 'i -> [< ('o, unit) Answer.t ] Lwt.t) -> - 'prefix directory - -val register2: - 'prefix directory -> - ([ `POST ], 'prefix, - (unit * 'a) * 'b, unit, 'i, - 'o, unit) Service.t -> - ('a -> 'b -> 'i -> [< ('o, unit) Answer.t ] Lwt.t) -> - 'prefix directory diff --git a/lib_protocol_environment_sigs/v1/updater.mli b/lib_protocol_environment_sigs/v1/updater.mli index eda45acaa..d0c5c899d 100644 --- a/lib_protocol_environment_sigs/v1/updater.mli +++ b/lib_protocol_environment_sigs/v1/updater.mli @@ -132,7 +132,7 @@ module type PROTOCOL = sig validation_state -> validation_result tzresult Lwt.t (** The list of remote procedures exported by this implementation *) - val rpc_services: rpc_context RPC.directory + val rpc_services: rpc_context RPC.Directory.t (** An ad-hoc context patcher. It used only for debugging protocol while running in the "sandbox" mode. This function is never used