diff --git a/src/lib/merkle_ledger/dune b/src/lib/merkle_ledger/dune index 59ca1a7be2f1..ee3fe493fb93 100644 --- a/src/lib/merkle_ledger/dune +++ b/src/lib/merkle_ledger/dune @@ -14,7 +14,6 @@ (:standard -w +a-40..42-44 -warn-error +a-70 -open Core)) (library_flags -linkall) (modules_without_implementation - graphviz_intf location_intf) (libraries ;; opam libraries diff --git a/src/lib/merkle_ledger/graphviz.ml b/src/lib/merkle_ledger/graphviz.ml index 15f32f4fe3e7..950ad5eb88bb 100644 --- a/src/lib/merkle_ledger/graphviz.ml +++ b/src/lib/merkle_ledger/graphviz.ml @@ -1,8 +1,8 @@ open Core open Async -module Make (Inputs : Graphviz_intf.Inputs_intf) : - Graphviz_intf.S +module Make (Inputs : Intf.Graphviz.I) : + Intf.Graphviz.S with type addr := Inputs.Location.Addr.t and type ledger := Inputs.Ledger.t = struct open Inputs diff --git a/src/lib/merkle_ledger/graphviz.mli b/src/lib/merkle_ledger/graphviz.mli index c1148e59471c..86a52fa54c5a 100644 --- a/src/lib/merkle_ledger/graphviz.mli +++ b/src/lib/merkle_ledger/graphviz.mli @@ -1,6 +1,6 @@ (** Visualizable_ledger shows a subgraph of a merkle_ledger using Graphviz *) -module Make (Inputs : Graphviz_intf.Inputs_intf) : - Graphviz_intf.S +module Make (Inputs : Intf.Graphviz.I) : + Intf.Graphviz.S with type addr := Inputs.Location.Addr.t and type ledger := Inputs.Ledger.t diff --git a/src/lib/merkle_ledger/graphviz_intf.mli b/src/lib/merkle_ledger/graphviz_intf.mli deleted file mode 100644 index 9a529ac3ffe9..000000000000 --- a/src/lib/merkle_ledger/graphviz_intf.mli +++ /dev/null @@ -1,45 +0,0 @@ -module type S = sig - type addr - - type ledger - - type t - - (* Visualize will enumerate through all edges of a subtree with a - initial_address. It will then interpret all of the edges and nodes into an - intermediate form that will be easy to write into a dot file *) - val visualize : ledger -> initial_address:addr -> t - - (* Write will transform the intermediate form generate by visualize and save - the results into a dot file *) - val write : path:string -> name:string -> t -> unit Async.Deferred.t -end - -module type Inputs_intf = sig - module Key : Intf.Key - - module Token_id : Intf.Token_id - - module Account_id : - Intf.Account_id with type key := Key.t and type token_id := Token_id.t - - module Balance : Intf.Balance - - module Account : - Intf.Account - with type account_id := Account_id.t - and type balance := Balance.t - - module Hash : Intf.Hash with type account := Account.t - - module Location : Location_intf.S - - module Ledger : - Intf.Ledger.S - with module Addr = Location.Addr - and module Location = Location - and type account_id := Account_id.t - and type account_id_set := Account_id.Set.t - and type hash := Hash.t - and type account := Account.t -end diff --git a/src/lib/merkle_ledger/intf.ml b/src/lib/merkle_ledger/intf.ml index 8ce304479528..f12ee1c5e084 100644 --- a/src/lib/merkle_ledger/intf.ml +++ b/src/lib/merkle_ledger/intf.ml @@ -440,3 +440,35 @@ module Ledger = struct end end end + +module Graphviz = struct + module type S = sig + type addr + + type ledger + + type t + + (* Visualize will enumerate through all edges of a subtree with a + initial_address. It will then interpret all of the edges and nodes into an + intermediate form that will be easy to write into a dot file *) + val visualize : ledger -> initial_address:addr -> t + + (* Write will transform the intermediate form generate by visualize and save + the results into a dot file *) + val write : path:string -> name:string -> t -> unit Async.Deferred.t + end + + module type I = sig + include Inputs.Intf + + module Ledger : + Ledger.S + with module Addr = Location.Addr + and module Location = Location + and type account_id := Account_id.t + and type account_id_set := Account_id.Set.t + and type hash := Hash.t + and type account := Account.t + end +end