RPC_service: hide the 'error type parameter

This commit is contained in:
Grégoire Henry 2018-02-08 10:51:02 +01:00
parent 5c2ba214f0
commit db500b5ebd
28 changed files with 267 additions and 225 deletions

View File

@ -44,11 +44,11 @@ end
class type service_ctxt = object class type service_ctxt = object
method call_service : method call_service :
'm 'p 'q 'i 'o 'e. 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
'p -> 'q -> 'i -> 'o tzresult Lwt.t 'p -> 'q -> 'i -> 'o tzresult Lwt.t
method call_streamed_service : method call_streamed_service :
'm 'p 'q 'i 'o 'e. 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
on_chunk: ('o -> unit) -> on_chunk: ('o -> unit) ->
on_close: (unit -> unit) -> on_close: (unit -> unit) ->
'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t 'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t
@ -74,13 +74,13 @@ class http_ctxt config : ctxt =
RPC_client.generic_json_call ~logger meth ?body uri RPC_client.generic_json_call ~logger meth ?body uri
method call_service method call_service
: 'm 'p 'q 'i 'o 'e. : 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
'p -> 'q -> 'i -> 'o tzresult Lwt.t = 'p -> 'q -> 'i -> 'o tzresult Lwt.t =
fun service params query body -> fun service params query body ->
RPC_client.call_service Media_type.all_media_types ~logger ~base service params query body RPC_client.call_service Media_type.all_media_types ~logger ~base service params query body
method call_streamed_service method call_streamed_service
: 'm 'p 'q 'i 'o 'e. : 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
on_chunk: ('o -> unit) -> on_chunk: ('o -> unit) ->
on_close: (unit -> unit) -> on_close: (unit -> unit) ->
'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t = 'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t =

View File

@ -25,11 +25,11 @@ end
class type service_ctxt = object class type service_ctxt = object
method call_service : method call_service :
'm 'p 'q 'i 'o 'e. 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
'p -> 'q -> 'i -> 'o tzresult Lwt.t 'p -> 'q -> 'i -> 'o tzresult Lwt.t
method call_streamed_service : method call_streamed_service :
'm 'p 'q 'i 'o 'e. 'm 'p 'q 'i 'o 'e.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
on_chunk: ('o -> unit) -> on_chunk: ('o -> unit) ->
on_close: (unit -> unit) -> on_close: (unit -> unit) ->
'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t 'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t
@ -47,63 +47,63 @@ val call_service:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
'p, 'q, 'i, 'p, 'q, 'i,
'o, 'e) RPC_service.t -> 'o) RPC_service.t ->
'p -> 'q -> 'i -> 'o tzresult Lwt.t 'p -> 'q -> 'i -> 'o tzresult Lwt.t
val call_service0: val call_service0:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit, unit, 'i, unit, unit, 'i,
'o, 'e) RPC_service.t -> 'o) RPC_service.t ->
'i -> 'o tzresult Lwt.t 'i -> 'o tzresult Lwt.t
val call_service1: val call_service1:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit * 'a, unit, 'i, unit * 'a, unit, 'i,
'o, 'e) RPC_service.t -> 'o) RPC_service.t ->
'a -> 'i -> 'o tzresult Lwt.t 'a -> 'i -> 'o tzresult Lwt.t
val call_service2: val call_service2:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
(unit * 'a) * 'b, unit, 'i, (unit * 'a) * 'b, unit, 'i,
'o, 'e) RPC_service.t -> 'o) RPC_service.t ->
'a -> 'b -> 'i -> 'o tzresult Lwt.t 'a -> 'b -> 'i -> 'o tzresult Lwt.t
val call_streamed_service0: val call_streamed_service0:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit, unit, 'a, unit, unit, 'a,
'b, unit) RPC_service.t -> 'b) RPC_service.t ->
'a -> 'b Lwt_stream.t tzresult Lwt.t 'a -> 'b Lwt_stream.t tzresult Lwt.t
val call_streamed_service1: val call_streamed_service1:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit * 'a, unit, 'b, unit * 'a, unit, 'b,
'c, unit) RPC_service.t -> 'c) RPC_service.t ->
'a -> 'b -> 'c Lwt_stream.t tzresult Lwt.t 'a -> 'b -> 'c Lwt_stream.t tzresult Lwt.t
val call_err_service0: val call_err_service0:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit, unit, 'i, unit, unit, 'i,
'o tzresult, 'e) RPC_service.t -> 'o tzresult) RPC_service.t ->
'i -> 'o tzresult Lwt.t 'i -> 'o tzresult Lwt.t
val call_err_service1: val call_err_service1:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
unit * 'a, unit, 'i, unit * 'a, unit, 'i,
'o tzresult, 'e) RPC_service.t -> 'o tzresult) RPC_service.t ->
'a -> 'i -> 'o tzresult Lwt.t 'a -> 'i -> 'o tzresult Lwt.t
val call_err_service2: val call_err_service2:
#service_ctxt -> #service_ctxt ->
('m, unit, ('m, unit,
(unit * 'a) * 'b, unit, 'i, (unit * 'a) * 'b, unit, 'i,
'o tzresult, 'e) RPC_service.t -> 'o tzresult) RPC_service.t ->
'a -> 'b -> 'i -> 'o tzresult Lwt.t 'a -> 'b -> 'i -> 'o tzresult Lwt.t
type block = Block_services.block type block = Block_services.block

View File

@ -8,16 +8,16 @@
(**************************************************************************) (**************************************************************************)
(** Return type for service handler *) (** Return type for service handler *)
type ('o, 'e) t = type 'o t =
[ `Ok of 'o (* 200 *) [ `Ok of 'o (* 200 *)
| `OkStream of 'o stream (* 200 *) | `OkStream of 'o stream (* 200 *)
| `Created of string option (* 201 *) | `Created of string option (* 201 *)
| `No_content (* 204 *) | `No_content (* 204 *)
| `Unauthorized of 'e option (* 401 *) | `Unauthorized of unit option (* 401 *)
| `Forbidden of 'e option (* 403 *) | `Forbidden of unit option (* 403 *)
| `Not_found of 'e option (* 404 *) | `Not_found of unit option (* 404 *)
| `Conflict of 'e option (* 409 *) | `Conflict of unit option (* 409 *)
| `Error of 'e option (* 500 *) | `Error of unit option (* 500 *)
] ]
and 'a stream = { and 'a stream = {
@ -25,5 +25,5 @@ and 'a stream = {
shutdown: unit -> unit ; shutdown: unit -> unit ;
} }
val return: 'o -> ('o, 'e) t Lwt.t val return: 'o -> 'o t Lwt.t
val return_stream: 'o stream -> ('o, 'e) t Lwt.t val return_stream: 'o stream -> 'o t Lwt.t

View File

