Shell: minor fix in RPC description

This commit is contained in:
Grégoire Henry 2017-01-23 11:09:55 +01:00
parent 5266671c72
commit c87e88d84d

View File

@ -555,25 +555,23 @@ let inject_operation =
RPCs ubder /blocks/prevalidation for more details on the \ RPCs ubder /blocks/prevalidation for more details on the \
prevalidation context." prevalidation context."
~input: ~input:
(conv
(fun (block, blocking, force) -> (block, Some blocking, force))
(fun (block, blocking, force) -> (block, unopt ~default:true blocking, force))
(obj3 (obj3
(req "signedOperationContents" (req "signedOperationContents"
(describe ~title: "Tezos signed operation (hex encoded)" (describe ~title: "Tezos signed operation (hex encoded)"
bytes)) bytes))
(opt "blocking" (dft "blocking"
(describe (describe
~description: ~description:
"Should the RPC wait for the operation to be \ "Should the RPC wait for the operation to be \
(pre-)validated before to answer. (default: true)" (pre-)validated before to answer. (default: true)"
bool)) bool)
true)
(opt "force" (opt "force"
(describe (describe
~description: ~description:
"Should we inject operation that are \"branch_refused\" \ "Should we inject operation that are \"branch_refused\" \
or \"branch_delayed\". (default: false)" or \"branch_delayed\". (default: false)"
bool)))) bool)))
~output: ~output:
(Error.wrap @@ (Error.wrap @@
describe describe
@ -582,7 +580,18 @@ let inject_operation =
RPC.Path.(root / "inject_operation") RPC.Path.(root / "inject_operation")
let inject_protocol = let inject_protocol =
let proto_of_rpc =
List.map (fun (name, interface, implementation) ->
{ Tezos_compiler.Protocol.name; interface; implementation })
in
let rpc_of_proto =
List.map (fun { Tezos_compiler.Protocol.name; interface; implementation } ->
(name, interface, implementation))
in
let proto = let proto =
conv
rpc_of_proto
proto_of_rpc
(list (list
(obj3 (obj3
(req "name" (req "name"
@ -597,36 +606,26 @@ let inject_protocol =
~description:"Content of the .ml file" ~description:"Content of the .ml file"
string)))) string))))
in in
let proto_of_rpc =
List.map (fun (name, interface, implementation) ->
{ Tezos_compiler.Protocol.name; interface; implementation })
in
let rpc_of_proto =
List.map (fun { Tezos_compiler.Protocol.name; interface; implementation } ->
(name, interface, implementation))
in
RPC.service RPC.service
~description: ~description:
"Inject a protocol in node. Returns the ID of the protocol." "Inject a protocol in node. Returns the ID of the protocol."
~input: ~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 (obj3
(req "protocol" (req "protocol"
(describe ~title: "Tezos protocol" (describe ~title: "Tezos protocol"
proto)) proto))
(opt "blocking" (dft "blocking"
(describe (describe
~description: ~description:
"Should the RPC wait for the protocol to be \ "Should the RPC wait for the protocol to be \
validated before to answer. (default: true)" validated before to answer. (default: true)"
bool)) bool)
true)
(opt "force" (opt "force"
(describe (describe
~description: ~description:
"Should we inject protocol that is invalid. (default: false)" "Should we inject protocol that is invalid. (default: false)"
bool)))) bool)))
~output: ~output:
(Error.wrap @@ (Error.wrap @@
describe describe