Skip to content

Commit a5249e1

Browse files
Various test fixes, waiting for patch in canton
1 parent 7f3c830 commit a5249e1

File tree

15 files changed

+276
-333
lines changed

15 files changed

+276
-333
lines changed

sdk/compiler/damlc/tests/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ da_haskell_library(
164164
"ghc-lib-parser",
165165
"ghcide",
166166
"lsp-types",
167+
"mtl",
167168
"optparse-applicative",
168169
"pcre-utils",
169170
"process",
@@ -987,7 +988,7 @@ da_haskell_test(
987988
"//compiler/damlc/pkg-db",
988989
"//compiler/damlc/stable-packages",
989990
"//compiler/script-service/server:script_service_jar",
990-
"//daml-script/daml:daml-script.dar",
991+
"//daml-script/daml:daml-script-2.2.dar",
991992
"//daml-script/daml:daml-script-2.dev.dar",
992993
ghc_pkg,
993994
],

sdk/compiler/damlc/tests/daml-test-files/ExceptionSemantics.daml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
33

4-
-- @ERROR range=104:1-104:23; UNHANDLED_EXCEPTION/ExceptionSemantics:E: E
5-
-- @ERROR range=119:1-119:25; UNHANDLED_EXCEPTION/DA.Exception.ArithmeticError:ArithmeticError: ArithmeticError while evaluating (DIV_INT64 1 0).
6-
-- @ERROR range=134:1-134:11; Attempt to fetch or exercise a contract not visible to the reading parties.
7-
-- @ERROR range=145:1-145:11; Attempt to exercise a consumed contract
4+
-- @ERROR range=105:1-105:23; UNHANDLED_EXCEPTION/ExceptionSemantics:E: E
5+
-- @ERROR range=120:1-120:25; UNHANDLED_EXCEPTION/DA.Exception.ArithmeticError:ArithmeticError: ArithmeticError while evaluating (DIV_INT64 1 0).
6+
-- @ERROR range=135:1-135:11; Attempt to fetch or exercise a contract not visible to the reading parties.
7+
-- @ERROR range=146:1-146:11; Attempt to exercise a consumed contract
88
-- @WARN -Werror=upgrade-exceptions
9+
-- @IDE-PV V34
910

1011
{-# OPTIONS_GHC -Wno-x-exceptions #-}
1112

sdk/compiler/damlc/tests/daml-test-files/ExceptionSemanticsWithKeys.daml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
module ExceptionSemanticsWithKeys where
99

10-
import Daml.Script
10+
-- import Daml.Script
1111
import DA.Exception
1212

1313
exception E
@@ -58,15 +58,19 @@ template T
5858
catch
5959
E -> create (K p i) >> pure ()
6060

61+
-- TODO:
62+
-- Exception semantics with keys have changed significantly, this test needs to be re-thought.
63+
-- Consider cases like fetch/queryby keys in a rollback, as well as non-consuming exercise by key
64+
6165
-- this test fails on canton
6266
-- the second `createAndExerciseCmd (T p) (NonTransientDuplicate 1)` does not fails
63-
duplicateKey = script do
64-
p <- allocateParty "p"
65-
-- transient duplicate key in rollback
66-
submitMustFail p $ createAndExerciseCmd (T p) (TransientDuplicate 0)
67-
submit p $ createCmd (K p 1)
68-
-- duplicate key error with contract created outside of rollback
69-
submitMustFail p $ createAndExerciseCmd (T p) (NonTransientDuplicate 1)
70-
-- no duplicate key error if key creation got rolled back
71-
submit p $ createAndExerciseCmd (T p) (RollbackKey 2)
72-
pure ()
67+
-- duplicateKey = script do
68+
-- p <- allocateParty "p"
69+
-- -- transient duplicate key in rollback
70+
-- submitMustFail p $ createAndExerciseCmd (T p) (TransientDuplicate 0)
71+
-- submit p $ createCmd (K p 1)
72+
-- -- duplicate key error with contract created outside of rollback
73+
-- submitMustFail p $ createAndExerciseCmd (T p) (NonTransientDuplicate 1)
74+
-- -- no duplicate key error if key creation got rolled back
75+
-- submit p $ createAndExerciseCmd (T p) (RollbackKey 2)
76+
-- pure ()

0 commit comments

Comments
 (0)