From a5cdbd22b9728c7df38b6cd9b6af68b01d425dc5 Mon Sep 17 00:00:00 2001 From: Frej Soya Date: Wed, 14 Sep 2022 22:22:32 +0200 Subject: [PATCH] Proto/Michelson: Deprecation of timelock types --- src/proto_alpha/lib_protocol/script_ir_translator.ml | 8 ++++++-- .../test/integration/michelson/test_timelock.ml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_protocol/script_ir_translator.ml b/src/proto_alpha/lib_protocol/script_ir_translator.ml index 4f987a86ea9e..ea3d29b5e7e0 100644 --- a/src/proto_alpha/lib_protocol/script_ir_translator.ml +++ b/src/proto_alpha/lib_protocol/script_ir_translator.ml @@ -607,9 +607,13 @@ let rec parse_ty : | Prim (loc, T_key_hash, [], annot) -> check_type_annot loc annot >|? fun () -> return ctxt key_hash_t | Prim (loc, T_chest_key, [], annot) -> - check_type_annot loc annot >|? fun () -> return ctxt chest_key_t + if legacy then + check_type_annot loc annot >|? fun () -> return ctxt chest_key_t + else error (Deprecated_instruction T_chest_key) | Prim (loc, T_chest, [], annot) -> - check_type_annot loc annot >|? fun () -> return ctxt chest_t + if legacy then + check_type_annot loc annot >|? fun () -> return ctxt chest_t + else error (Deprecated_instruction T_chest) | Prim (loc, T_timestamp, [], annot) -> check_type_annot loc annot >|? fun () -> return ctxt timestamp_t | Prim (loc, T_address, [], annot) -> diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_timelock.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_timelock.ml index 4f0ac0df7bca..7e548766f55d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_timelock.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_timelock.ml @@ -72,7 +72,7 @@ let deprecated_chest_open () = when List.mem ~equal:( = ) (Environment.Ecoproto_error - (Script_tc_errors.Deprecated_instruction I_OPEN_CHEST)) + (Script_tc_errors.Deprecated_instruction T_chest_key)) lst -> return () | Error errs -> -- GitLab