@ -35,43 +35,43 @@ exception Conflict of step list * conflict
(** Registring handler in service tree. *) (** Registring handler in service tree. *)
val register: val register:
'prefix directory -> 'prefix directory ->
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) RPC_service.t -> ('meth, 'prefix, 'params, 'query, 'input, 'output) RPC_service.t ->
('params -> 'query -> 'input -> [< ('output, 'error) RPC_answer.t ] Lwt.t) -> ('params -> 'query -> 'input -> [< 'output RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
(** Registring handler in service tree. Curryfied variant. *) (** Registring handler in service tree. Curryfied variant. *)
val register0: val register0:
unit directory -> unit directory ->
('m, unit, unit, 'q, 'i, 'o, 'e) RPC_service.t -> ('m, unit, unit, 'q, 'i, 'o) RPC_service.t ->
('q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
unit directory unit directory
val register1: val register1:
'prefix directory -> 'prefix directory ->
('m, 'prefix, unit * 'a, 'q , 'i, 'o, 'e) RPC_service.t -> ('m, 'prefix, unit * 'a, 'q , 'i, 'o) RPC_service.t ->
('a -> 'q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('a -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
val register2: val register2:
'prefix directory -> 'prefix directory ->
('m, 'prefix, (unit * 'a) * 'b, 'q , 'i, 'o, 'e) RPC_service.t -> ('m, 'prefix, (unit * 'a) * 'b, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('a -> 'b -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
val register3: val register3:
'prefix directory -> 'prefix directory ->
('m, 'prefix, ((unit * 'a) * 'b) * 'c, 'q , 'i, 'o, 'e) RPC_service.t -> ('m, 'prefix, ((unit * 'a) * 'b) * 'c, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('a -> 'b -> 'c -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
val register4: val register4:
'prefix directory -> 'prefix directory ->
('m, 'prefix, (((unit * 'a) * 'b) * 'c) * 'd, 'q , 'i, 'o, 'e) RPC_service.t -> ('m, 'prefix, (((unit * 'a) * 'b) * 'c) * 'd, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'd -> 'q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('a -> 'b -> 'c -> 'd -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
val register5: val register5:
'prefix directory -> 'prefix directory ->
('m, 'prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'e, 'q , 'i, 'o, 'e) RPC_service.t -> ('m, 'prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'e, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'd -> 'e -> 'q -> 'i -> [< ('o, 'e) RPC_answer.t ] Lwt.t) -> ('a -> 'b -> 'c -> 'd -> 'e -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory 'prefix directory

View File

@ -18,13 +18,13 @@ type meth = [
module MethMap : Map.S with type key = meth module MethMap : Map.S with type key = meth
type (+'meth, 'prefix, 'params, 'query, 'input, 'output, 'error) t type (+'meth, 'prefix, 'params, 'query, 'input, 'output) t
constraint 'meth = [< meth ] constraint 'meth = [< meth ]
type (+'meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service = type (+'meth, 'prefix, 'params, 'query, 'input, 'output) service =
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) t ('meth, 'prefix, 'params, 'query, 'input, 'output) t
val query: val query:
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service -> ('meth, 'prefix, 'params, 'query, 'input, 'output) service ->
'query RPC_query.t 'query RPC_query.t
type _ input = type _ input =
@ -32,69 +32,64 @@ type _ input =
| Input : 'input Data_encoding.t -> 'input input | Input : 'input Data_encoding.t -> 'input input
val input_encoding: val input_encoding:
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service -> ('meth, 'prefix, 'params, 'query, 'input, 'output) service ->
'input input 'input input
val output_encoding: val output_encoding:
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service -> ('meth, 'prefix, 'params, 'query, 'input, 'output) service ->
'output Data_encoding.t 'output Data_encoding.t
val error_encoding: val error_encoding:
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service -> ('meth, 'prefix, 'params, 'query, 'input, 'output) service ->
'error Data_encoding.t unit Data_encoding.t
val prefix: val prefix:
('prefix, 'inner_prefix) RPC_path.t -> ('prefix, 'inner_prefix) RPC_path.t ->
('meth, 'inner_prefix, 'params, 'query, ('meth, 'inner_prefix, 'params, 'query,
'input, 'output, 'error) service -> 'input, 'output) service ->
('meth, 'prefix, 'params, ('meth, 'prefix, 'params,
'query, 'input, 'output, 'error) service 'query, 'input, 'output) service
val map: val map:
('a -> 'b) -> ('a -> 'b) ->
('b -> 'a) -> ('b -> 'a) ->
('meth, 'pr, 'a, 'q, 'i, 'o, 'e) service -> ('meth, 'pr, 'a, 'q, 'i, 'o) service ->
('meth, 'pr, 'b, 'q, 'i, 'o, 'e) service ('meth, 'pr, 'b, 'q, 'i, 'o) service
val get_service: val get_service:
?description: string -> ?description: string ->
query: 'query RPC_query.t -> query: 'query RPC_query.t ->
output: 'output Data_encoding.t -> output: 'output Data_encoding.t ->
error: 'error Data_encoding.t ->
('prefix, 'params) RPC_path.t -> ('prefix, 'params) RPC_path.t ->
([ `GET ], 'prefix, 'params, 'query, unit, 'output, 'error) service ([ `GET ], 'prefix, 'params, 'query, unit, 'output) service
val post_service: val post_service:
?description: string -> ?description: string ->
query:'query RPC_query.t -> query:'query RPC_query.t ->
input: 'input Data_encoding.t -> input: 'input Data_encoding.t ->
output: 'output Data_encoding.t -> output: 'output Data_encoding.t ->
error: 'error Data_encoding.t ->
('prefix, 'params) RPC_path.t -> ('prefix, 'params) RPC_path.t ->
([ `POST ], 'prefix, 'params, 'query, 'input, 'output, 'error) service ([ `POST ], 'prefix, 'params, 'query, 'input, 'output) service
val delete_service: val delete_service:
?description: string -> ?description: string ->
query:'query RPC_query.t -> query:'query RPC_query.t ->
output: 'output Data_encoding.t -> output: 'output Data_encoding.t ->
error: 'error Data_encoding.t ->
('prefix, 'params) RPC_path.t -> ('prefix, 'params) RPC_path.t ->
([ `DELETE ], 'prefix, 'params, 'query, unit, 'output, 'error) service ([ `DELETE ], 'prefix, 'params, 'query, unit, 'output) service
val patch_service: val patch_service:
?description: string -> ?description: string ->
query:'query RPC_query.t -> query:'query RPC_query.t ->
input: 'input Data_encoding.t -> input: 'input Data_encoding.t ->
output: 'output Data_encoding.t -> output: 'output Data_encoding.t ->
error: 'error Data_encoding.t ->
('prefix, 'params) RPC_path.t -> ('prefix, 'params) RPC_path.t ->
([ `PATCH ], 'prefix, 'params, 'query, 'input, 'output, 'error) service ([ `PATCH ], 'prefix, 'params, 'query, 'input, 'output) service
val put_service: val put_service:
?description: string -> ?description: string ->
query:'query RPC_query.t -> query:'query RPC_query.t ->
input: 'input Data_encoding.t -> input: 'input Data_encoding.t ->
output: 'output Data_encoding.t -> output: 'output Data_encoding.t ->
error: 'error Data_encoding.t ->
('prefix, 'params) RPC_path.t -> ('prefix, 'params) RPC_path.t ->
([ `PUT ], 'prefix, 'params, 'query, 'input, 'output, 'error) service ([ `PUT ], 'prefix, 'params, 'query, 'input, 'output) service

View File

@ -7,4 +7,23 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
include Resto_directory.Answer (** Return type for service handler *)
type 'o t =
[ `Ok of 'o (* 200 *)
| `OkStream of 'o stream (* 200 *)
| `Created of string option (* 201 *)
| `No_content (* 204 *)
| `Unauthorized of unit option (* 401 *)
| `Forbidden of unit option (* 403 *)
| `Not_found of unit option (* 404 *)
| `Conflict of unit option (* 409 *)
| `Error of unit option (* 500 *)
]
and 'a stream = 'a Resto_directory.Answer.stream = {
next: unit -> 'a option Lwt.t ;
shutdown: unit -> unit ;
}
let return x = Lwt.return (`Ok x)
let return_stream x = Lwt.return (`OkStream x)

View File

@ -7,4 +7,23 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
include module type of (struct include Resto_directory.Answer end) (** Return type for service handler *)
type 'o t =
[ `Ok of 'o (* 200 *)
| `OkStream of 'o stream (* 200 *)
| `Created of string option (* 201 *)
| `No_content (* 204 *)
| `Unauthorized of unit option (* 401 *)
| `Forbidden of unit option (* 403 *)
| `Not_found of unit option (* 404 *)
| `Conflict of unit option (* 409 *)
| `Error of unit option (* 500 *)
]
and 'a stream = 'a Resto_directory.Answer.stream = {
next: unit -> 'a option Lwt.t ;
shutdown: unit -> unit ;
}
val return: 'o -> 'o t Lwt.t
val return_stream: 'o stream -> 'o t Lwt.t

View File

@ -8,3 +8,47 @@
(**************************************************************************) (**************************************************************************)
include module type of (struct include Resto_directory.Make(RPC_encoding) end) include module type of (struct include Resto_directory.Make(RPC_encoding) end)
(** Registring handler in service tree. *)
val register:
'prefix directory ->
('meth, 'prefix, 'params, 'query, 'input, 'output) RPC_service.t ->
('params -> 'query -> 'input -> [< 'output RPC_answer.t ] Lwt.t) ->
'prefix directory
(** Registring handler in service tree. Curryfied variant. *)
val register0:
unit directory ->
('m, unit, unit, 'q, 'i, 'o) RPC_service.t ->
('q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
unit directory
val register1:
'prefix directory ->
('m, 'prefix, unit * 'a, 'q , 'i, 'o) RPC_service.t ->
('a -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory
val register2:
'prefix directory ->
('m, 'prefix, (unit * 'a) * 'b, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory
val register3:
'prefix directory ->
('m, 'prefix, ((unit * 'a) * 'b) * 'c, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory
val register4:
'prefix directory ->
('m, 'prefix, (((unit * 'a) * 'b) * 'c) * 'd, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'd -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory
val register5:
'prefix directory ->
('m, 'prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'e, 'q , 'i, 'o) RPC_service.t ->
('a -> 'b -> 'c -> 'd -> 'e -> 'q -> 'i -> [< 'o RPC_answer.t ] Lwt.t) ->
'prefix directory

View File

@ -13,7 +13,6 @@ let service =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: Data_encoding.json_schema ~output: Data_encoding.json_schema
~error: Data_encoding.empty
RPC_path.(root / "errors") RPC_path.(root / "errors")
let encoding = let encoding =

View File

@ -10,6 +10,6 @@
open Error_monad open Error_monad
val service: val service:
([ `POST ], unit, unit, unit, unit, Json_schema.schema, unit) RPC_service.t ([ `POST ], unit, unit, unit, unit, Json_schema.schema) RPC_service.t
val encoding: error list Data_encoding.t val encoding: error list Data_encoding.t
val wrap: 'a Data_encoding.t -> 'a tzresult Data_encoding.encoding val wrap: 'a Data_encoding.t -> 'a tzresult Data_encoding.encoding

View File

@ -24,4 +24,26 @@ let meth_encoding =
module MethMap = Resto.MethMap module MethMap = Resto.MethMap
include Resto.MakeService(RPC_encoding) type (+'m,'pr,'p,'q,'i,'o, 'e) raw =
('m,'pr,'p,'q,'i,'o, 'e) Resto.MakeService(RPC_encoding).t
constraint 'meth = [< meth ]
type (+'meth, 'prefix, 'params, 'query, 'input, 'output) t =
('meth, 'prefix, 'params, 'query, 'input, 'output, unit) raw
constraint 'meth = [< meth ]
type (+'meth, 'prefix, 'params, 'query, 'input, 'output) service =
('meth, 'prefix, 'params, 'query, 'input, 'output, unit) raw
constraint 'meth = [< meth ]
include (Resto.MakeService(RPC_encoding)
: (module type of struct include Resto.MakeService(RPC_encoding) end
with type (+'m,'pr,'p,'q,'i,'o, 'e) t := ('m,'pr,'p,'q,'i,'o, 'e) raw
and type (+'m,'pr,'p,'q,'i,'o, 'e) service := ('m,'pr,'p,'q,'i,'o, 'e) raw)
)
let get_service = get_service ~error:Data_encoding.empty
let post_service = post_service ~error:Data_encoding.empty
let delete_service = delete_service ~error:Data_encoding.empty
let patch_service = patch_service ~error:Data_encoding.empty
let put_service = put_service ~error:Data_encoding.empty

View File

@ -15,4 +15,56 @@ val meth_encoding: meth Data_encoding.t
module MethMap = Resto.MethMap module MethMap = Resto.MethMap
include (module type of struct include Resto.MakeService(RPC_encoding) end) type (+'m,'pr,'p,'q,'i,'o, 'e) raw =
('m,'pr,'p,'q,'i,'o, 'e) Resto.MakeService(RPC_encoding).t
constraint 'meth = [< meth ]
type (+'meth, 'prefix, 'params, 'query, 'input, 'output) t =
('meth, 'prefix, 'params, 'query, 'input, 'output, unit) raw
constraint 'meth = [< meth ]
type (+'meth, 'prefix, 'params, 'query, 'input, 'output) service =
('meth, 'prefix, 'params, 'query, 'input, 'output, unit) raw
constraint 'meth = [< meth ]
include (module type of struct include Resto.MakeService(RPC_encoding) end
with type (+'m,'pr,'p,'q,'i,'o, 'e) t := ('m,'pr,'p,'q,'i,'o, 'e) raw
and type (+'m,'pr,'p,'q,'i,'o, 'e) service := ('m,'pr,'p,'q,'i,'o, 'e) raw)
val get_service:
?description: string ->
query: 'query RPC_query.t ->
output: 'output Data_encoding.t ->
('prefix, 'params) RPC_path.t ->
([ `GET ], 'prefix, 'params, 'query, unit, 'output) service
val post_service:
?description: string ->
query:'query RPC_query.t ->
input: 'input Data_encoding.t ->
output: 'output Data_encoding.t ->
('prefix, 'params) RPC_path.t ->
([ `POST ], 'prefix, 'params, 'query, 'input, 'output) service
val delete_service:
?description: string ->
query:'query RPC_query.t ->
output: 'output Data_encoding.t ->
('prefix, 'params) RPC_path.t ->
([ `DELETE ], 'prefix, 'params, 'query, unit, 'output) service
val patch_service:
?description: string ->
query:'query RPC_query.t ->
input: 'input Data_encoding.t ->
output: 'output Data_encoding.t ->
('prefix, 'params) RPC_path.t ->
([ `PATCH ], 'prefix, 'params, 'query, 'input, 'output) service
val put_service:
?description: string ->
query:'query RPC_query.t ->
input: 'input Data_encoding.t ->
output: 'output Data_encoding.t ->
('prefix, 'params) RPC_path.t ->
([ `PUT ], 'prefix, 'params, 'query, 'input, 'output) service

View File

@ -381,7 +381,7 @@ let handle accept (meth, uri, ans) =
let call_streamed_service let call_streamed_service
(type p q i o ) (type p q i o )
accept ?logger ~base (service : (_,_,p,q,i,o,_) RPC_service.t) accept ?logger ~base (service : (_,_,p,q,i,o) RPC_service.t)
~on_chunk ~on_close ~on_chunk ~on_close
(params : p) (query : q) (body : i) : (unit -> unit) tzresult Lwt.t = (params : p) (query : q) (body : i) : (unit -> unit) tzresult Lwt.t =
Client.call_streamed_service Client.call_streamed_service
@ -391,7 +391,7 @@ let call_streamed_service
let call_service let call_service
(type p q i o ) (type p q i o )
accept ?logger ~base (service : (_,_,p,q,i,o,_) RPC_service.t) accept ?logger ~base (service : (_,_,p,q,i,o) RPC_service.t)
(params : p) (params : p)
(query : q) (body : i) : o tzresult Lwt.t = (query : q) (body : i) : o tzresult Lwt.t =
Client.call_service Client.call_service

View File

@ -79,14 +79,14 @@ val call_service :
Media_type.t list -> Media_type.t list ->
?logger:logger -> ?logger:logger ->
base:Uri.t -> base:Uri.t ->
([< Resto.meth ], unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ], unit, 'p, 'q, 'i, 'o) RPC_service.t ->
'p -> 'q -> 'i -> 'o tzresult Lwt.t 'p -> 'q -> 'i -> 'o tzresult Lwt.t
val call_streamed_service : val call_streamed_service :
Media_type.t list -> Media_type.t list ->
?logger:logger -> ?logger:logger ->
base:Uri.t -> base:Uri.t ->
([< Resto.meth ], unit, 'p, 'q, 'i, 'o, 'e) RPC_service.t -> ([< Resto.meth ], unit, 'p, 'q, 'i, 'o) RPC_service.t ->
on_chunk: ('o -> unit) -> on_chunk: ('o -> unit) ->
on_close: (unit -> unit) -> on_close: (unit -> unit) ->
'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t 'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t

View File

@ -116,7 +116,6 @@ let info =
~query: RPC_query.empty ~query: RPC_query.empty
~input: (obj1 (dft "operations" bool true)) ~input: (obj1 (dft "operations" bool true))
~output: block_info_encoding ~output: block_info_encoding
~error: Data_encoding.empty
block_path block_path
let net_id = let net_id =
@ -125,7 +124,6 @@ let net_id =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "net_id" Net_id.encoding)) ~output: (obj1 (req "net_id" Net_id.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "net_id") RPC_path.(block_path / "net_id")
let level = let level =
@ -134,7 +132,6 @@ let level =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "level" int32)) ~output: (obj1 (req "level" int32))
~error: Data_encoding.empty
RPC_path.(block_path / "level") RPC_path.(block_path / "level")
let predecessor = let predecessor =
@ -143,7 +140,6 @@ let predecessor =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "predecessor" Block_hash.encoding)) ~output: (obj1 (req "predecessor" Block_hash.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "predecessor") RPC_path.(block_path / "predecessor")
let predecessors = let predecessors =
@ -154,7 +150,6 @@ let predecessors =
~input: (obj1 (req "length" Data_encoding.uint16)) ~input: (obj1 (req "length" Data_encoding.uint16))
~output: (obj1 ~output: (obj1
(req "blocks" (Data_encoding.list Block_hash.encoding))) (req "blocks" (Data_encoding.list Block_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(block_path / "predecessors") RPC_path.(block_path / "predecessors")
let hash = let hash =
@ -163,7 +158,6 @@ let hash =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "hash" Block_hash.encoding)) ~output: (obj1 (req "hash" Block_hash.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "hash") RPC_path.(block_path / "hash")
let fitness = let fitness =
@ -172,7 +166,6 @@ let fitness =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "fitness" Fitness.encoding)) ~output: (obj1 (req "fitness" Fitness.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "fitness") RPC_path.(block_path / "fitness")
let context = let context =
@ -181,7 +174,6 @@ let context =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "context" Context_hash.encoding)) ~output: (obj1 (req "context" Context_hash.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "context") RPC_path.(block_path / "context")
let timestamp = let timestamp =
@ -190,7 +182,6 @@ let timestamp =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "timestamp" Time.encoding)) ~output: (obj1 (req "timestamp" Time.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "timestamp") RPC_path.(block_path / "timestamp")
type operations_param = { type operations_param = {
@ -219,7 +210,6 @@ let operations =
(req "hash" Operation_hash.encoding) (req "hash" Operation_hash.encoding)
(opt "contents" (opt "contents"
(dynamic_size Operation.encoding))))))) (dynamic_size Operation.encoding)))))))
~error: Data_encoding.empty
RPC_path.(block_path / "operations") RPC_path.(block_path / "operations")
let protocol = let protocol =
@ -228,7 +218,6 @@ let protocol =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (obj1 (req "protocol" Protocol_hash.encoding)) ~output: (obj1 (req "protocol" Protocol_hash.encoding))
~error: Data_encoding.empty
RPC_path.(block_path / "protocol") RPC_path.(block_path / "protocol")
let test_network = let test_network =
@ -237,7 +226,6 @@ let test_network =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: Test_network_status.encoding ~output: Test_network_status.encoding
~error: Data_encoding.empty
RPC_path.(block_path / "test_network") RPC_path.(block_path / "test_network")
let pending_operations = let pending_operations =
@ -266,7 +254,6 @@ let pending_operations =
(dynamic_size (dynamic_size
(Preapply_result.encoding RPC_error.encoding)) (Preapply_result.encoding RPC_error.encoding))
(obj1 (req "unprocessed" (list (dynamic_size operation_encoding)))))) (obj1 (req "unprocessed" (list (dynamic_size operation_encoding))))))
~error: Data_encoding.empty
RPC_path.(block_path / "pending_operations") RPC_path.(block_path / "pending_operations")
let proto_path = let proto_path =
@ -315,7 +302,6 @@ let preapply =
~query: RPC_query.empty ~query: RPC_query.empty
~input: preapply_param_encoding ~input: preapply_param_encoding
~output: (RPC_error.wrap preapply_result_encoding) ~output: (RPC_error.wrap preapply_result_encoding)
~error: Data_encoding.empty
RPC_path.(block_path / "preapply") RPC_path.(block_path / "preapply")
let complete = let complete =
@ -330,7 +316,6 @@ let complete =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (list string) ~output: (list string)
~error: Data_encoding.empty
RPC_path.(block_path / "complete" /: prefix_arg ) RPC_path.(block_path / "complete" /: prefix_arg )
type list_param = { type list_param = {
@ -407,7 +392,6 @@ let list =
~query: RPC_query.empty ~query: RPC_query.empty
~input: list_param_encoding ~input: list_param_encoding
~output: (obj1 (req "blocks" (list (list block_info_encoding)))) ~output: (obj1 (req "blocks" (list (list block_info_encoding))))
~error: Data_encoding.empty
RPC_path.(root / "blocks") RPC_path.(root / "blocks")
let list_invalid = let list_invalid =
@ -422,7 +406,6 @@ let list_invalid =
(req "block" Block_hash.encoding) (req "block" Block_hash.encoding)
(req "level" int32) (req "level" int32)
(req "errors" RPC_error.encoding))) (req "errors" RPC_error.encoding)))
~error: Data_encoding.empty
RPC_path.(root / "invalid_blocks") RPC_path.(root / "invalid_blocks")
let unmark_invalid = let unmark_invalid =
@ -432,5 +415,4 @@ let unmark_invalid =
~query: RPC_query.empty ~query: RPC_query.empty
~input:Data_encoding.(obj1 (req "block" Block_hash.encoding)) ~input:Data_encoding.(obj1 (req "block" Block_hash.encoding))
~output:(RPC_error.wrap Data_encoding.empty) ~output:(RPC_error.wrap Data_encoding.empty)
~error: Data_encoding.empty
RPC_path.(root / "unmark_invalid") RPC_path.(root / "unmark_invalid")

View File

@ -38,39 +38,39 @@ type block_info = {
val info: val info:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, bool, unit * block, unit, bool,
block_info, unit) RPC_service.t block_info) RPC_service.t
val net_id: val net_id:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Net_id.t, unit) RPC_service.t Net_id.t) RPC_service.t
val level: val level:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Int32.t, unit) RPC_service.t Int32.t) RPC_service.t
val predecessor: val predecessor:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Block_hash.t, unit) RPC_service.t Block_hash.t) RPC_service.t
val predecessors: val predecessors:
([ `POST ], unit, ([ `POST ], unit,
unit * block , unit, int, unit * block , unit, int,
Block_hash.t list, unit) RPC_service.t Block_hash.t list) RPC_service.t
val hash: val hash:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Block_hash.t, unit) RPC_service.t Block_hash.t) RPC_service.t
val timestamp: val timestamp:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Time.t, unit) RPC_service.t Time.t) RPC_service.t
val fitness: val fitness:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
MBytes.t list, unit) RPC_service.t MBytes.t list) RPC_service.t
val context: val context:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Context_hash.t, unit) RPC_service.t Context_hash.t) RPC_service.t
type operations_param = { type operations_param = {
contents: bool ; contents: bool ;
@ -79,20 +79,20 @@ type operations_param = {
val operations: val operations:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, operations_param, unit * block, unit, operations_param,
(Operation_hash.t * Operation.t option) list list, unit) RPC_service.t (Operation_hash.t * Operation.t option) list list) RPC_service.t
val protocol: val protocol:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Protocol_hash.t, unit) RPC_service.t Protocol_hash.t) RPC_service.t
val test_network: val test_network:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
Test_network_status.t, unit) RPC_service.t Test_network_status.t) RPC_service.t
val pending_operations: val pending_operations:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, unit, unit * block, unit, unit,
error Preapply_result.t * Operation.t Operation_hash.Map.t, unit) RPC_service.t error Preapply_result.t * Operation.t Operation_hash.Map.t) RPC_service.t
type list_param = { type list_param = {
include_ops: bool ; include_ops: bool ;
@ -106,15 +106,15 @@ type list_param = {
val list: val list:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, list_param, unit, unit, list_param,
block_info list list, unit) RPC_service.t block_info list list) RPC_service.t
val list_invalid: val list_invalid:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
(Block_hash.t * int32 * error list) list, unit) RPC_service.t (Block_hash.t * int32 * error list) list) RPC_service.t
val unmark_invalid: val unmark_invalid:
([ `POST ], unit, unit, unit, Block_hash.t, unit tzresult, unit) RPC_service.t ([ `POST ], unit, unit, unit, Block_hash.t, unit tzresult) RPC_service.t
type preapply_param = { type preapply_param = {
timestamp: Time.t ; timestamp: Time.t ;
@ -130,11 +130,11 @@ type preapply_result = {
val preapply: val preapply:
([ `POST ], unit, ([ `POST ], unit,
unit * block, unit, preapply_param, unit * block, unit, preapply_param,
preapply_result tzresult, unit) RPC_service.t preapply_result tzresult) RPC_service.t
val complete: val complete:
([ `POST ], unit, ([ `POST ], unit,
(unit * block) * string, unit, unit, (unit * block) * string, unit, unit,
string list, unit) RPC_service.t string list) RPC_service.t
val proto_path: (unit, unit * block) RPC_path.path val proto_path: (unit, unit * block) RPC_path.path

View File

@ -21,7 +21,6 @@ let versions =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: (Data_encoding.list P2p_version.encoding) ~output: (Data_encoding.list P2p_version.encoding)
~error: Data_encoding.empty
RPC_path.(root / "network" / "versions") RPC_path.(root / "network" / "versions")
let stat = let stat =
@ -30,7 +29,6 @@ let stat =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: P2p_stat.encoding ~output: P2p_stat.encoding
~error: Data_encoding.empty
RPC_path.(root / "network" / "stat") RPC_path.(root / "network" / "stat")
let events = let events =
@ -39,7 +37,6 @@ let events =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: P2p_connection.Pool_event.encoding ~output: P2p_connection.Pool_event.encoding
~error: Data_encoding.empty
RPC_path.(root / "network" / "log") RPC_path.(root / "network" / "log")
let connect = let connect =
@ -48,7 +45,6 @@ let connect =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.(obj1 (dft "timeout" float 5.)) ~input: Data_encoding.(obj1 (dft "timeout" float 5.))
~output: (RPC_error.wrap Data_encoding.empty) ~output: (RPC_error.wrap Data_encoding.empty)
~error: Data_encoding.empty
RPC_path.(root / "network" / "connect" /: point_arg) RPC_path.(root / "network" / "connect" /: point_arg)
let monitor_encoding = Data_encoding.(obj1 (dft "monitor" bool false)) let monitor_encoding = Data_encoding.(obj1 (dft "monitor" bool false))
@ -61,7 +57,6 @@ module Connection = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: (Data_encoding.list P2p_connection.Info.encoding) ~output: (Data_encoding.list P2p_connection.Info.encoding)
~error: Data_encoding.empty
RPC_path.(root / "network" / "connection") RPC_path.(root / "network" / "connection")
let info = let info =
@ -69,7 +64,6 @@ module Connection = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: (Data_encoding.option P2p_connection.Info.encoding) ~output: (Data_encoding.option P2p_connection.Info.encoding)
~error: Data_encoding.empty
~description:"Details about the current P2P connection to the given peer." ~description:"Details about the current P2P connection to the given peer."
RPC_path.(root / "network" / "connection" /: P2p_peer.Id.rpc_arg) RPC_path.(root / "network" / "connection" /: P2p_peer.Id.rpc_arg)
@ -78,7 +72,6 @@ module Connection = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.(obj1 (req "wait" bool)) ~input: Data_encoding.(obj1 (req "wait" bool))
~output: Data_encoding.empty ~output: Data_encoding.empty
~error: Data_encoding.empty
~description:"Forced close of the current P2P connection to the given peer." ~description:"Forced close of the current P2P connection to the given peer."
RPC_path.(root / "network" / "connection" /: P2p_peer.Id.rpc_arg / "kick") RPC_path.(root / "network" / "connection" /: P2p_peer.Id.rpc_arg / "kick")
@ -91,7 +84,6 @@ module Point = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: (Data_encoding.option P2p_point.Info.encoding) ~output: (Data_encoding.option P2p_point.Info.encoding)
~error: Data_encoding.empty
~description: "Details about a given `IP:addr`." ~description: "Details about a given `IP:addr`."
RPC_path.(root / "network" / "point" /: point_arg) RPC_path.(root / "network" / "point" /: point_arg)
@ -101,7 +93,6 @@ module Point = struct
~input: monitor_encoding ~input: monitor_encoding
~output: (Data_encoding.list ~output: (Data_encoding.list
P2p_point.Pool_event.encoding) P2p_point.Pool_event.encoding)
~error: Data_encoding.empty
~description: "Monitor network events related to an `IP:addr`." ~description: "Monitor network events related to an `IP:addr`."
RPC_path.(root / "network" / "point" /: point_arg / "log") RPC_path.(root / "network" / "point" /: point_arg / "log")
@ -116,7 +107,6 @@ module Point = struct
Data_encoding.(list (tup2 Data_encoding.(list (tup2
P2p_point.Id.encoding P2p_point.Id.encoding
P2p_point.Info.encoding)) P2p_point.Info.encoding))
~error: Data_encoding.empty
~description:"List the pool of known `IP:port` \ ~description:"List the pool of known `IP:port` \
used for establishing P2P connections ." used for establishing P2P connections ."
RPC_path.(root / "network" / "point") RPC_path.(root / "network" / "point")
@ -130,7 +120,6 @@ module Peer_id = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.empty ~input: Data_encoding.empty
~output: (Data_encoding.option P2p_peer.Info.encoding) ~output: (Data_encoding.option P2p_peer.Info.encoding)
~error: Data_encoding.empty
~description:"Details about a given peer." ~description:"Details about a given peer."
RPC_path.(root / "network" / "peer_id" /: P2p_peer.Id.rpc_arg) RPC_path.(root / "network" / "peer_id" /: P2p_peer.Id.rpc_arg)
@ -140,7 +129,6 @@ module Peer_id = struct
~input: monitor_encoding ~input: monitor_encoding
~output: (Data_encoding.list ~output: (Data_encoding.list
P2p_peer.Pool_event.encoding) P2p_peer.Pool_event.encoding)
~error: Data_encoding.empty
~description:"Monitor network events related to a given peer." ~description:"Monitor network events related to a given peer."
RPC_path.(root / "network" / "peer_id" /: P2p_peer.Id.rpc_arg / "log") RPC_path.(root / "network" / "peer_id" /: P2p_peer.Id.rpc_arg / "log")
@ -155,7 +143,6 @@ module Peer_id = struct
Data_encoding.(list (tup2 Data_encoding.(list (tup2
P2p_peer.Id.encoding P2p_peer.Id.encoding
P2p_peer.Info.encoding)) P2p_peer.Info.encoding))
~error: Data_encoding.empty
~description:"List the peers the node ever met." ~description:"List the peers the node ever met."
RPC_path.(root / "network" / "peer_id") RPC_path.(root / "network" / "peer_id")

View File

@ -10,39 +10,39 @@
val stat : val stat :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
P2p_stat.t, unit) RPC_service.t P2p_stat.t) RPC_service.t
val versions : val versions :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
P2p_version.t list, unit) RPC_service.t P2p_version.t list) RPC_service.t
val events : val events :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
P2p_connection.Pool_event.t, unit) RPC_service.t P2p_connection.Pool_event.t) RPC_service.t
val connect : val connect :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_point.Id.t, unit, float, unit * P2p_point.Id.t, unit, float,
unit tzresult, unit) RPC_service.t unit tzresult) RPC_service.t
module Connection : sig module Connection : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
P2p_connection.Info.t list, unit) RPC_service.t P2p_connection.Info.t list) RPC_service.t
val info : val info :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_peer.Id.t, unit, unit, unit * P2p_peer.Id.t, unit, unit,
P2p_connection.Info.t option, unit) RPC_service.t P2p_connection.Info.t option) RPC_service.t
val kick : val kick :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_peer.Id.t, unit, bool, unit * P2p_peer.Id.t, unit, bool,
unit, unit) RPC_service.t unit) RPC_service.t
end end
@ -50,15 +50,15 @@ module Point : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, P2p_point.State.t list, unit, unit, P2p_point.State.t list,
(P2p_point.Id.t * P2p_point.Info.t) list, unit) RPC_service.t (P2p_point.Id.t * P2p_point.Info.t) list) RPC_service.t
val info : val info :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_point.Id.t, unit, unit, unit * P2p_point.Id.t, unit, unit,
P2p_point.Info.t option, unit) RPC_service.t P2p_point.Info.t option) RPC_service.t
val events : val events :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_point.Id.t, unit, bool, unit * P2p_point.Id.t, unit, bool,
P2p_point.Pool_event.t list, unit) RPC_service.t P2p_point.Pool_event.t list) RPC_service.t
end end
module Peer_id : sig module Peer_id : sig
@ -66,16 +66,16 @@ module Peer_id : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, P2p_peer.State.t list, unit, unit, P2p_peer.State.t list,
(P2p_peer.Id.t * P2p_peer.Info.t) list, unit) RPC_service.t (P2p_peer.Id.t * P2p_peer.Info.t) list) RPC_service.t
val info : val info :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_peer.Id.t, unit, unit, unit * P2p_peer.Id.t, unit, unit,
P2p_peer.Info.t option, unit) RPC_service.t P2p_peer.Info.t option) RPC_service.t
val events : val events :
([ `POST ], unit, ([ `POST ], unit,
unit * P2p_peer.Id.t, unit, bool, unit * P2p_peer.Id.t, unit, bool,
P2p_peer.Pool_event.t list, unit) RPC_service.t P2p_peer.Pool_event.t list) RPC_service.t
end end

View File

@ -19,7 +19,6 @@ let contents =
(obj1 (req "data" (obj1 (req "data"
(describe ~title: "Tezos protocol" (describe ~title: "Tezos protocol"
(Protocol.encoding)))) (Protocol.encoding))))
~error: Data_encoding.empty
RPC_path.(root / "protocols" /: protocols_arg) RPC_path.(root / "protocols" /: protocols_arg)
type list_param = { type list_param = {
@ -48,5 +47,4 @@ let list =
(opt "contents" (opt "contents"
(dynamic_size Protocol.encoding))) (dynamic_size Protocol.encoding)))
))) )))
~error: Data_encoding.empty
RPC_path.(root / "protocols") RPC_path.(root / "protocols")

View File

@ -10,7 +10,7 @@
val contents: val contents:
([ `POST ], unit, ([ `POST ], unit,
unit * Protocol_hash.t, unit, unit, unit * Protocol_hash.t, unit, unit,
Protocol.t, unit) RPC_service.t Protocol.t) RPC_service.t
type list_param = { type list_param = {
contents: bool option ; contents: bool option ;
@ -20,4 +20,4 @@ type list_param = {
val list: val list:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, list_param, unit, unit, list_param,
(Protocol_hash.t * Protocol.t option) list, unit) RPC_service.t (Protocol_hash.t * Protocol.t option) list) RPC_service.t

View File

@ -15,7 +15,6 @@ let forge_block_header =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Block_header.encoding ~input: Block_header.encoding
~output: (obj1 (req "block" bytes)) ~output: (obj1 (req "block" bytes))
~error: Data_encoding.empty
RPC_path.(root / "forge_block_header") RPC_path.(root / "forge_block_header")
type inject_block_param = { type inject_block_param = {
@ -68,7 +67,6 @@ let inject_block =
~output: ~output:
(RPC_error.wrap @@ (RPC_error.wrap @@
(obj1 (req "block_hash" Block_hash.encoding))) (obj1 (req "block_hash" Block_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(root / "inject_block") RPC_path.(root / "inject_block")
let inject_operation = let inject_operation =
@ -100,7 +98,6 @@ let inject_operation =
describe describe
~title: "Hash of the injected operation" @@ ~title: "Hash of the injected operation" @@
(obj1 (req "injectedOperation" Operation_hash.encoding))) (obj1 (req "injectedOperation" Operation_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(root / "inject_operation") RPC_path.(root / "inject_operation")
let inject_protocol = let inject_protocol =
@ -129,7 +126,6 @@ let inject_protocol =
describe describe
~title: "Hash of the injected protocol" @@ ~title: "Hash of the injected protocol" @@
(obj1 (req "injectedProtocol" Protocol_hash.encoding))) (obj1 (req "injectedProtocol" Protocol_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(root / "inject_protocol") RPC_path.(root / "inject_protocol")
let bootstrapped = let bootstrapped =
@ -140,7 +136,6 @@ let bootstrapped =
~output: (obj2 ~output: (obj2
(req "block" Block_hash.encoding) (req "block" Block_hash.encoding)
(req "timestamp" Time.encoding)) (req "timestamp" Time.encoding))
~error: Data_encoding.empty
RPC_path.(root / "bootstrapped") RPC_path.(root / "bootstrapped")
let complete = let complete =
@ -155,7 +150,6 @@ let complete =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (list string) ~output: (list string)
~error: Data_encoding.empty
RPC_path.(root / "complete" /: prefix_arg ) RPC_path.(root / "complete" /: prefix_arg )
let describe = let describe =

View File

@ -10,7 +10,7 @@
val forge_block_header: val forge_block_header:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, Block_header.t, unit, unit, Block_header.t,
MBytes.t, unit) RPC_service.t MBytes.t) RPC_service.t
type inject_block_param = { type inject_block_param = {
raw: MBytes.t ; raw: MBytes.t ;
@ -23,26 +23,26 @@ type inject_block_param = {
val inject_block: val inject_block:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, inject_block_param, unit, unit, inject_block_param,
Block_hash.t tzresult, unit) RPC_service.t Block_hash.t tzresult) RPC_service.t
val inject_operation: val inject_operation:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, (MBytes.t * bool * Net_id.t option), unit, unit, (MBytes.t * bool * Net_id.t option),
Operation_hash.t tzresult, unit) RPC_service.t Operation_hash.t tzresult) RPC_service.t
val inject_protocol: val inject_protocol:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, (Protocol.t * bool * bool option), unit, unit, (Protocol.t * bool * bool option),
Protocol_hash.t tzresult, unit) RPC_service.t Protocol_hash.t tzresult) RPC_service.t
val bootstrapped: val bootstrapped:
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
Block_hash.t * Time.t, unit) RPC_service.t Block_hash.t * Time.t) RPC_service.t
val complete: val complete:
([ `POST ], unit, ([ `POST ], unit,
unit * string, unit, unit, unit * string, unit, unit,
string list, unit) RPC_service.t string list) RPC_service.t
val describe: (unit, unit) RPC_service.description_service val describe: (unit, unit) RPC_service.description_service

View File

@ -25,7 +25,6 @@ module Prevalidators = struct
RPC_service.post_service RPC_service.post_service
~description:"Lists the Prevalidator workers and their status." ~description:"Lists the Prevalidator workers and their status."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(list (list
@ -39,7 +38,6 @@ module Prevalidators = struct
RPC_service.post_service RPC_service.post_service
~description:"Introspect the state of a prevalidator worker." ~description:"Introspect the state of a prevalidator worker."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(Worker_types.full_status_encoding (Worker_types.full_status_encoding
@ -57,7 +55,6 @@ module Block_validator = struct
RPC_service.post_service RPC_service.post_service
~description:"Introspect the state of the block_validator worker." ~description:"Introspect the state of the block_validator worker."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(Worker_types.full_status_encoding (Worker_types.full_status_encoding
@ -94,7 +91,6 @@ module Peer_validators = struct
RPC_service.post_service RPC_service.post_service
~description:"Lists the peer validator workers and their status." ~description:"Lists the peer validator workers and their status."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(list (list
@ -108,7 +104,6 @@ module Peer_validators = struct
RPC_service.post_service RPC_service.post_service
~description:"Introspect the state of a peer validator worker." ~description:"Introspect the state of a peer validator worker."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(Worker_types.full_status_encoding (Worker_types.full_status_encoding
@ -135,7 +130,6 @@ module Net_validators = struct
RPC_service.post_service RPC_service.post_service
~description:"Lists the net validator workers and their status." ~description:"Lists the net validator workers and their status."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(list (list
@ -149,7 +143,6 @@ module Net_validators = struct
RPC_service.post_service RPC_service.post_service
~description:"Introspect the state of a net validator worker." ~description:"Introspect the state of a net validator worker."
~query: RPC_query.empty ~query: RPC_query.empty
~error: Data_encoding.empty
~input: empty ~input: empty
~output: ~output:
(Worker_types.full_status_encoding (Worker_types.full_status_encoding

View File

@ -14,13 +14,12 @@ module Prevalidators : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
(Net_id.t * Worker_types.worker_status) list, unit) RPC_service.t (Net_id.t * Worker_types.worker_status) list) RPC_service.t
val state : val state :
([ `POST ], unit, ([ `POST ], unit,
unit * Net_id.t, unit, unit, unit * Net_id.t, unit, unit,
(Request.view, Event.t) Worker_types.full_status, unit) (Request.view, Event.t) Worker_types.full_status) RPC_service.t
RPC_service.t
end end
@ -31,8 +30,7 @@ module Block_validator : sig
val state : val state :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
(Request.view, Event.t) Worker_types.full_status, unit) (Request.view, Event.t) Worker_types.full_status) RPC_service.t
RPC_service.t
end end
@ -43,13 +41,12 @@ module Peer_validators : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit * Net_id.t, unit, unit, unit * Net_id.t, unit, unit,
(P2p_peer.Id.t * Worker_types.worker_status) list, unit) RPC_service.t (P2p_peer.Id.t * Worker_types.worker_status) list) RPC_service.t
val state : val state :
([ `POST ], unit, ([ `POST ], unit,
(unit * Net_id.t) * P2p_peer.Id.t, unit, unit, (unit * Net_id.t) * P2p_peer.Id.t, unit, unit,
(Request.view, Event.t) Worker_types.full_status, unit) (Request.view, Event.t) Worker_types.full_status) RPC_service.t
RPC_service.t
end end
@ -60,12 +57,11 @@ module Net_validators : sig
val list : val list :
([ `POST ], unit, ([ `POST ], unit,
unit, unit, unit, unit, unit, unit,
(Net_id.t * Worker_types.worker_status) list, unit) RPC_service.t (Net_id.t * Worker_types.worker_status) list) RPC_service.t
val state : val state :
([ `POST ], unit, ([ `POST ], unit,
unit * Net_id.t, unit, unit, unit * Net_id.t, unit, unit,
(Request.view, Event.t) Worker_types.full_status, unit) (Request.view, Event.t) Worker_types.full_status) RPC_service.t
RPC_service.t
end end

View File

@ -42,7 +42,6 @@ let operations custom_root =
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
(list (list (dynamic_size Operation.encoding)))) (list (list (dynamic_size Operation.encoding))))
~error: Data_encoding.empty
RPC_path.(custom_root / "operations") RPC_path.(custom_root / "operations")
let header custom_root = let header custom_root =
@ -51,7 +50,6 @@ let header custom_root =
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror Block_header.encoding) ~output: (wrap_tzerror Block_header.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "header") RPC_path.(custom_root / "header")
module Header = struct module Header = struct
@ -62,7 +60,6 @@ module Header = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror uint16) ~output: (wrap_tzerror uint16)
~error: Data_encoding.empty
RPC_path.(custom_root / "header" / "priority") RPC_path.(custom_root / "header" / "priority")
let seed_nonce_hash custom_root = let seed_nonce_hash custom_root =
@ -71,7 +68,6 @@ module Header = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror Nonce_hash.encoding) ~output: (wrap_tzerror Nonce_hash.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "header" / "seed_nonce_hash") RPC_path.(custom_root / "header" / "seed_nonce_hash")
end end
@ -85,7 +81,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "cycle length" int32) describe ~title: "cycle length" int32)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "cycle_length") RPC_path.(custom_root / "constants" / "cycle_length")
let voting_period_length custom_root = let voting_period_length custom_root =
@ -95,7 +90,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "voting period length" int32) describe ~title: "voting period length" int32)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "voting_period_length") RPC_path.(custom_root / "constants" / "voting_period_length")
let time_before_reward custom_root = let time_before_reward custom_root =
@ -105,7 +99,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "time before reward" Period.encoding) describe ~title: "time before reward" Period.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "time_before_reward") RPC_path.(custom_root / "constants" / "time_before_reward")
let slot_durations custom_root = let slot_durations custom_root =
@ -115,7 +108,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "time between slots" (list Period.encoding)) describe ~title: "time between slots" (list Period.encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "time_between_slots") RPC_path.(custom_root / "constants" / "time_between_slots")
let first_free_baking_slot custom_root = let first_free_baking_slot custom_root =
@ -125,7 +117,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "first free baking slot" uint16) describe ~title: "first free baking slot" uint16)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "first_free_baking_slot") RPC_path.(custom_root / "constants" / "first_free_baking_slot")
let max_signing_slot custom_root = let max_signing_slot custom_root =
@ -135,7 +126,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "max signing slot" uint16) describe ~title: "max signing slot" uint16)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "max_signing_slot") RPC_path.(custom_root / "constants" / "max_signing_slot")
let max_gas custom_root = let max_gas custom_root =
@ -145,7 +135,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "instructions per transaction" int31) describe ~title: "instructions per transaction" int31)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "max_gas") RPC_path.(custom_root / "constants" / "max_gas")
let proof_of_work_threshold custom_root = let proof_of_work_threshold custom_root =
@ -155,7 +144,6 @@ module Constants = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "proof_of_work threshold" int64) describe ~title: "proof_of_work threshold" int64)
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "proof_of_work_threshold") RPC_path.(custom_root / "constants" / "proof_of_work_threshold")
let errors custom_root = let errors custom_root =
@ -164,7 +152,6 @@ module Constants = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: json_schema ~output: json_schema
~error: Data_encoding.empty
RPC_path.(custom_root / "constants" / "errors") RPC_path.(custom_root / "constants" / "errors")
end end
@ -178,7 +165,6 @@ module Context = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "detailled level info" Level.encoding) describe ~title: "detailled level info" Level.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "level") RPC_path.(custom_root / "context" / "level")
let next_level custom_root = let next_level custom_root =
@ -188,7 +174,6 @@ module Context = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "detailled level info" Level.encoding) describe ~title: "detailled level info" Level.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "next_level") RPC_path.(custom_root / "context" / "next_level")
let roll_value custom_root = let roll_value custom_root =
@ -196,7 +181,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror Tez.encoding) ~output: (wrap_tzerror Tez.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "roll_value") RPC_path.(custom_root / "context" / "roll_value")
let next_roll custom_root = let next_roll custom_root =
@ -204,7 +188,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror int32) ~output: (wrap_tzerror int32)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "next_roll") RPC_path.(custom_root / "context" / "next_roll")
let voting_period_kind custom_root = let voting_period_kind custom_root =
@ -216,7 +199,6 @@ module Context = struct
(wrap_tzerror @@ (wrap_tzerror @@
(obj1 (obj1
(req "voting_period_kind" Voting_period.kind_encoding))) (req "voting_period_kind" Voting_period.kind_encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "voting_period_kind") RPC_path.(custom_root / "context" / "voting_period_kind")
@ -249,7 +231,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror nonce_encoding) ~output: (wrap_tzerror nonce_encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "nonce" /: Raw_level.arg) RPC_path.(custom_root / "context" / "nonce" /: Raw_level.arg)
let hash custom_root = let hash custom_root =
@ -259,7 +240,6 @@ module Context = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "nonce hash" Nonce_hash.encoding) describe ~title: "nonce hash" Nonce_hash.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "nonce") RPC_path.(custom_root / "context" / "nonce")
end end
@ -279,7 +259,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror @@ list pk_encoding) ~output: (wrap_tzerror @@ list pk_encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "keys") RPC_path.(custom_root / "context" / "keys")
let get custom_root = let get custom_root =
@ -288,7 +267,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror @@ pk_encoding) ~output: (wrap_tzerror @@ pk_encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "keys" /: public_key_hash_arg ) RPC_path.(custom_root / "context" / "keys" /: public_key_hash_arg )
end end
@ -303,7 +281,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror Tez.encoding) ~output: (wrap_tzerror Tez.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "balance") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "balance")
let manager custom_root = let manager custom_root =
@ -312,7 +289,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror Ed25519.Public_key_hash.encoding) ~output: (wrap_tzerror Ed25519.Public_key_hash.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "manager") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "manager")
let delegate custom_root = let delegate custom_root =
@ -321,7 +297,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror (option Ed25519.Public_key_hash.encoding)) ~output: (wrap_tzerror (option Ed25519.Public_key_hash.encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "delegate") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "delegate")
let counter custom_root = let counter custom_root =
@ -330,7 +305,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror int32) ~output: (wrap_tzerror int32)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "counter") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "counter")
let spendable custom_root = let spendable custom_root =
@ -339,7 +313,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror bool) ~output: (wrap_tzerror bool)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "spendable") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "spendable")
let delegatable custom_root = let delegatable custom_root =
@ -348,7 +321,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror bool) ~output: (wrap_tzerror bool)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "delegatable") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "delegatable")
let script custom_root = let script custom_root =
@ -357,7 +329,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror (option Script.encoding)) ~output: (wrap_tzerror (option Script.encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "script") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "script")
let storage custom_root = let storage custom_root =
@ -366,7 +337,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror (option Script.expr_encoding)) ~output: (wrap_tzerror (option Script.expr_encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "storage") RPC_path.(custom_root / "context" / "contracts" /: Contract.arg / "storage")
type info = { type info = {
@ -399,7 +369,6 @@ module Context = struct
(opt "value" Ed25519.Public_key_hash.encoding)) (opt "value" Ed25519.Public_key_hash.encoding))
(opt "script" Script.encoding) (opt "script" Script.encoding)
(req "counter" int32)) (req "counter" int32))
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts" /: Contract.arg) RPC_path.(custom_root / "context" / "contracts" /: Contract.arg)
let list custom_root = let list custom_root =
@ -409,7 +378,6 @@ module Context = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: empty ~input: empty
~output: (wrap_tzerror @@ list Contract.encoding) ~output: (wrap_tzerror @@ list Contract.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "context" / "contracts") RPC_path.(custom_root / "context" / "contracts")
end end
@ -427,7 +395,6 @@ module Helpers = struct
~input: (obj1 (opt "priority" int31)) ~input: (obj1 (opt "priority" int31))
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "timestamp" Timestamp.encoding)) obj1 (req "timestamp" Timestamp.encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "minimal_timestamp") RPC_path.(custom_root / "helpers" / "minimal_timestamp")
let run_code_input_encoding = let run_code_input_encoding =
@ -449,7 +416,6 @@ module Helpers = struct
(req "storage" Script.expr_encoding) (req "storage" Script.expr_encoding)
(req "output" Script.expr_encoding) (req "output" Script.expr_encoding)
(opt "big_map_diff" (list (tup2 Script.expr_encoding (option Script.expr_encoding)))))) (opt "big_map_diff" (list (tup2 Script.expr_encoding (option Script.expr_encoding))))))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "run_code") RPC_path.(custom_root / "helpers" / "run_code")
let apply_operation custom_root = let apply_operation custom_root =
@ -463,7 +429,6 @@ module Helpers = struct
(opt "signature" Ed25519.Signature.encoding)) (opt "signature" Ed25519.Signature.encoding))
~output: (wrap_tzerror ~output: (wrap_tzerror
(obj1 (req "contracts" (list Contract.encoding)))) (obj1 (req "contracts" (list Contract.encoding))))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "apply_operation") RPC_path.(custom_root / "helpers" / "apply_operation")
@ -483,7 +448,6 @@ module Helpers = struct
(req "gas" Gas.encoding) (req "gas" Gas.encoding)
(req "stack" (list (Script.expr_encoding))))) (req "stack" (list (Script.expr_encoding)))))
(opt "big_map_diff" (list (tup2 Script.expr_encoding (option Script.expr_encoding)))))) (opt "big_map_diff" (list (tup2 Script.expr_encoding (option Script.expr_encoding))))))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "trace_code") RPC_path.(custom_root / "helpers" / "trace_code")
let typecheck_code custom_root = let typecheck_code custom_root =
@ -492,7 +456,6 @@ module Helpers = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Script.expr_encoding ~input: Script.expr_encoding
~output: (wrap_tzerror Script_tc_errors_registration.type_map_enc) ~output: (wrap_tzerror Script_tc_errors_registration.type_map_enc)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "typecheck_code") RPC_path.(custom_root / "helpers" / "typecheck_code")
let typecheck_data custom_root = let typecheck_data custom_root =
@ -504,7 +467,6 @@ module Helpers = struct
(req "data" Script.expr_encoding) (req "data" Script.expr_encoding)
(req "type" Script.expr_encoding)) (req "type" Script.expr_encoding))
~output: (wrap_tzerror empty) ~output: (wrap_tzerror empty)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "typecheck_data") RPC_path.(custom_root / "helpers" / "typecheck_data")
let hash_data custom_root = let hash_data custom_root =
@ -515,7 +477,6 @@ module Helpers = struct
(req "type" Script.expr_encoding)) (req "type" Script.expr_encoding))
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "hash" string)) obj1 (req "hash" string))
~error: Data_encoding.empty
~query: RPC_query.empty ~query: RPC_query.empty
RPC_path.(custom_root / "helpers" / "hash_data") RPC_path.(custom_root / "helpers" / "hash_data")
@ -527,7 +488,6 @@ module Helpers = struct
(opt "offset" int32)) (opt "offset" int32))
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
describe ~title: "block level and cycle information" Level.encoding) describe ~title: "block level and cycle information" Level.encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "level" /: Raw_level.arg) RPC_path.(custom_root / "helpers" / "level" /: Raw_level.arg)
let levels custom_root = let levels custom_root =
@ -540,7 +500,6 @@ module Helpers = struct
(obj2 (obj2
(req "first" Raw_level.encoding) (req "first" Raw_level.encoding)
(req "last" Raw_level.encoding))) (req "last" Raw_level.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "levels" /: Cycle.arg) RPC_path.(custom_root / "helpers" / "levels" /: Cycle.arg)
module Rights = struct module Rights = struct
@ -577,7 +536,6 @@ module Helpers = struct
(obj2 (obj2
(req "delegate" Ed25519.Public_key_hash.encoding) (req "delegate" Ed25519.Public_key_hash.encoding)
(req "timestamp" Timestamp.encoding))))) (req "timestamp" Timestamp.encoding)))))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" / "baking") RPC_path.(custom_root / "helpers" / "rights" / "baking")
let baking_rights_for_level custom_root = let baking_rights_for_level custom_root =
@ -592,7 +550,6 @@ module Helpers = struct
(req "level" Raw_level.encoding) (req "level" Raw_level.encoding)
(req "delegates" (req "delegates"
(list Ed25519.Public_key_hash.encoding))) (list Ed25519.Public_key_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "baking" / "level" /: Raw_level.arg ) / "baking" / "level" /: Raw_level.arg )
@ -604,7 +561,6 @@ module Helpers = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "levels" (list Raw_level.encoding))) obj1 (req "levels" (list Raw_level.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "baking" / "level" ) / "baking" / "level" )
@ -614,7 +570,6 @@ module Helpers = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: slots_range_encoding ~input: slots_range_encoding
~output: (wrap_tzerror (Data_encoding.list baking_slot_encoding)) ~output: (wrap_tzerror (Data_encoding.list baking_slot_encoding))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "baking" / "delegate" /: Context.Key.public_key_hash_arg ) / "baking" / "delegate" /: Context.Key.public_key_hash_arg )
@ -627,7 +582,6 @@ module Helpers = struct
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "delegates" obj1 (req "delegates"
(list Ed25519.Public_key_hash.encoding))) (list Ed25519.Public_key_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "baking" / "delegate" ) / "baking" / "delegate" )
@ -642,7 +596,6 @@ module Helpers = struct
(req "level" Raw_level.encoding) (req "level" Raw_level.encoding)
(req "delegates" (req "delegates"
(list Ed25519.Public_key_hash.encoding))) (list Ed25519.Public_key_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" / "endorsement") RPC_path.(custom_root / "helpers" / "rights" / "endorsement")
let endorsement_rights_for_level custom_root = let endorsement_rights_for_level custom_root =
@ -656,7 +609,6 @@ module Helpers = struct
(req "level" Raw_level.encoding) (req "level" Raw_level.encoding)
(req "delegates" (req "delegates"
(list Ed25519.Public_key_hash.encoding))) (list Ed25519.Public_key_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "endorsement" / "level" /: Raw_level.arg ) / "endorsement" / "level" /: Raw_level.arg )
@ -668,7 +620,6 @@ module Helpers = struct
~input: empty ~input: empty
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "levels" (list Raw_level.encoding))) obj1 (req "levels" (list Raw_level.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "endorsement" / "level" ) / "endorsement" / "level" )
@ -678,7 +629,6 @@ module Helpers = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: slots_range_encoding ~input: slots_range_encoding
~output: (wrap_tzerror @@ Data_encoding.list endorsement_slot_encoding) ~output: (wrap_tzerror @@ Data_encoding.list endorsement_slot_encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "endorsement" / "delegate" /: Context.Key.public_key_hash_arg ) / "endorsement" / "delegate" /: Context.Key.public_key_hash_arg )
@ -691,7 +641,6 @@ module Helpers = struct
~output: (wrap_tzerror @@ ~output: (wrap_tzerror @@
obj1 (req "delegates" obj1 (req "delegates"
(list Ed25519.Public_key_hash.encoding))) (list Ed25519.Public_key_hash.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "rights" RPC_path.(custom_root / "helpers" / "rights"
/ "endorsement" / "delegate" ) / "endorsement" / "delegate" )
@ -709,7 +658,6 @@ module Helpers = struct
(obj1 (obj1
(req "operation" @@ (req "operation" @@
describe ~title: "hex encoded operation" bytes))) describe ~title: "hex encoded operation" bytes)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "forge" / "operations" ) RPC_path.(custom_root / "helpers" / "forge" / "operations" )
let empty_proof_of_work_nonce = let empty_proof_of_work_nonce =
@ -729,7 +677,6 @@ module Helpers = struct
Tezos_context.Constants.proof_of_work_nonce_size) Tezos_context.Constants.proof_of_work_nonce_size)
empty_proof_of_work_nonce)) empty_proof_of_work_nonce))
~output: (wrap_tzerror bytes) ~output: (wrap_tzerror bytes)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "forge" / "block_proto_header") RPC_path.(custom_root / "helpers" / "forge" / "block_proto_header")
end end
@ -746,7 +693,6 @@ module Helpers = struct
(opt "check_signature" bool)) (opt "check_signature" bool))
~output: ~output:
(wrap_tzerror (list (dynamic_size Operation.encoding))) (wrap_tzerror (list (dynamic_size Operation.encoding)))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "parse" / "operations" ) RPC_path.(custom_root / "helpers" / "parse" / "operations" )
let block custom_root = let block custom_root =
@ -755,7 +701,6 @@ module Helpers = struct
~query: RPC_query.empty ~query: RPC_query.empty
~input: Block_header.raw_encoding ~input: Block_header.raw_encoding
~output: (wrap_tzerror Block_header.proto_header_encoding) ~output: (wrap_tzerror Block_header.proto_header_encoding)
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "parse" / "block" ) RPC_path.(custom_root / "helpers" / "parse" / "block" )
end end

View File

@ -37,7 +37,6 @@ let echo_service custom_root =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.(obj1 (req "msg" string)) ~input: Data_encoding.(obj1 (req "msg" string))
~output: Data_encoding.(obj1 (req "msg" string)) ~output: Data_encoding.(obj1 (req "msg" string))
~error: Data_encoding.empty
RPC_path.(custom_root / "echo") RPC_path.(custom_root / "echo")
let failing_service custom_root = let failing_service custom_root =
@ -46,7 +45,6 @@ let failing_service custom_root =
~query: RPC_query.empty ~query: RPC_query.empty
~input: Data_encoding.(obj1 (req "arg" int31)) ~input: Data_encoding.(obj1 (req "arg" int31))
~output: (wrap_tzerror Data_encoding.empty) ~output: (wrap_tzerror Data_encoding.empty)
~error: Data_encoding.empty
RPC_path.(custom_root / "failing") RPC_path.(custom_root / "failing")
let rpc_services : Updater.rpc_context RPC_directory.t = let dir = RPC_directory.empty in let rpc_services : Updater.rpc_context RPC_directory.t = let dir = RPC_directory.empty in

View File

@ -48,7 +48,6 @@ module Forge = struct
(req "context" Context_hash.encoding)) (req "context" Context_hash.encoding))
Data.Command.encoding) Data.Command.encoding)
~output: (obj1 (req "payload" bytes)) ~output: (obj1 (req "payload" bytes))
~error: Data_encoding.empty
RPC_path.(custom_root / "helpers" / "forge" / "block") RPC_path.(custom_root / "helpers" / "forge" / "block")
end end

View File

@ -138,8 +138,8 @@ module Make (Encoding : ENCODING) : sig
val register5: val register5:
'prefix directory -> 'prefix directory ->
('m, 'prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'e, 'q , 'i, 'o, 'e) Service.t -> ('m, 'prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'f, 'q , 'i, 'o, 'e) Service.t ->
('a -> 'b -> 'c -> 'd -> 'e -> 'q -> 'i -> [< ('o, 'e) Answer.t ] Lwt.t) -> ('a -> 'b -> 'c -> 'd -> 'f -> 'q -> 'i -> [< ('o, 'e) Answer.t ] Lwt.t) ->
'prefix directory 'prefix directory
(** Registring dynamic subtree. *) (** Registring dynamic subtree. *)