2018-01-26 16:07:49 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2018-01-26 16:07:49 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
open Data_encoding
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module S = struct
|
|
|
|
|
|
|
|
let protocols_arg = Protocol_hash.rpc_arg
|
|
|
|
|
|
|
|
let contents =
|
2018-04-21 15:09:59 +04:00
|
|
|
RPC_service.get_service
|
2018-02-08 13:51:02 +04:00
|
|
|
~query: RPC_query.empty
|
2018-04-21 15:09:59 +04:00
|
|
|
~output: Protocol.encoding
|
2018-02-08 13:51:02 +04:00
|
|
|
RPC_path.(root / "protocols" /: protocols_arg)
|
|
|
|
|
|
|
|
let list =
|
2018-04-21 15:09:59 +04:00
|
|
|
RPC_service.get_service
|
2018-02-08 13:51:02 +04:00
|
|
|
~query: RPC_query.empty
|
2018-04-21 15:09:59 +04:00
|
|
|
~output: (list Protocol_hash.encoding)
|
2018-02-08 13:51:02 +04:00
|
|
|
RPC_path.(root / "protocols")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
open RPC_context
|
|
|
|
let contents ctxt h =
|
|
|
|
make_call1 S.contents ctxt h () ()
|
2018-04-21 15:09:59 +04:00
|
|
|
let list ctxt =
|
|
|
|
make_call S.list ctxt () () ()
|
2018-02-08 13:51:02 +04:00
|
|
|
|