Alpha: Simplify a few things after removing dead code.

This commit is contained in:
Pierre Chambart 2018-06-01 18:24:38 +02:00 committed by Benjamin Canou
parent 233273dff8
commit e9c42123cb
4 changed files with 16 additions and 36 deletions

View File

@ -163,18 +163,18 @@ module Contract = struct
module Code =
Indexed_context.Make_carbonated_map
(struct let name = ["code"] end)
(Make_carbonated_value(struct
type t = Script_repr.lazy_expr
let encoding = Script_repr.lazy_expr_encoding
end))
(struct
type t = Script_repr.lazy_expr
let encoding = Script_repr.lazy_expr_encoding
end)
module Storage =
Indexed_context.Make_carbonated_map
(struct let name = ["storage"] end)
(Make_carbonated_value(struct
type t = Script_repr.lazy_expr
let encoding = Script_repr.lazy_expr_encoding
end))
(struct
type t = Script_repr.lazy_expr
let encoding = Script_repr.lazy_expr_encoding
end)
type bigmap_key = Raw_context.t * Contract_repr.t
@ -184,10 +184,10 @@ module Contract = struct
(Indexed_context.Raw_context)
(struct let name = ["big_map"] end))
(String_index)
(Make_carbonated_value (struct
type t = Script_repr.expr
let encoding = Script_repr.expr_encoding
end))
(struct
type t = Script_repr.expr
let encoding = Script_repr.expr_encoding
end)
module Paid_storage_space_fees =
Indexed_context.Make_map

View File

@ -20,15 +20,6 @@ module Make_encoder (V : VALUE) = struct
| None -> MBytes.create 0
end
module Make_carbonated_value (V : VALUE) = struct
include V
let size =
match Data_encoding.classify V.encoding with
| `Fixed _size ->
assert false
| `Variable | `Dynamic -> Variable
end
let len_name = "len"
let data_name = "data"
@ -313,7 +304,7 @@ module Make_indexed_data_storage
end
module Make_indexed_carbonated_data_storage
(C : Raw_context.T) (I : INDEX) (V : CARBONATED_VALUE)
(C : Raw_context.T) (I : INDEX) (V : VALUE)
: Non_iterable_indexed_carbonated_data_storage with type t = C.t
and type key = I.t
and type value = V.t = struct
@ -742,7 +733,7 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX)
end
module Make_carbonated_map (N : NAME) (V : CARBONATED_VALUE) = struct
module Make_carbonated_map (N : NAME) (V : VALUE) = struct
type t = C.t
type context = t
type key = I.t

View File

@ -19,8 +19,6 @@ module Make_single_data_storage
: Single_data_storage with type t = C.t
and type value = V.t
module Make_carbonated_value (V : VALUE) : CARBONATED_VALUE with type t = V.t
module type INDEX = sig
type t
val path_length: int
@ -42,7 +40,7 @@ module Make_indexed_data_storage
and type value = V.t
module Make_indexed_carbonated_data_storage
(C : Raw_context.T) (I : INDEX) (V : CARBONATED_VALUE)
(C : Raw_context.T) (I : INDEX) (V : VALUE)
: Non_iterable_indexed_carbonated_data_storage with type t = C.t
and type key = I.t
and type value = V.t

View File

@ -338,15 +338,6 @@ module type VALUE = sig
val encoding: t Data_encoding.t
end
type value_size =
| Fixed of int
| Variable
module type CARBONATED_VALUE = sig
include VALUE
val size: value_size
end
module type Indexed_raw_context = sig
type t
@ -371,7 +362,7 @@ module type Indexed_raw_context = sig
and type key = key
and type value = V.t
module Make_carbonated_map (N : NAME) (V : CARBONATED_VALUE)
module Make_carbonated_map (N : NAME) (V : VALUE)
: Non_iterable_indexed_carbonated_data_storage with type t = t
and type key = key
and type value = V.t