Source file alpha_client_context.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module Lifted_protocol = Tezos_protocol_001_PtCJ7pwo_lifted.Lifted_protocol
module Alpha_block_services =
Block_services.Make (Lifted_protocol) (Lifted_protocol)
(** Client RPC context *)
class type rpc_context =
object
inherit Tezos_rpc.Context.generic
inherit
[Shell_services.chain * Shell_services.block] Environment.RPC_context
.simple
end
class wrap_rpc_context (t : Tezos_rpc.Context.generic) : rpc_context =
object
method base : Uri.t = t#base
method generic_media_type_call = t#generic_media_type_call
method call_service
: 'm 'p 'q 'i 'o.
(([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t ->
'p ->
'q ->
'i ->
'o tzresult Lwt.t =
t#call_service
method call_streamed_service
: 'm 'p 'q 'i 'o.
(([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t ->
on_chunk:('o -> unit) ->
on_close:(unit -> unit) ->
'p ->
'q ->
'i ->
(unit -> unit) tzresult Lwt.t =
t#call_streamed_service
inherit
[Shell_services.chain, Shell_services.block] Environment.proto_rpc_context
(t :> Tezos_rpc.Context.t)
Shell_services.Blocks.path
end
class type full =
object
inherit Client_context.full
inherit
[Shell_services.chain * Shell_services.block] Environment.RPC_context
.simple
inherit
[Shell_services.chain, Shell_services.block] Environment.proto_rpc_context
end
class wrap_full (t : Client_context.full) : full =
object
inherit Client_context.proxy_context t
inherit
[Shell_services.chain, Shell_services.block] Environment.proto_rpc_context
(t :> Tezos_rpc.Context.t)
Shell_services.Blocks.path
end
let register_error_kind category ~id ~title ~description ?pp encoding from_error
to_error =
let id = "client." ^ Protocol.name ^ "." ^ id in
register_error_kind
category
~id
~title
~description
?pp
encoding
from_error
to_error