From c2483da50feede28c2b85a7bfefe9f3289c57d2f Mon Sep 17 00:00:00 2001 From: Pierre Chambart Date: Sat, 23 Jun 2018 03:43:39 +0200 Subject: [PATCH] Fail correctly in the tests --- src/proto_alpha/lib_protocol/test/origination.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/test/origination.ml b/src/proto_alpha/lib_protocol/test/origination.ml index 35d0e946c..edcf8b002 100644 --- a/src/proto_alpha/lib_protocol/test/origination.ml +++ b/src/proto_alpha/lib_protocol/test/origination.ml @@ -142,7 +142,13 @@ let undelegatable fee () = else (* delegation is processed ; but delegate does not change *) begin - Incremental.add_operation i operation >>=? fun i -> + let expect_failure = function + | Alpha_environment.Ecoproto_error (Delegate_storage.Non_delegatable_contract _) :: _ -> + return () + | _ -> + failwith "The contract is not delegatable, it fail !" + in + Incremental.add_operation ~expect_failure i operation >>=? fun i -> (* new contracts loses the fee *) Assert.balance_was_debited ~loc:__LOC__ (I i) new_contract balance fee (* TODO delegate has not changed : wait for delegation tests and Context.Contract.delegate