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

MinaProtocol / mina / 411

24 Jul 2025 03:14PM UTC coverage: 33.188% (-27.7%) from 60.871%
411

push

buildkite

web-flow
Merge pull request #17541 from MinaProtocol/brian/merge-compatible-into-develop

Merge compatible into develop

164 of 702 new or added lines in 96 files covered. (23.36%)

18243 existing lines in 393 files now uncovered.

23983 of 72264 relevant lines covered (33.19%)

24667.26 hits per line

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

6.45
/src/lib/network_pool/locally_generated.ml
1
open Core_kernel
56✔
2
open Mina_base
3
open Mina_transaction
4

5
type key = Transaction_hash.User_command_with_valid_signature.t
6

7
type value = Time.t * [ `Batch of int ]
8

9
type t =
10
  (Time.t * [ `Batch of int ] * User_command.Valid.t) Transaction_hash.Map.t ref
11

12
let find_and_remove (t : t) cmd =
UNCOV
13
  let hash =
×
14
    Transaction_hash.User_command_with_valid_signature.transaction_hash cmd
15
  in
UNCOV
16
  let%map.Option time, batch, _ = Transaction_hash.Map.find !t hash in
×
UNCOV
17
  t := Transaction_hash.Map.remove !t hash ;
×
18
  (time, batch)
19

20
let add_exn (t : t) ~key:cmd ~data:(time, batch) =
UNCOV
21
  let hash =
×
22
    Transaction_hash.User_command_with_valid_signature.transaction_hash cmd
23
  in
UNCOV
24
  let cmd_ = Transaction_hash.User_command_with_valid_signature.data cmd in
×
UNCOV
25
  t := Transaction_hash.Map.add_exn !t ~key:hash ~data:(time, batch, cmd_)
×
26

27
let mem (t : t) cmd =
28
  let hash =
×
29
    Transaction_hash.User_command_with_valid_signature.transaction_hash cmd
30
  in
31
  Transaction_hash.Map.mem !t hash
×
32

UNCOV
33
let create () = ref Transaction_hash.Map.empty
×
34

35
let update (t : t) cmd
36
    ~(f : (Time.t * [ `Batch of int ]) option -> Time.t * [ `Batch of int ]) =
UNCOV
37
  let hash =
×
38
    Transaction_hash.User_command_with_valid_signature.transaction_hash cmd
39
  in
UNCOV
40
  let cmd_ = Transaction_hash.User_command_with_valid_signature.data cmd in
×
UNCOV
41
  t :=
×
UNCOV
42
    Transaction_hash.Map.update !t hash ~f:(fun found ->
×
43
        let found' = Option.map ~f:(fun (t, b, _) -> (t, b)) found in
×
UNCOV
44
        let t', b' = f found' in
×
UNCOV
45
        (t', b', cmd_) )
×
46

47
let filteri_inplace (t : t) ~f =
UNCOV
48
  t :=
×
UNCOV
49
    Transaction_hash.Map.filteri !t ~f:(fun ~key ~data:(time, batch, cmd) ->
×
UNCOV
50
        f
×
UNCOV
51
          ~key:(Transaction_hash.User_command_with_valid_signature.make cmd key)
×
52
          ~data:(time, batch) )
53

54
let to_alist (t : t) =
UNCOV
55
  Transaction_hash.Map.to_alist !t
×
56
  |> List.map ~f:(fun (hash, (time, batch, cmd)) ->
UNCOV
57
         ( Transaction_hash.User_command_with_valid_signature.make cmd hash
×
58
         , (time, batch) ) )
59

60
let iter_intersection (a : t) (b : t) ~f =
UNCOV
61
  Transaction_hash.Map.iteri !a ~f:(fun ~key ~data:(time1, batch1, cmd) ->
×
UNCOV
62
      Transaction_hash.Map.find !b key
×
63
      |> Option.iter ~f:(fun (time2, batch2, _) ->
64
             f
×
65
               ~key:
66
                 (Transaction_hash.User_command_with_valid_signature.make cmd
×
67
                    key )
68
               (time1, batch1) (time2, batch2) ) )
69

70
let iteri (t : t) ~f =
UNCOV
71
  Transaction_hash.Map.iteri !t ~f:(fun ~key ~data:(time, batch, cmd) ->
×
UNCOV
72
      f
×
UNCOV
73
        ~key:(Transaction_hash.User_command_with_valid_signature.make cmd key)
×
74
        ~data:(time, batch) )
56✔
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