diff --git a/src/proto_alpha/lib_protocol/bounded_history_repr.ml b/src/proto_alpha/lib_protocol/bounded_history_repr.ml index 16933102e3b5f9748b6e881a3b85b199ddfecfb6..74fbd8fd344b07849453a98290081a8e8cc9028c 100644 --- a/src/proto_alpha/lib_protocol/bounded_history_repr.ml +++ b/src/proto_alpha/lib_protocol/bounded_history_repr.ml @@ -23,6 +23,10 @@ (* *) (*****************************************************************************) +module type NAME = sig + val name : string +end + module type KEY = sig type t @@ -74,7 +78,7 @@ module type S = sig end end -module Make (Key : KEY) (Value : VALUE) : +module Make (Name : NAME) (Key : KEY) (Value : VALUE) : S with type key = Key.t and type value = Value.t = struct type key = Key.t @@ -176,13 +180,18 @@ module Make (Key : KEY) (Value : VALUE) : } let () = + assert (not (String.equal Name.name "")) ; register_error_kind `Temporary - ~id:"Bounded_history_repr.key_bound_to_different_value" - ~title:"Key already bound to a different value." + ~id: + (Format.sprintf + "Bounded_history_repr.%s.key_bound_to_different_value" + Name.name) + ~title:(Name.name ^ ": Key already bound to a different value.") ~description: - "Remember called with a key that is already bound to a different\n\ - \ value." + (Name.name + ^ ": Remember called with a key that is already bound to a different\n\ + \ value.") Data_encoding.( obj3 (req "key" Key.encoding) diff --git a/src/proto_alpha/lib_protocol/bounded_history_repr.mli b/src/proto_alpha/lib_protocol/bounded_history_repr.mli index e8d7bddd287f3a12b7ce1d753b0448eba29e72cb..7195bb86169c796a5956390e47988de294f948ba 100644 --- a/src/proto_alpha/lib_protocol/bounded_history_repr.mli +++ b/src/proto_alpha/lib_protocol/bounded_history_repr.mli @@ -34,6 +34,10 @@ This data structure is basically a bounded association table that stores } *) +module type NAME = sig + val name : string +end + (** The required interface for keys stored in the table. *) module type KEY = sig type t @@ -110,5 +114,5 @@ module type S = sig end end -module Make (Key : KEY) (Value : VALUE) : +module Make (Name : NAME) (Key : KEY) (Value : VALUE) : S with type key = Key.t and type value = Value.t diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml index 036624056bb21c048bfde0680dbac10cf79e90b2..909cec573063a16d88a00dbdfc99cf33d5355a81 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml @@ -165,6 +165,9 @@ module V1 = struct remember any levels for which you may need to produce proofs. *) module History = Bounded_history_repr.Make + (struct + let name = "inbox_history" + end) (Hash) (struct type t = history_proof