Client: rename Client_rpcs.rpc_sig into Client_rpcs.ctxt

This commit is contained in:
Grégoire Henry 2017-12-07 17:43:21 +01:00 committed by Benjamin Canou
parent 4aa1b14ba6
commit 80b0e8d67a
17 changed files with 138 additions and 140 deletions

View File

@ -54,13 +54,13 @@ end
class type logging_rpcs = object class type logging_rpcs = object
inherit logger inherit logger
inherit Client_rpcs.rpc_sig inherit Client_rpcs.ctxt
end end
class type full_context = object class type full_context = object
inherit logger inherit logger
inherit wallet inherit wallet
inherit Client_rpcs.rpc_sig inherit Client_rpcs.ctxt
inherit block inherit block
end end

View File

@ -38,13 +38,13 @@ end
class type logging_rpcs = object class type logging_rpcs = object
inherit logger_sig inherit logger_sig
inherit Client_rpcs.rpc_sig inherit Client_rpcs.ctxt
end end
class type full_context = object class type full_context = object
inherit logger_sig inherit logger_sig
inherit wallet inherit wallet
inherit Client_rpcs.rpc_sig inherit Client_rpcs.ctxt
inherit block inherit block
end end
(** The [full_context] allows the client {!command} handlers to work in (** The [full_context] allows the client {!command} handlers to work in

View File

@ -12,7 +12,7 @@
open Client_rpcs open Client_rpcs
module Services = Node_rpc_services module Services = Node_rpc_services
let errors (rpc : #rpc_sig) = let errors (rpc : #Client_rpcs.ctxt) =
call_service0 rpc Services.Error.service () call_service0 rpc Services.Error.service ()
let forge_block_header rpc header = let forge_block_header rpc header =

View File

@ -7,18 +7,16 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
open Client_rpcs
val errors: val errors:
#rpc_sig -> Json_schema.schema tzresult Lwt.t #Client_rpcs.ctxt -> Json_schema.schema tzresult Lwt.t
val forge_block_header: val forge_block_header:
#rpc_sig -> #Client_rpcs.ctxt ->
Block_header.t -> Block_header.t ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val inject_block: val inject_block:
#rpc_sig -> #Client_rpcs.ctxt ->
?async:bool -> ?force:bool -> ?net_id:Net_id.t -> ?async:bool -> ?force:bool -> ?net_id:Net_id.t ->
MBytes.t -> Operation.t list list -> MBytes.t -> Operation.t list list ->
Block_hash.t tzresult Lwt.t Block_hash.t tzresult Lwt.t
@ -29,13 +27,13 @@ val inject_block:
fitness. *) fitness. *)
val inject_operation: val inject_operation:
#rpc_sig -> #Client_rpcs.ctxt ->
?async:bool -> ?force:bool -> ?net_id:Net_id.t -> ?async:bool -> ?force:bool -> ?net_id:Net_id.t ->
MBytes.t -> MBytes.t ->
Operation_hash.t tzresult Lwt.t Operation_hash.t tzresult Lwt.t
val inject_protocol: val inject_protocol:
#rpc_sig -> #Client_rpcs.ctxt ->
?async:bool -> ?force:bool -> ?async:bool -> ?force:bool ->
Protocol.t -> Protocol.t ->
Protocol_hash.t tzresult Lwt.t Protocol_hash.t tzresult Lwt.t
@ -45,39 +43,39 @@ module Blocks : sig
type block = Node_rpc_services.Blocks.block type block = Node_rpc_services.Blocks.block
val net_id: val net_id:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Net_id.t tzresult Lwt.t block -> Net_id.t tzresult Lwt.t
val level: val level:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Int32.t tzresult Lwt.t block -> Int32.t tzresult Lwt.t
val predecessor: val predecessor:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Block_hash.t tzresult Lwt.t block -> Block_hash.t tzresult Lwt.t
val predecessors: val predecessors:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> int -> Block_hash.t list tzresult Lwt.t block -> int -> Block_hash.t list tzresult Lwt.t
val hash: val hash:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Block_hash.t tzresult Lwt.t block -> Block_hash.t tzresult Lwt.t
val timestamp: val timestamp:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Time.t tzresult Lwt.t block -> Time.t tzresult Lwt.t
val fitness: val fitness:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> MBytes.t list tzresult Lwt.t block -> MBytes.t list tzresult Lwt.t
val operations: val operations:
#rpc_sig -> #Client_rpcs.ctxt ->
?contents:bool -> ?contents:bool ->
block -> (Operation_hash.t * Operation.t option) list list tzresult Lwt.t block -> (Operation_hash.t * Operation.t option) list list tzresult Lwt.t
val protocol: val protocol:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Protocol_hash.t tzresult Lwt.t block -> Protocol_hash.t tzresult Lwt.t
val test_network: val test_network:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> Test_network_status.t tzresult Lwt.t block -> Test_network_status.t tzresult Lwt.t
val pending_operations: val pending_operations:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
(error Preapply_result.t * Operation.t Operation_hash.Map.t) tzresult Lwt.t (error Preapply_result.t * Operation.t Operation_hash.Map.t) tzresult Lwt.t
@ -98,17 +96,17 @@ module Blocks : sig
} }
val info: val info:
#rpc_sig -> #Client_rpcs.ctxt ->
?include_ops:bool -> block -> block_info tzresult Lwt.t ?include_ops:bool -> block -> block_info tzresult Lwt.t
val list: val list:
#rpc_sig -> #Client_rpcs.ctxt ->
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list -> ?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
?delay:int -> ?min_date:Time.t -> ?min_heads:int -> ?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
unit -> block_info list list tzresult Lwt.t unit -> block_info list list tzresult Lwt.t
val monitor: val monitor:
#rpc_sig -> #Client_rpcs.ctxt ->
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list -> ?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
?delay:int -> ?min_date:Time.t -> ?min_heads:int -> ?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
unit -> block_info list list tzresult Lwt_stream.t tzresult Lwt.t unit -> block_info list list tzresult Lwt_stream.t tzresult Lwt.t
@ -119,7 +117,7 @@ module Blocks : sig
} }
val preapply: val preapply:
#rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
?timestamp:Time.t -> ?timestamp:Time.t ->
?sort:bool -> ?sort:bool ->
@ -131,7 +129,7 @@ end
module Operations : sig module Operations : sig
val monitor: val monitor:
#rpc_sig -> #Client_rpcs.ctxt ->
?contents:bool -> ?contents:bool ->
unit -> unit ->
(Operation_hash.t * Operation.t option) list list tzresult Lwt_stream.t tzresult Lwt.t (Operation_hash.t * Operation.t option) list list tzresult Lwt_stream.t tzresult Lwt.t
@ -141,42 +139,42 @@ end
module Protocols : sig module Protocols : sig
val contents: val contents:
#rpc_sig -> #Client_rpcs.ctxt ->
Protocol_hash.t -> Protocol.t tzresult Lwt.t Protocol_hash.t -> Protocol.t tzresult Lwt.t
val list: val list:
#rpc_sig -> #Client_rpcs.ctxt ->
?contents:bool -> unit -> ?contents:bool -> unit ->
(Protocol_hash.t * Protocol.t option) list tzresult Lwt.t (Protocol_hash.t * Protocol.t option) list tzresult Lwt.t
end end
val bootstrapped: val bootstrapped:
#rpc_sig -> (Block_hash.t * Time.t) tzresult Lwt_stream.t tzresult Lwt.t #Client_rpcs.ctxt -> (Block_hash.t * Time.t) tzresult Lwt_stream.t tzresult Lwt.t
module Network : sig module Network : sig
open P2p_types open P2p_types
val stat: val stat:
#rpc_sig -> Stat.t tzresult Lwt.t #Client_rpcs.ctxt -> Stat.t tzresult Lwt.t
val connections: val connections:
#rpc_sig -> Connection_info.t list tzresult Lwt.t #Client_rpcs.ctxt -> Connection_info.t list tzresult Lwt.t
val peers: val peers:
#rpc_sig -> (Peer_id.t * P2p_types.Peer_info.t) list tzresult Lwt.t #Client_rpcs.ctxt -> (Peer_id.t * P2p_types.Peer_info.t) list tzresult Lwt.t
val points: val points:
#rpc_sig -> (Point.t * P2p_types.Point_info.t) list tzresult Lwt.t #Client_rpcs.ctxt -> (Point.t * P2p_types.Point_info.t) list tzresult Lwt.t
end end
val complete: val complete:
#rpc_sig -> #Client_rpcs.ctxt ->
?block:Blocks.block -> string -> string list tzresult Lwt.t ?block:Blocks.block -> string -> string list tzresult Lwt.t
val describe: val describe:
#rpc_sig -> #Client_rpcs.ctxt ->
?recurse:bool -> string list -> ?recurse:bool -> string list ->
Data_encoding.json_schema RPC.Description.directory tzresult Lwt.t Data_encoding.json_schema RPC.Description.directory tzresult Lwt.t

