package octez-protocol-019-PtParisB-libs

  1. Overview
  2. Docs
Octez protocol 019-PtParisB libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/src/octez-protocol-019-PtParisB-libs.dal/RPC_directory.ml.html

Source file RPC_directory.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
(*****************************************************************************)
(*                                                                           *)
(* SPDX-License-Identifier: MIT                                              *)
(* SPDX-FileCopyrightText: 2024 Functori, <contact@functori.com>             *)
(* SPDX-FileCopyrightText: 2024 Nomadic Labs, <contact@nomadic-labs.com>     *)
(*                                                                           *)
(*****************************************************************************)

module Dal_proto_services = Dal_services
open Protocol

module Skip_list_handlers = struct
  let cell (rpc_context, cell_hash) () () =
    let open Lwt_result_syntax in
    let hash =
      Dal_proto_types.Skip_list_hash.of_proto
        Alpha_context.Dal.Slots_history.Pointer_hash.encoding
        cell_hash
    in
    let* cell = Skip_list_cells_store.find rpc_context hash in
    return
    @@ Dal_proto_types.Skip_list_cell.to_proto
         Alpha_context.Dal.Slots_history.encoding
         cell
end

let add_service registerer subst service handler directory =
  registerer directory (subst service) handler

let register_commitments_history ctxt directory =
  directory
  |> add_service
       Tezos_rpc.Directory.register
       Tezos_rpc.Service.subst1
       Dal_proto_services.Commitments_history.hash_content
       Skip_list_handlers.cell
  |> Tezos_rpc.Directory.map (fun _prefix -> Lwt.return ctxt)

let directory (rpc_ctxt : Skip_list_cells_store.t) =
  register_commitments_history rpc_ctxt Tezos_rpc.Directory.empty
OCaml

Innovation. Community. Security.