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

MinaProtocol / mina / 535

25 Aug 2025 05:35PM UTC coverage: 32.09% (-28.7%) from 60.772%
535

push

buildkite

web-flow
Merge pull request #17673 from MinaProtocol/amcie-merge-release320-to-master

amcie-merge-release320-to-master

1010 of 3745 new or added lines in 242 files covered. (26.97%)

17403 existing lines in 378 files now uncovered.

23062 of 71866 relevant lines covered (32.09%)

24742.7 hits per line

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

7.41
/src/lib/cli_lib/render.ml
1
open Core_kernel
56✔
2
open Mina_base
3

4
module type Printable_intf = sig
5
  type t [@@deriving to_yojson]
6

7
  val to_text : t -> string
8
end
9

10
let print (type t) (module Print : Printable_intf with type t = t) ~error_ctx
11
    is_json = function
12
  | Ok t ->
×
13
      if is_json then
14
        printf "%s\n" (Print.to_yojson t |> Yojson.Safe.pretty_to_string)
×
15
      else printf "%s\n" (Print.to_text t)
×
16
  | Error e ->
×
17
      eprintf "%s\n%s\n" error_ctx (Error.to_string_hum e)
×
18

19
module String_list_formatter = struct
20
  type t = string list [@@deriving yojson]
×
21

22
  let log10 i = i |> Float.of_int |> Float.log10 |> Float.to_int
×
23

24
  let pp ppf pks =
25
    let max_padding = Int.max 1 (List.length pks) |> log10 in
×
26
    (* Create a format-string with padded integer *)
27
    let fmt =
×
28
      Scanf.format_from_string (Printf.sprintf "%%%di, %%s" max_padding) "%i%s"
×
29
    in
30
    let i = ref (-1) in
×
31
    Format.pp_open_vbox ppf 0 ;
32
    Format.pp_print_list ~pp_sep:Format.pp_print_cut
×
33
      (fun ppf e ->
34
        incr i ;
×
35
        Format.fprintf ppf fmt !i e )
×
36
      ppf pks ;
37
    Format.pp_close_box ppf ()
×
38

39
  let to_text pks = Format.asprintf "%a" pp pks
×
40
end
41

42
module Prove_receipt = struct
NEW
43
  type t = Receipt.Chain_hash.t * User_command.t list [@@deriving to_yojson]
×
44

45
  let to_text proof =
46
    sprintf "Merkle List of transactions:\n%s"
×
47
      (to_yojson proof |> Yojson.Safe.pretty_to_string)
×
48
end
49

50
module Public_key_with_details = struct
51
  module Pretty_account = struct
52
    type t = string * int * int
53

54
    let to_yojson (public_key, balance, nonce) =
55
      `Assoc
×
56
        [ ( public_key
57
          , `Assoc [ ("balance", `Int balance); ("nonce", `Int nonce) ] )
58
        ]
59
  end
60

61
  type t = Pretty_account.t list [@@deriving to_yojson]
×
62

63
  type format = { accounts : t } [@@deriving to_yojson, fields]
×
64

65
  let to_yojson t = format_to_yojson { accounts = t }
×
66

67
  let to_text account =
68
    List.map account ~f:(fun (public_key, balance, nonce) ->
×
69
        sprintf "%s, %d, %d" public_key balance nonce )
×
70
    |> String.concat ~sep:"\n"
71
end
112✔
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