• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MinaProtocol / mina / 2863

05 Nov 2024 06:20PM UTC coverage: 30.754% (-16.6%) from 47.311%
2863

push

buildkite

web-flow
Merge pull request #16296 from MinaProtocol/dkijania/more_multi_jobs

more multi jobs in CI

20276 of 65930 relevant lines covered (30.75%)

8631.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/lib/consensus/body_reference.ml
1
(* This module defines how a block header refers to the body of its block.
2
    At the moment, this is merely a hash of the body. But in an upcoming
3
    hard fork, we will be updating this to reference to point to the root
4
    "Bitswap block" CID along with a signature attesting to ownership over
5
    this association (for punishment and manipuluation prevention). This will
6
    allow us to upgrade block gossip to happen over Bitswap in a future
7
    soft fork release.*)
8

7✔
9
open Core_kernel
10
open Snark_params.Tick
11
open Fold_lib
12
open Mina_base_util
13

14
[%%versioned
15
module Stable = struct
16
  module V1 = struct
17
    type t = Blake2.Stable.V1.t [@@deriving sexp, yojson, hash, equal, compare]
×
18

19
    let to_latest = Fn.id
20
  end
21
end]
22

23
type t = Stable.Latest.t
24

25
[%%define_locally Stable.Latest.(t_of_sexp, sexp_of_t, to_yojson, of_yojson)]
26

27
type var = Boolean.var list
28

29
let fold t = Fold.string_bits (Blake2.to_raw_string t)
806✔
30

31
let var_of_t t : var = List.map (Fold.to_list @@ fold t) ~f:Boolean.var_of_value
×
32

33
let to_input t =
34
  let open Random_oracle.Input.Chunked in
806✔
35
  Array.reduce_exn ~f:append
36
    (Array.of_list_map
806✔
37
       (Fold.to_list (fold t))
806✔
38
       ~f:(fun b -> packed (field_of_bool b, 1)) )
206,336✔
39

40
let var_to_input (t : var) =
41
  let open Random_oracle.Input.Chunked in
46✔
42
  Array.reduce_exn ~f:append
43
    (Array.of_list_map t ~f:(fun b -> packed ((b :> Field.Var.t), 1)))
46✔
44

45
let typ : (var, t) Typ.t =
46
  Typ.transport
7✔
47
    (Typ.list ~length:256 Boolean.typ)
7✔
48
    ~there:(Fn.compose Fold.to_list fold)
7✔
49
    ~back:
50
      (Fn.compose Blake2.of_raw_string
7✔
51
         (Fn.compose Fold.bool_t_to_string Fold.of_list) )
7✔
52

53
let to_hex = Blake2.to_hex
54

55
let of_hex_exn = Blake2.of_hex
56

57
let to_raw_string = Blake2.to_raw_string
7✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc