• 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

63.64
/src/lib/mina_block/validated_block.ml
1
open Core_kernel
3✔
2
open Mina_base
3

4
[%%versioned
5
module Stable = struct
6
  module V2 = struct
7
    type t =
3✔
8
      Block.Stable.V2.t State_hash.With_state_hashes.Stable.V1.t
×
9
      * State_hash.Stable.V1.t Mina_stdlib.Nonempty_list.Stable.V1.t
×
10
    [@@deriving sexp, equal]
15✔
11

12
    let to_yojson (block_with_hashes, _) =
13
      State_hash.With_state_hashes.Stable.V1.to_yojson Block.Stable.V2.to_yojson
×
14
        block_with_hashes
15

16
    let to_latest = ident
17
  end
18
end]
19

20
type t = Stable.Latest.t
21

22
[%%define_locally Stable.Latest.(t_of_sexp, sexp_of_t, equal, to_yojson)]
23

24
let lift (b, v) =
25
  match v with
220✔
26
  | _, _, _, (`Delta_block_chain, Truth.True delta_block_chain_proof), _, _, _
220✔
27
    ->
28
      (b, delta_block_chain_proof)
29

30
let forget (b, _) = b
1,180✔
31

32
let remember (b, delta_block_chain_proof) =
33
  ( b
200✔
34
  , ( (`Time_received, Truth.True ())
35
    , (`Genesis_state, Truth.True ())
36
    , (`Proof, Truth.True ())
37
    , (`Delta_block_chain, Truth.True delta_block_chain_proof)
38
    , (`Frontier_dependencies, Truth.True ())
39
    , (`Staged_ledger_diff, Truth.True ())
40
    , (`Protocol_versions, Truth.True ()) ) )
41

42
let delta_block_chain_proof (_, d) = d
×
43

44
let valid_commands (block, _) =
45
  block |> With_hash.data |> Block.body
200✔
46
  |> Staged_ledger_diff.Body.staged_ledger_diff |> Staged_ledger_diff.commands
200✔
47
  |> List.map ~f:(fun cmd ->
48
         (* This is safe because at this point the stage ledger diff has been
49
              applied successfully. *)
50
         let (`If_this_is_used_it_should_have_a_comment_justifying_it data) =
480✔
51
           User_command.to_valid_unsafe cmd.data
52
         in
53
         { cmd with data } )
480✔
54

55
let unsafe_of_trusted_block ~delta_block_chain_proof
56
    (`This_block_is_trusted_to_be_safe b) =
57
  (b, delta_block_chain_proof)
200✔
58

59
let state_hash (b, _) = State_hash.With_state_hashes.state_hash b
400✔
60

61
let state_body_hash (t, _) =
62
  State_hash.With_state_hashes.state_body_hash t
×
63
    ~compute_hashes:
64
      (Fn.compose Mina_state.Protocol_state.hashes
×
65
         (Fn.compose Header.protocol_state Block.header) )
×
66

67
let header t = t |> forget |> With_hash.data |> Block.header
200✔
68

69
let body t = t |> forget |> With_hash.data |> Block.body
×
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