View File

@ -186,7 +186,7 @@ let () =
let fail config err = fail (RPC_error (config, err)) let fail config err = fail (RPC_error (config, err))
class type rpc_sig = object class type ctxt = object
method get_json : method get_json :
RPC.meth -> RPC.meth ->
string list -> Data_encoding.json -> Data_encoding.json tzresult Lwt.t string list -> Data_encoding.json -> Data_encoding.json tzresult Lwt.t
@ -213,7 +213,7 @@ class type rpc_sig = object
Data_encoding.json -> 'output tzresult Lwt.t Data_encoding.json -> 'output tzresult Lwt.t
end end
class rpc config : rpc_sig = object (self) class rpc config : ctxt = object (self)
val config = config val config = config
method make_request : method make_request :
type a. (Uri.t -> Data_encoding.json -> a Lwt.t) -> type a. (Uri.t -> Data_encoding.json -> a Lwt.t) ->
@ -356,22 +356,22 @@ let forge_request (type i) (service: (_,_,_,_,i,_,_) RPC.Service.t) params body
let path = String.split_path (Uri.path uri) in (* Temporary *) let path = String.split_path (Uri.path uri) in (* Temporary *)
meth, path, json meth, path, json
let call_service0 (rpc : #rpc_sig) service arg = let call_service0 (rpc : #ctxt) service arg =
let meth, path, arg = forge_request service () arg in let meth, path, arg = forge_request service () arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_answer service path json rpc#parse_answer service path json
let call_service1 (rpc : #rpc_sig) service a1 arg = let call_service1 (rpc : #ctxt) service a1 arg =
let meth, path, arg = forge_request service ((), a1) arg in let meth, path, arg = forge_request service ((), a1) arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_answer service path json rpc#parse_answer service path json
let call_service2 (rpc : #rpc_sig) service a1 a2 arg = let call_service2 (rpc : #ctxt) service a1 a2 arg =
let meth, path, arg = forge_request service (((), a1), a2) arg in let meth, path, arg = forge_request service (((), a1), a2) arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_answer service path json rpc#parse_answer service path json
let call_streamed (rpc : #rpc_sig) service (meth, path, arg) = let call_streamed (rpc : #ctxt) service (meth, path, arg) =
rpc#get_streamed_json meth path arg >>=? fun json_st -> rpc#get_streamed_json meth path arg >>=? fun json_st ->
let parsed_st, push = Lwt_stream.create () in let parsed_st, push = Lwt_stream.create () in
let rec loop () = let rec loop () =
@ -389,23 +389,23 @@ let call_streamed (rpc : #rpc_sig) service (meth, path, arg) =
Lwt.async loop ; Lwt.async loop ;
return parsed_st return parsed_st
let call_streamed_service0 (rpc : #rpc_sig) service arg = let call_streamed_service0 (rpc : #ctxt) service arg =
call_streamed rpc service (forge_request service () arg) call_streamed rpc service (forge_request service () arg)
let call_streamed_service1 cctxt service arg1 arg2 = let call_streamed_service1 cctxt service arg1 arg2 =
call_streamed cctxt service (forge_request service ((), arg1) arg2) call_streamed cctxt service (forge_request service ((), arg1) arg2)
let call_err_service0 (rpc : #rpc_sig) service arg = let call_err_service0 (rpc : #ctxt) service arg =
let meth, path, arg = forge_request service () arg in let meth, path, arg = forge_request service () arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_err_answer service path json rpc#parse_err_answer service path json
let call_err_service1 (rpc : #rpc_sig) service a1 arg = let call_err_service1 (rpc : #ctxt) service a1 arg =
let meth, path, arg = forge_request service ((), a1) arg in let meth, path, arg = forge_request service ((), a1) arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_err_answer service path json rpc#parse_err_answer service path json
let call_err_service2 (rpc : #rpc_sig) service a1 a2 arg = let call_err_service2 (rpc : #ctxt) service a1 a2 arg =
let meth, path, arg = forge_request service (((), a1), a2) arg in let meth, path, arg = forge_request service (((), a1), a2) arg in
rpc#get_json meth path arg >>=? fun json -> rpc#get_json meth path arg >>=? fun json ->
rpc#parse_err_answer service path json rpc#parse_err_answer service path json

View File

@ -23,7 +23,7 @@ and logger =
'a -> Cohttp.Code.status_code -> string -> unit Lwt.t ; 'a -> Cohttp.Code.status_code -> string -> unit Lwt.t ;
} -> logger } -> logger
class type rpc_sig = object class type ctxt = object
method get_json : method get_json :
RPC.meth -> RPC.meth ->
string list -> Data_encoding.json -> string list -> Data_encoding.json ->
@ -51,7 +51,7 @@ class type rpc_sig = object
Data_encoding.json -> 'output tzresult Lwt.t Data_encoding.json -> 'output tzresult Lwt.t
end end
class rpc : config -> rpc_sig class rpc : config -> ctxt
val default_config: config val default_config: config
val null_logger: logger val null_logger: logger
@ -59,56 +59,56 @@ val timings_logger: Format.formatter -> logger
val full_logger: Format.formatter -> logger val full_logger: Format.formatter -> logger
val call_service0: val call_service0:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit, unit, 'i, unit, unit, 'i,
'o, unit) RPC.Service.t -> 'o, unit) RPC.Service.t ->
'i -> 'o tzresult Lwt.t 'i -> 'o tzresult Lwt.t
val call_service1: val call_service1:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit * 'a, unit, 'i, unit * 'a, unit, 'i,
'o, unit) RPC.Service.t -> 'o, unit) RPC.Service.t ->
'a -> 'i -> 'o tzresult Lwt.t 'a -> 'i -> 'o tzresult Lwt.t
val call_service2: val call_service2:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
(unit * 'a) * 'b, unit, 'i, (unit * 'a) * 'b, unit, 'i,
'o, unit) RPC.Service.t -> 'o, unit) 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:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit, unit, 'a, unit, unit, 'a,
'b, unit) RPC.Service.t -> 'b, unit) RPC.Service.t ->
'a -> 'b tzresult Lwt_stream.t tzresult Lwt.t 'a -> 'b tzresult Lwt_stream.t tzresult Lwt.t
val call_streamed_service1: val call_streamed_service1:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit * 'a, unit, 'b, unit * 'a, unit, 'b,
'c, unit) RPC.Service.t -> 'c, unit) RPC.Service.t ->
'a -> 'b -> 'c tzresult Lwt_stream.t tzresult Lwt.t 'a -> 'b -> 'c tzresult Lwt_stream.t tzresult Lwt.t
val call_err_service0: val call_err_service0:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit, unit, 'i, unit, unit, 'i,
'o tzresult, unit) RPC.Service.t -> 'o tzresult, unit) RPC.Service.t ->
'i -> 'o tzresult Lwt.t 'i -> 'o tzresult Lwt.t
val call_err_service1: val call_err_service1:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
unit * 'a, unit, 'i, unit * 'a, unit, 'i,
'o tzresult, unit) RPC.Service.t -> 'o tzresult, unit) RPC.Service.t ->
'a -> 'i -> 'o tzresult Lwt.t 'a -> 'i -> 'o tzresult Lwt.t
val call_err_service2: val call_err_service2:
#rpc_sig -> #ctxt ->
([ `POST ], unit, ([ `POST ], unit,
(unit * 'a) * 'b, unit, 'i, (unit * 'a) * 'b, unit, 'i,
'o tzresult, unit) RPC.Service.t -> 'o tzresult, unit) RPC.Service.t ->

View File

@ -18,21 +18,21 @@ type block_info = {
} }
val info: val info:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
?include_ops:bool -> Client_node_rpcs.Blocks.block -> block_info tzresult Lwt.t ?include_ops:bool -> Client_node_rpcs.Blocks.block -> block_info tzresult Lwt.t
val compare: val compare:
block_info -> block_info -> int block_info -> block_info -> int
val monitor: val monitor:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list -> ?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
?delay:int -> ?min_date:Time.t -> ?min_heads:int -> ?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
?compare:(block_info -> block_info -> int) -> ?compare:(block_info -> block_info -> int) ->
unit -> block_info list tzresult Lwt_stream.t tzresult Lwt.t unit -> block_info list tzresult Lwt_stream.t tzresult Lwt.t
val blocks_from_cycle: val blocks_from_cycle:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_node_rpcs.Blocks.block -> Client_node_rpcs.Blocks.block ->
Cycle.t -> Cycle.t ->
Block_hash.t list tzresult Lwt.t Block_hash.t list tzresult Lwt.t

View File

@ -14,7 +14,7 @@ val generate_seed_nonce: unit -> Nonce.t
reveal the aforementionned nonce during the next cycle. *) reveal the aforementionned nonce during the next cycle. *)
val inject_block: val inject_block:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
?force:bool -> ?force:bool ->
?net_id:Net_id.t -> ?net_id:Net_id.t ->
shell_header:Block_header.shell_header -> shell_header:Block_header.shell_header ->
@ -33,7 +33,7 @@ type error +=
| Failed_to_preapply of Tezos_base.Operation.t * error list | Failed_to_preapply of Tezos_base.Operation.t * error list
val forge_block: val forge_block:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
?force:bool -> ?force:bool ->
?operations:Tezos_base.Operation.t list -> ?operations:Tezos_base.Operation.t list ->

