From c87e88d84d5b9e8b0dfd43de44efdefdcdfc72c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 23 Jan 2017 11:09:55 +0100 Subject: [PATCH] Shell: minor fix in RPC description --- src/node/shell/node_rpc_services.ml | 103 ++++++++++++++-------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/src/node/shell/node_rpc_services.ml b/src/node/shell/node_rpc_services.ml index 393b3ad49..b64dd2540 100644 --- a/src/node/shell/node_rpc_services.ml +++ b/src/node/shell/node_rpc_services.ml @@ -555,25 +555,23 @@ let inject_operation = RPCs ubder /blocks/prevalidation for more details on the \ prevalidation context." ~input: - (conv - (fun (block, blocking, force) -> (block, Some blocking, force)) - (fun (block, blocking, force) -> (block, unopt ~default:true blocking, force)) - (obj3 - (req "signedOperationContents" - (describe ~title: "Tezos signed operation (hex encoded)" - bytes)) - (opt "blocking" - (describe - ~description: - "Should the RPC wait for the operation to be \ - (pre-)validated before to answer. (default: true)" - bool)) - (opt "force" - (describe - ~description: - "Should we inject operation that are \"branch_refused\" \ - or \"branch_delayed\". (default: false)" - bool)))) + (obj3 + (req "signedOperationContents" + (describe ~title: "Tezos signed operation (hex encoded)" + bytes)) + (dft "blocking" + (describe + ~description: + "Should the RPC wait for the operation to be \ + (pre-)validated before to answer. (default: true)" + bool) + true) + (opt "force" + (describe + ~description: + "Should we inject operation that are \"branch_refused\" \ + or \"branch_delayed\". (default: false)" + bool))) ~output: (Error.wrap @@ describe @@ -582,21 +580,6 @@ let inject_operation = RPC.Path.(root / "inject_operation") let inject_protocol = - let proto = - (list - (obj3 - (req "name" - (describe ~title:"OCaml module name" - string)) - (opt "interface" - (describe - ~description:"Content of the .mli file" - string)) - (req "implementation" - (describe - ~description:"Content of the .ml file" - string)))) - in let proto_of_rpc = List.map (fun (name, interface, implementation) -> { Tezos_compiler.Protocol.name; interface; implementation }) @@ -605,28 +588,44 @@ let inject_protocol = List.map (fun { Tezos_compiler.Protocol.name; interface; implementation } -> (name, interface, implementation)) in + let proto = + conv + rpc_of_proto + proto_of_rpc + (list + (obj3 + (req "name" + (describe ~title:"OCaml module name" + string)) + (opt "interface" + (describe + ~description:"Content of the .mli file" + string)) + (req "implementation" + (describe + ~description:"Content of the .ml file" + string)))) + in RPC.service ~description: "Inject a protocol in node. Returns the ID of the protocol." ~input: - (conv - (fun (proto, blocking, force) -> (rpc_of_proto proto, Some blocking, force)) - (fun (proto, blocking, force) -> (proto_of_rpc proto, unopt ~default:true blocking, force)) - (obj3 - (req "protocol" - (describe ~title: "Tezos protocol" - proto)) - (opt "blocking" - (describe - ~description: - "Should the RPC wait for the protocol to be \ - validated before to answer. (default: true)" - bool)) - (opt "force" - (describe - ~description: - "Should we inject protocol that is invalid. (default: false)" - bool)))) + (obj3 + (req "protocol" + (describe ~title: "Tezos protocol" + proto)) + (dft "blocking" + (describe + ~description: + "Should the RPC wait for the protocol to be \ + validated before to answer. (default: true)" + bool) + true) + (opt "force" + (describe + ~description: + "Should we inject protocol that is invalid. (default: false)" + bool))) ~output: (Error.wrap @@ describe