Skip to content

Commit f010790

Browse files
committed
Remove unused sexp derivations from masking ledger
Sexp derivation where not used in any meaningful way, and cluttered the code a lot.
1 parent b5e8e4a commit f010790

File tree

6 files changed

+7
-27
lines changed

6 files changed

+7
-27
lines changed

src/lib/merkle_ledger/any_ledger.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ module Make_base (Inputs : Intf.Inputs.Intf) :
4343

4444
let cast (m : (module Base_intf with type t = 'a)) (t : 'a) = T (m, t)
4545

46-
let sexp_of_witness (T ((module B), t)) = B.sexp_of_t t
47-
4846
(** M can be used wherever a base ledger is demanded, construct instances
4947
* by using the witness constructor directly
5048
*
@@ -53,9 +51,7 @@ module Make_base (Inputs : Intf.Inputs.Intf) :
5351
* In the future, this should be a `ppx`.
5452
*)
5553
module M : Base_intf with type t = witness = struct
56-
type t = witness [@@deriving sexp_of]
57-
58-
let t_of_sexp _ = failwith "t_of_sexp unimplemented"
54+
type t = witness
5955

6056
type index = int
6157

src/lib/merkle_ledger/intf.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ module type SYNCABLE = sig
216216

217217
type addr
218218

219-
type t [@@deriving sexp]
219+
type t
220220

221221
type path
222222

@@ -450,7 +450,7 @@ module Ledger = struct
450450

451451
(** The type of the witness for a base ledger exposed here so that it can
452452
* be easily accessed from outside this module *)
453-
type witness [@@deriving sexp_of]
453+
type witness
454454

455455
module type Base_intf =
456456
S

src/lib/merkle_ledger/null_ledger.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ end = struct
1616

1717
type t = { uuid : Uuid.t; depth : int } [@@deriving sexp_of]
1818

19-
let t_of_sexp _ = failwith "t_of_sexp unimplemented"
20-
2119
type index = int
2220

2321
module Location = Location

src/lib/merkle_mask/masking_merkle_tree.ml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ module Make (Inputs : Inputs_intf.S) = struct
1616
issues with bin_io to do so *)
1717
module Parent = struct
1818
type t = (Base.t, string (* Location where null was set *)) Result.t
19-
[@@deriving sexp]
2019
end
2120

2221
module Detached_parent_signal = struct
2322
type t = unit Async.Ivar.t
24-
25-
let sexp_of_t (_ : t) = Sexp.List []
26-
27-
let t_of_sexp (_ : Sexp.t) : t = Async.Ivar.create ()
2823
end
2924

3025
type maps_t =
@@ -34,7 +29,6 @@ module Make (Inputs : Inputs_intf.S) = struct
3429
; locations : Location.t Account_id.Map.t
3530
; non_existent_accounts : Account_id.Set.t
3631
}
37-
[@@deriving sexp]
3832

3933
(** Merges second maps object into the first one,
4034
potentially overwriting some keys *)
@@ -91,12 +85,11 @@ module Make (Inputs : Inputs_intf.S) = struct
9185
(* If present, contains maps containing changes both for this mask
9286
and for a few ancestors.
9387
This is used as a lookup cache. *)
94-
; mutable accumulated : (accumulated_t[@sexp.opaque]) option
88+
; mutable accumulated : accumulated_t option
9589
; mutable is_committing : bool
9690
}
97-
[@@deriving sexp]
9891

99-
type unattached = t [@@deriving sexp]
92+
type unattached = t
10093

10194
let empty_maps =
10295
{ accounts = Location_binable.Map.empty
@@ -120,9 +113,7 @@ module Make (Inputs : Inputs_intf.S) = struct
120113
let get_uuid { uuid; _ } = uuid
121114

122115
module Attached = struct
123-
type parent = Base.t [@@deriving sexp]
124-
125-
type t = unattached [@@deriving sexp]
116+
type t = unattached
126117

127118
module Path = Base.Path
128119
module Addr = Location.Addr

src/lib/network_pool/mocks.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Transaction_snark_work = Transaction_snark_work
88
module Base_ledger = Mina_ledger.Ledger
99

1010
module Staged_ledger = struct
11-
type t = Base_ledger.t [@@deriving sexp]
11+
type t = Base_ledger.t
1212

1313
let ledger = Fn.id
1414
end
@@ -33,7 +33,6 @@ module Transition_frontier = struct
3333
; diff_writer : (diff Broadcast_pipe.Writer.t[@sexp.opaque])
3434
; diff_reader : (diff Broadcast_pipe.Reader.t[@sexp.opaque])
3535
}
36-
[@@deriving sexp]
3736

3837
let add_statements table stmts =
3938
List.iter stmts ~f:(fun s ->

src/lib/staged_ledger/staged_ledger.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,10 +3178,6 @@ let%test_module "staged ledger tests" =
31783178
tuple2
31793179
(gen_zkapps_at_capacity_fixed_blocks expected_proof_count)
31803180
small_positive_int)
3181-
~sexp_of:
3182-
[%sexp_of:
3183-
(Ledger.t * Mina_base.User_command.Valid.t list * int option list)
3184-
* int]
31853181
~trials:1
31863182
~f:(fun ((ledger, zkapps, iters), global_slot) ->
31873183
async_with_given_ledger ledger (fun ~snarked_ledger sl test_mask ->

0 commit comments

Comments
 (0)