From cb3c578790effb7f72ea3639e130ee585ba92576 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Wed, 12 Oct 2022 18:31:40 +0200 Subject: [PATCH 1/2] Proto/Tests/SCORU: fix ignored result --- .../test/integration/operations/test_sc_rollup.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml index e1e47a72031c..c57b646c5587 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -171,7 +171,9 @@ let test_disable_feature_flag () = return_unit | _ -> failwith "It should have failed with [Sc_rollup_feature_disabled]" in - let*! _ = Incremental.add_operation ~expect_apply_failure i op in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_apply_failure i op + in return_unit (** [test_sc_rollups_all_well_defined] checks that the [kind_of_string] is -- GitLab From 01d3a236dd25854f4c77b83e81f138cedf292270 Mon Sep 17 00:00:00 2001 From: Yann Regis-Gianas Date: Tue, 25 Oct 2022 09:28:45 +0200 Subject: [PATCH 2/2] Proto,SCORU: Fix integration test Incremental.add_operation starts with the validation of the operation. When the feature flag is enabled, the validation fails. Therefore, the failure handler must be passed to the validation, not the application. That is the purpose of the ~expect_failure argument. Signed-off-by: Yann Regis-Gianas --- .../test/integration/operations/test_sc_rollup.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml index c57b646c5587..65804d4e1f74 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -163,7 +163,7 @@ let test_disable_feature_flag () = let parameters_ty = Script.lazy_expr @@ Expr.from_string "unit" in Op.sc_rollup_origination (I i) contract kind ~boot_sector:"" ~parameters_ty in - let expect_apply_failure = function + let expect_failure = function | Environment.Ecoproto_error (Validate_errors.Manager.Sc_rollup_feature_disabled as e) :: _ -> @@ -171,9 +171,7 @@ let test_disable_feature_flag () = return_unit | _ -> failwith "It should have failed with [Sc_rollup_feature_disabled]" in - let* (_ : Incremental.t) = - Incremental.add_operation ~expect_apply_failure i op - in + let* (_ : Incremental.t) = Incremental.add_operation ~expect_failure i op in return_unit (** [test_sc_rollups_all_well_defined] checks that the [kind_of_string] is -- GitLab