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

MinaProtocol / mina / 3409

26 Feb 2025 01:10PM UTC coverage: 32.353% (-28.4%) from 60.756%
3409

push

buildkite

web-flow
Merge pull request #16687 from MinaProtocol/dw/merge-compatible-into-develop-20250225

Merge compatible into develop [20250224]

23144 of 71535 relevant lines covered (32.35%)

16324.05 hits per line

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

13.04
/src/lib/work_selector/inputs.ml
1
open Core_kernel
6✔
2
open Currency
3

4
module Test_inputs = struct
5
  module Transaction_witness = Int
6
  module Ledger_hash = Int
7
  module Sparse_ledger = Int
8
  module Transaction = Int
9
  module Ledger_proof_statement = Fee
10

11
  module Transaction_protocol_state = struct
12
    type 'a t = 'a
13
  end
14

15
  module Ledger_proof = struct
16
    type t = Fee.t [@@deriving hash, compare, sexp]
×
17

18
    module Stable = struct
19
      module Latest = struct
20
        type nonrec t = t
21
      end
22
    end
23

24
    module Cached = struct
25
      type nonrec t = t
26

27
      let read_proof_from_disk = Fn.id
28
    end
29
  end
30

31
  module Transaction_snark_work = struct
32
    module Checked = struct
33
      type t = Fee.t
34

35
      let fee = Fn.id
36

37
      let prover _ = Key_gen.Sample_keypairs.genesis_winner |> fst
×
38
    end
39

40
    include Checked
41

42
    module Statement = struct
43
      type t = Transaction_snark.Statement.t One_or_two.t
44
    end
45
  end
46

47
  module Snark_pool = struct
48
    [%%versioned
49
    module Stable = struct
50
      [@@@no_toplevel_latest_type]
51

52
      module V2 = struct
53
        type t = Transaction_snark.Statement.Stable.V2.t One_or_two.Stable.V1.t
×
54
        [@@deriving hash, compare, sexp]
30✔
55

56
        let to_latest = Fn.id
57
      end
58
    end]
59

60
    module Work = Hashable.Make_binable (Stable.Latest)
61

62
    type t = Currency.Fee.t Work.Table.t
63

64
    let get_completed_work (t : t) = Work.Table.find t
×
65

66
    let create () = Work.Table.create ()
×
67

68
    let add_snark t ~work ~fee =
69
      Work.Table.update t work ~f:(function
×
70
        | None ->
×
71
            fee
72
        | Some fee' ->
×
73
            Currency.Fee.min fee fee' )
74
  end
75

76
  module Staged_ledger = struct
77
    type t =
78
      (int, Transaction_snark_work.t) Snark_work_lib.Work.Single.Spec.t List.t
79

80
    let work = Fn.id
81

82
    let all_work_pairs t ~get_state:_ = Ok (One_or_two.group_list t)
×
83
  end
84

85
  module Transition_frontier = struct
86
    type t = Staged_ledger.t
87

88
    type best_tip_view = unit
89

90
    let best_tip_pipe : t -> best_tip_view Pipe_lib.Broadcast_pipe.Reader.t =
91
     fun _t ->
92
      let reader, _writer = Pipe_lib.Broadcast_pipe.create () in
×
93
      reader
×
94

95
    let best_tip_staged_ledger = Fn.id
96

97
    let get_protocol_state _t _hash =
98
      Ok
×
99
        (Lazy.force Precomputed_values.for_unit_tests)
×
100
          .protocol_state_with_hashes
101
          .data
102
  end
103
end
104

105
module Implementation_inputs = struct
106
  open Mina_base
107
  open Mina_transaction
108
  module Ledger_hash = Ledger_hash
109
  module Sparse_ledger = Mina_ledger.Sparse_ledger
110
  module Transaction = Transaction
111
  module Transaction_witness = Transaction_witness
112
  module Ledger_proof = Ledger_proof
113
  module Transaction_snark_work = Transaction_snark_work
114
  module Snark_pool = Network_pool.Snark_pool
115
  module Staged_ledger = Staged_ledger
116
  module Transaction_protocol_state = Transaction_protocol_state
117

118
  module Transition_frontier = struct
119
    type t = Transition_frontier.t
120

121
    type best_tip_view = Extensions.Best_tip_diff.view
122

123
    let best_tip_pipe : t -> best_tip_view Pipe_lib.Broadcast_pipe.Reader.t =
124
     fun t ->
125
      let open Transition_frontier.Extensions in
×
126
      let extensions = Transition_frontier.extensions t in
127
      get_view_pipe extensions Best_tip_diff
×
128

129
    let best_tip_staged_ledger t =
130
      Transition_frontier.(best_tip t |> Breadcrumb.staged_ledger)
×
131

132
    let get_protocol_state t state_hash =
133
      match Transition_frontier.find_protocol_state t state_hash with
×
134
      | Some p ->
×
135
          Ok p
136
      | None ->
×
137
          Or_error.errorf
138
            !"Protocol state with hash %{sexp: State_hash.t} not found"
×
139
            state_hash
140
  end
141
end
6✔
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