View File

@ -13,7 +13,7 @@ type operation = {
} }
val monitor: val monitor:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
?contents:bool -> ?check:bool -> unit -> ?contents:bool -> ?check:bool -> unit ->
operation list tzresult Lwt_stream.t tzresult Lwt.t operation list tzresult Lwt_stream.t tzresult Lwt.t
@ -25,6 +25,6 @@ type valid_endorsement = {
} }
val monitor_endorsement: val monitor_endorsement:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
valid_endorsement tzresult Lwt_stream.t tzresult Lwt.t valid_endorsement tzresult Lwt_stream.t tzresult Lwt.t

View File

@ -8,7 +8,7 @@
(**************************************************************************) (**************************************************************************)
val inject_seed_nonce_revelation: val inject_seed_nonce_revelation:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
?force:bool -> ?force:bool ->
?async:bool -> ?async:bool ->

View File

@ -11,10 +11,10 @@ open Tezos_micheline
open Client_proto_contracts open Client_proto_contracts
open Client_keys open Client_keys
let get_balance (rpc : #Client_rpcs.rpc_sig) block contract = let get_balance (rpc : #Client_rpcs.ctxt) block contract =
Client_proto_rpcs.Context.Contract.balance rpc block contract Client_proto_rpcs.Context.Contract.balance rpc block contract
let get_storage (rpc : #Client_rpcs.rpc_sig) block contract = let get_storage (rpc : #Client_rpcs.ctxt) block contract =
Client_proto_rpcs.Context.Contract.storage rpc block contract Client_proto_rpcs.Context.Contract.storage rpc block contract
let rec find_predecessor rpc_config h n = let rec find_predecessor rpc_config h n =
@ -192,7 +192,7 @@ let dictate rpc_config block command seckey =
assert (Operation_hash.equal oph injected_oph) ; assert (Operation_hash.equal oph injected_oph) ;
return oph return oph
let set_delegate (cctxt : #Client_rpcs.rpc_sig) block ~fee contract ~src_pk ~manager_sk opt_delegate = let set_delegate (cctxt : #Client_rpcs.ctxt) block ~fee contract ~src_pk ~manager_sk opt_delegate =
delegate_contract delegate_contract
cctxt block ~source:contract cctxt block ~source:contract
~src_pk ~manager_sk ~fee opt_delegate ~src_pk ~manager_sk ~fee opt_delegate

View File

@ -15,7 +15,7 @@ val list_contract_labels :
(string * string * string) list tzresult Lwt.t (string * string * string) list tzresult Lwt.t
val get_storage : val get_storage :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
Contract.t -> Contract.t ->
Script.expr option tzresult Lwt.t Script.expr option tzresult Lwt.t
@ -27,13 +27,13 @@ val get_manager :
(string * public_key_hash * public_key * secret_key) tzresult Lwt.t (string * public_key_hash * public_key * secret_key) tzresult Lwt.t
val get_balance: val get_balance:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
Contract.t -> Contract.t ->
Tez.t tzresult Lwt.t Tez.t tzresult Lwt.t
val set_delegate : val set_delegate :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
fee:Tez.tez -> fee:Tez.tez ->
Contract.t -> Contract.t ->
@ -66,7 +66,7 @@ val originate_account :
balance:Tez.tez -> balance:Tez.tez ->
fee:Tez.tez -> fee:Tez.tez ->
Client_rpcs.block -> Client_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
unit -> (Operation_list_hash.elt * Contract.t) tzresult Lwt.t unit -> (Operation_list_hash.elt * Contract.t) tzresult Lwt.t
val save_contract : val save_contract :
@ -104,11 +104,11 @@ val faucet :
?branch:int -> ?branch:int ->
manager_pkh:public_key_hash -> manager_pkh:public_key_hash ->
Client_rpcs.block -> Client_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
unit -> (Operation_list_hash.elt * Contract.t) tzresult Lwt.t unit -> (Operation_list_hash.elt * Contract.t) tzresult Lwt.t
val transfer : val transfer :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
?force:bool -> ?force:bool ->
?branch:int -> ?branch:int ->
@ -123,7 +123,7 @@ val transfer :
(Operation_hash.t * Contract.t list) tzresult Lwt.t (Operation_hash.t * Contract.t list) tzresult Lwt.t
val dictate : val dictate :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
dictator_operation -> dictator_operation ->
secret_key -> secret_key ->

View File

@ -38,19 +38,19 @@ val list_contracts:
(string * string * RawContractAlias.t) list tzresult Lwt.t (string * string * RawContractAlias.t) list tzresult Lwt.t
val get_manager: val get_manager:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
Contract.t -> Contract.t ->
public_key_hash tzresult Lwt.t public_key_hash tzresult Lwt.t
val get_delegate: val get_delegate:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
Contract.t -> Contract.t ->
public_key_hash tzresult Lwt.t public_key_hash tzresult Lwt.t
val check_public_key : val check_public_key :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
?src_pk:public_key -> ?src_pk:public_key ->
public_key_hash -> public_key_hash ->

View File

@ -69,7 +69,7 @@ let run
~(storage : Michelson_v1_parser.parsed) ~(storage : Michelson_v1_parser.parsed)
~(input : Michelson_v1_parser.parsed) ~(input : Michelson_v1_parser.parsed)
block block
(cctxt : #Client_rpcs.rpc_sig) = (cctxt : #Client_rpcs.ctxt) =
Client_proto_rpcs.Helpers.run_code cctxt Client_proto_rpcs.Helpers.run_code cctxt
block program.expanded (storage.expanded, input.expanded, amount) block program.expanded (storage.expanded, input.expanded, amount)
@ -79,7 +79,7 @@ let trace
~(storage : Michelson_v1_parser.parsed) ~(storage : Michelson_v1_parser.parsed)
~(input : Michelson_v1_parser.parsed) ~(input : Michelson_v1_parser.parsed)
block block
(cctxt : #Client_rpcs.rpc_sig) = (cctxt : #Client_rpcs.ctxt) =
Client_proto_rpcs.Helpers.trace_code cctxt Client_proto_rpcs.Helpers.trace_code cctxt
block program.expanded (storage.expanded, input.expanded, amount) block program.expanded (storage.expanded, input.expanded, amount)

View File

@ -18,7 +18,7 @@ val run :
storage:Michelson_v1_parser.parsed -> storage:Michelson_v1_parser.parsed ->
input:Michelson_v1_parser.parsed -> input:Michelson_v1_parser.parsed ->
Client_rpcs.block -> Client_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
(Script.expr * Script.expr) tzresult Lwt.t (Script.expr * Script.expr) tzresult Lwt.t
val trace : val trace :
@ -27,7 +27,7 @@ val trace :
storage:Michelson_v1_parser.parsed -> storage:Michelson_v1_parser.parsed ->
input:Michelson_v1_parser.parsed -> input:Michelson_v1_parser.parsed ->
Client_rpcs.block -> Client_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
(Script.expr * Script.expr * (int * int * Script.expr list) list) tzresult Lwt.t (Script.expr * Script.expr * (int * int * Script.expr list) list) tzresult Lwt.t
val print_trace_result : val print_trace_result :
@ -49,20 +49,20 @@ val hash_and_sign :
Michelson_v1_parser.parsed -> Michelson_v1_parser.parsed ->
Ed25519.Secret_key.t -> Ed25519.Secret_key.t ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
(string * string) tzresult Lwt.t (string * string) tzresult Lwt.t
val typecheck_data : val typecheck_data :
data:Michelson_v1_parser.parsed -> data:Michelson_v1_parser.parsed ->
ty:Michelson_v1_parser.parsed -> ty:Michelson_v1_parser.parsed ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
unit tzresult Lwt.t unit tzresult Lwt.t
val typecheck_program : val typecheck_program :
Michelson_v1_parser.parsed -> Michelson_v1_parser.parsed ->
Client_proto_rpcs.block -> Client_proto_rpcs.block ->
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
Script_ir_translator.type_map tzresult Lwt.t Script_ir_translator.type_map tzresult Lwt.t
val print_typecheck_result : val print_typecheck_result :

View File

@ -24,78 +24,78 @@ end
module Constants : sig module Constants : sig
val errors: val errors:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Json_schema.schema tzresult Lwt.t block -> Json_schema.schema tzresult Lwt.t
val cycle_length: val cycle_length:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int32 tzresult Lwt.t block -> int32 tzresult Lwt.t
val voting_period_length: val voting_period_length:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int32 tzresult Lwt.t block -> int32 tzresult Lwt.t
val time_before_reward: val time_before_reward:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Period.t tzresult Lwt.t block -> Period.t tzresult Lwt.t
val slot_durations: val slot_durations:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> (Period.t list) tzresult Lwt.t block -> (Period.t list) tzresult Lwt.t
val first_free_baking_slot: val first_free_baking_slot:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int tzresult Lwt.t block -> int tzresult Lwt.t
val max_signing_slot: val max_signing_slot:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int tzresult Lwt.t block -> int tzresult Lwt.t
val instructions_per_transaction: val instructions_per_transaction:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int tzresult Lwt.t block -> int tzresult Lwt.t
val stamp_threshold: val stamp_threshold:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> int64 tzresult Lwt.t block -> int64 tzresult Lwt.t
end end
module Context : sig module Context : sig
val level: val level:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Level.t tzresult Lwt.t block -> Level.t tzresult Lwt.t
(** [level cctxt blk] returns the (protocol view of the) level of (** [level cctxt blk] returns the (protocol view of the) level of
[blk]. *) [blk]. *)
val next_level: val next_level:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Level.t tzresult Lwt.t block -> Level.t tzresult Lwt.t
(** [next_level cctxt blk] returns the (protocol view of the) level (** [next_level cctxt blk] returns the (protocol view of the) level
of the successor of [blk]. *) of the successor of [blk]. *)
val voting_period_kind: val voting_period_kind:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Voting_period.kind tzresult Lwt.t block -> Voting_period.kind tzresult Lwt.t
(** [voting_period_kind cctxt blk] returns the voting period kind (** [voting_period_kind cctxt blk] returns the voting period kind
of [blk]. *) of [blk]. *)
module Nonce : sig module Nonce : sig
val hash: val hash:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Nonce_hash.t tzresult Lwt.t block -> Nonce_hash.t tzresult Lwt.t
type nonce_info = type nonce_info =
| Revealed of Nonce.t | Revealed of Nonce.t
| Missing of Nonce_hash.t | Missing of Nonce_hash.t
| Forgotten | Forgotten
val get: val get:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Raw_level.t -> nonce_info tzresult Lwt.t block -> Raw_level.t -> nonce_info tzresult Lwt.t
end end
module Key : sig module Key : sig
val get : val get :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
public_key_hash -> (public_key_hash * public_key) tzresult Lwt.t public_key_hash -> (public_key_hash * public_key) tzresult Lwt.t
val list : val list :
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
((public_key_hash * public_key) list) tzresult Lwt.t ((public_key_hash * public_key) list) tzresult Lwt.t
end end
module Contract : sig module Contract : sig
val list: val list:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t list tzresult Lwt.t block -> Contract.t list tzresult Lwt.t
type info = { type info = {
manager: public_key_hash ; manager: public_key_hash ;
@ -106,91 +106,91 @@ module Context : sig
counter: int32 ; counter: int32 ;
} }
val get: val get:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> info tzresult Lwt.t block -> Contract.t -> info tzresult Lwt.t
val balance: val balance:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
Tez.t tzresult Lwt.t Tez.t tzresult Lwt.t
val manager: val manager:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
public_key_hash tzresult Lwt.t public_key_hash tzresult Lwt.t
val delegate: val delegate:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
public_key_hash option tzresult Lwt.t public_key_hash option tzresult Lwt.t
val counter: val counter:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
int32 tzresult Lwt.t int32 tzresult Lwt.t
val spendable: val spendable:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
bool tzresult Lwt.t bool tzresult Lwt.t
val delegatable: val delegatable:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> block -> Contract.t ->
bool tzresult Lwt.t bool tzresult Lwt.t
val script: val script:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> Script.t option tzresult Lwt.t block -> Contract.t -> Script.t option tzresult Lwt.t
val storage: val storage:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Contract.t -> Script.expr option tzresult Lwt.t block -> Contract.t -> Script.expr option tzresult Lwt.t
end end
end end
module Helpers : sig module Helpers : sig
val minimal_time: val minimal_time:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> ?prio:int -> unit -> Time.t tzresult Lwt.t block -> ?prio:int -> unit -> Time.t tzresult Lwt.t
(** [minimal_time cctxt blk ?prio ()] is the minimal acceptable (** [minimal_time cctxt blk ?prio ()] is the minimal acceptable
timestamp for the successor of [blk]. [?prio] defaults to timestamp for the successor of [blk]. [?prio] defaults to
[0]. *) [0]. *)
val apply_operation: val apply_operation:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Block_hash.t -> Operation_hash.t -> MBytes.t -> Ed25519.Signature.t option -> block -> Block_hash.t -> Operation_hash.t -> MBytes.t -> Ed25519.Signature.t option ->
(Contract.t list) tzresult Lwt.t (Contract.t list) tzresult Lwt.t
val run_code: val run_code:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Script.expr -> block -> Script.expr ->
(Script.expr * Script.expr * Tez.t) -> (Script.expr * Script.expr * Tez.t) ->
(Script.expr * Script.expr) tzresult Lwt.t (Script.expr * Script.expr) tzresult Lwt.t
val trace_code: val trace_code:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Script.expr -> block -> Script.expr ->
(Script.expr * Script.expr * Tez.t) -> (Script.expr * Script.expr * Tez.t) ->
(Script.expr * Script.expr * (Script.expr * Script.expr *
(Script.location * int * Script.expr list) list) tzresult Lwt.t (Script.location * int * Script.expr list) list) tzresult Lwt.t
val typecheck_code: val typecheck_code:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Script.expr -> Script_ir_translator.type_map tzresult Lwt.t block -> Script.expr -> Script_ir_translator.type_map tzresult Lwt.t
val typecheck_data: val typecheck_data:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Script.expr * Script.expr -> unit tzresult Lwt.t block -> Script.expr * Script.expr -> unit tzresult Lwt.t
val hash_data: val hash_data:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Script.expr -> string tzresult Lwt.t block -> Script.expr -> string tzresult Lwt.t
val level: val level:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> ?offset:int32 -> Raw_level.t -> Level.t tzresult Lwt.t block -> ?offset:int32 -> Raw_level.t -> Level.t tzresult Lwt.t
val levels: val levels:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Cycle.t -> (Raw_level.t * Raw_level.t) tzresult Lwt.t block -> Cycle.t -> (Raw_level.t * Raw_level.t) tzresult Lwt.t
module Rights : sig module Rights : sig
type baking_slot = Raw_level.t * int * Time.t type baking_slot = Raw_level.t * int * Time.t
type endorsement_slot = Raw_level.t * int type endorsement_slot = Raw_level.t * int
val baking_rights_for_delegate: val baking_rights_for_delegate:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> public_key_hash -> block -> public_key_hash ->
?max_priority:int -> ?first_level:Raw_level.t -> ?max_priority:int -> ?first_level:Raw_level.t ->
?last_level:Raw_level.t -> unit -> ?last_level:Raw_level.t -> unit ->
(baking_slot list) tzresult Lwt.t (baking_slot list) tzresult Lwt.t
val endorsement_rights_for_delegate: val endorsement_rights_for_delegate:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> public_key_hash -> block -> public_key_hash ->
?max_priority:int -> ?first_level:Raw_level.t -> ?last_level:Raw_level.t -> unit -> ?max_priority:int -> ?first_level:Raw_level.t -> ?last_level:Raw_level.t -> unit ->
(endorsement_slot list) tzresult Lwt.t (endorsement_slot list) tzresult Lwt.t
@ -199,7 +199,7 @@ module Helpers : sig
module Forge : sig module Forge : sig
module Manager : sig module Manager : sig
val operations: val operations:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:Contract.t -> source:Contract.t ->
@ -209,7 +209,7 @@ module Helpers : sig
manager_operation list -> manager_operation list ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val transaction: val transaction:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:Contract.t -> source:Contract.t ->
@ -221,7 +221,7 @@ module Helpers : sig
fee:Tez.t -> fee:Tez.t ->
unit -> MBytes.t tzresult Lwt.t unit -> MBytes.t tzresult Lwt.t
val origination: val origination:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:Contract.t -> source:Contract.t ->
@ -237,7 +237,7 @@ module Helpers : sig
unit -> unit ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val delegation: val delegation:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:Contract.t -> source:Contract.t ->
@ -249,19 +249,19 @@ module Helpers : sig
end end
module Dictator : sig module Dictator : sig
val operation: val operation:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
dictator_operation -> dictator_operation ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val activate: val activate:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
Protocol_hash.t -> Protocol_hash.t ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val activate_testnet: val activate_testnet:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
Protocol_hash.t -> Protocol_hash.t ->
@ -269,14 +269,14 @@ module Helpers : sig
end end
module Delegate : sig module Delegate : sig
val operations: val operations:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:public_key -> source:public_key ->
delegate_operation list -> delegate_operation list ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val endorsement: val endorsement:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:public_key -> source:public_key ->
@ -284,7 +284,7 @@ module Helpers : sig
slot:int -> slot:int ->
unit -> MBytes.t tzresult Lwt.t unit -> MBytes.t tzresult Lwt.t
val proposals: val proposals:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:public_key -> source:public_key ->
@ -292,7 +292,7 @@ module Helpers : sig
proposals:Protocol_hash.t list -> proposals:Protocol_hash.t list ->
unit -> MBytes.t tzresult Lwt.t unit -> MBytes.t tzresult Lwt.t
val ballot: val ballot:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
source:public_key -> source:public_key ->
@ -303,27 +303,27 @@ module Helpers : sig
end end
module Anonymous : sig module Anonymous : sig
val operations: val operations:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
anonymous_operation list -> anonymous_operation list ->
MBytes.t tzresult Lwt.t MBytes.t tzresult Lwt.t
val seed_nonce_revelation: val seed_nonce_revelation:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
level:Raw_level.t -> level:Raw_level.t ->
nonce:Nonce.t -> nonce:Nonce.t ->
unit -> MBytes.t tzresult Lwt.t unit -> MBytes.t tzresult Lwt.t
val faucet: val faucet:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
branch:Block_hash.t -> branch:Block_hash.t ->
id:public_key_hash -> id:public_key_hash ->
unit -> MBytes.t tzresult Lwt.t unit -> MBytes.t tzresult Lwt.t
end end
val block_proto_header: val block_proto_header:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> block ->
priority: int -> priority: int ->
seed_nonce_hash: Nonce_hash.t -> seed_nonce_hash: Nonce_hash.t ->
@ -333,11 +333,11 @@ module Helpers : sig
module Parse : sig module Parse : sig
val operations: val operations:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> ?check:bool -> Operation.raw list -> block -> ?check:bool -> Operation.raw list ->
Operation.t list tzresult Lwt.t Operation.t list tzresult Lwt.t
val block: val block:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
block -> Block_header.shell_header -> MBytes.t -> block -> Block_header.shell_header -> MBytes.t ->
Block_header.proto_header tzresult Lwt.t Block_header.proto_header tzresult Lwt.t
end end

View File

@ -10,7 +10,7 @@
open Tezos_embedded_raw_protocol_genesis open Tezos_embedded_raw_protocol_genesis
val bake: val bake:
#Client_rpcs.rpc_sig -> #Client_rpcs.ctxt ->
?timestamp: Time.t -> ?timestamp: Time.t ->
Client_node_rpcs.Blocks.block -> Client_node_rpcs.Blocks.block ->
Data.Command.t -> Data.Command.t ->