From 1aa50898b7228f1cb0a6495da5ae84dbc3c38a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Wed, 5 Oct 2022 12:25:18 +0200 Subject: [PATCH] Proto/Michelson: remove Script_typed_ir.comparable_option_t This function is a special case of Script_typed_ir.option_t which is also exported. --- src/proto_alpha/lib_benchmark/michelson_samplers.ml | 2 +- src/proto_alpha/lib_protocol/script_typed_ir.ml | 3 --- src/proto_alpha/lib_protocol/script_typed_ir.mli | 3 --- .../lib_protocol/test/pbt/test_script_comparison.ml | 4 +--- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/proto_alpha/lib_benchmark/michelson_samplers.ml b/src/proto_alpha/lib_benchmark/michelson_samplers.ml index 82cca5fff8cf..bfcda8b0b58d 100644 --- a/src/proto_alpha/lib_benchmark/michelson_samplers.ml +++ b/src/proto_alpha/lib_benchmark/michelson_samplers.ml @@ -443,7 +443,7 @@ end) let option_case size = let size = size - 1 in let* (Ex_comparable_ty t) = m_comparable_type ~size in - match comparable_option_t (-1) t with + match option_t (-1) t with | Error _ -> (* what should be done here? *) assert false | Ok res_ty -> return @@ Ex_comparable_ty res_ty in diff --git a/src/proto_alpha/lib_protocol/script_typed_ir.ml b/src/proto_alpha/lib_protocol/script_typed_ir.ml index 3f4cfecff915..f5d22f44948b 100644 --- a/src/proto_alpha/lib_protocol/script_typed_ir.ml +++ b/src/proto_alpha/lib_protocol/script_typed_ir.ml @@ -1795,9 +1795,6 @@ let option_pair_int_nat_t = {size = Type_size.four}, Yes ) -let comparable_option_t loc t = - Type_size.compound1 loc (ty_size t) >|? fun size -> Option_t (t, {size}, Yes) - let list_t loc t = Type_size.compound1 loc (ty_size t) >|? fun size -> List_t (t, {size}) diff --git a/src/proto_alpha/lib_protocol/script_typed_ir.mli b/src/proto_alpha/lib_protocol/script_typed_ir.mli index 131ab84402e2..facd7ceb5e8e 100644 --- a/src/proto_alpha/lib_protocol/script_typed_ir.mli +++ b/src/proto_alpha/lib_protocol/script_typed_ir.mli @@ -1668,9 +1668,6 @@ val lambda_t : val option_t : Script.location -> ('v, 'c) ty -> ('v option, 'c) ty tzresult -val comparable_option_t : - Script.location -> 'v comparable_ty -> 'v option comparable_ty tzresult - val option_mutez_t : Tez.t option comparable_ty val option_string_t : Script_string.t option comparable_ty diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml index c2ce81cca514..62cd2fd7db55 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml @@ -333,9 +333,7 @@ let test_pack_unpack = comparable_data_generator (fun (Ex_comparable_data (ty, x)) -> let oty = - match comparable_option_t (-1) ty with - | Ok ty -> ty - | Error _ -> assert false + match option_t (-1) ty with Ok ty -> ty | Error _ -> assert false in qcheck_eq ~cmp:(Script_comparable.compare_comparable oty) -- GitLab