From 66653810abdd4dc8ce4a3b0f69fa0cfb379f399b Mon Sep 17 00:00:00 2001 From: Martin Huschenbett Date: Tue, 31 Mar 2020 13:02:24 +0200 Subject: [PATCH] damlc: Drop support for reading DAML-LF 1.5 (#5294) DAML-LF 1.6 is the baseline vesion we want to support with the next SDK release. CHANGELOG_BEGIN - [DAML Compiler] Drop support for reading DARs using DAML-LF 1.5. Please recompile your DAML to a newer DAML-LF version in case you have such DARs. CHANGELOG_END --- .../daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs | 6 +- .../tests/daml-test-files/GoodCodePoints.daml | 15 --- .../SubmitterInMaintainers_before_1866.daml | 95 ------------------- .../damlc/tests/daml-test-files/Text.daml | 4 + 4 files changed, 5 insertions(+), 115 deletions(-) delete mode 100644 compiler/damlc/tests/daml-test-files/GoodCodePoints.daml delete mode 100644 compiler/damlc/tests/daml-test-files/SubmitterInMaintainers_before_1866.daml diff --git a/compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs b/compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs index a096a15b32..2805fb7c84 100644 --- a/compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs +++ b/compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs @@ -19,10 +19,6 @@ data Version data MinorVersion = PointStable Int | PointDev deriving (Eq, Data, Generic, NFData, Ord, Show) --- | DAML-LF version 1.5 -version1_5 :: Version -version1_5 = V1 $ PointStable 5 - -- | DAML-LF version 1.6 version1_6 :: Version version1_6 = V1 $ PointStable 6 @@ -47,7 +43,7 @@ supportedOutputVersions :: [Version] supportedOutputVersions = [version1_6, version1_7, version1_8, versionDev] supportedInputVersions :: [Version] -supportedInputVersions = version1_5 : supportedOutputVersions +supportedInputVersions = supportedOutputVersions data Feature = Feature diff --git a/compiler/damlc/tests/daml-test-files/GoodCodePoints.daml b/compiler/damlc/tests/daml-test-files/GoodCodePoints.daml deleted file mode 100644 index 8e503dc0c7..0000000000 --- a/compiler/damlc/tests/daml-test-files/GoodCodePoints.daml +++ /dev/null @@ -1,15 +0,0 @@ --- Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its affiliates. --- All rights reserved. - --- Check that conversion between text and code points works. --- @SINCE-LF 1.6 --- @TODO Move this into Text.daml once support for DAML-LF 1.5 is dropped. - -module GoodCodePoints where - -import DA.Assert -import DA.Text qualified as T - -testCodePoints = scenario do - T.toCodePoints "Hello" === [72, 101, 108, 108, 111] - T.fromCodePoints [87, 111, 114, 108, 100] === "World" diff --git a/compiler/damlc/tests/daml-test-files/SubmitterInMaintainers_before_1866.daml b/compiler/damlc/tests/daml-test-files/SubmitterInMaintainers_before_1866.daml deleted file mode 100644 index 49dd11e2d4..0000000000 --- a/compiler/damlc/tests/daml-test-files/SubmitterInMaintainers_before_1866.daml +++ /dev/null @@ -1,95 +0,0 @@ --- Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. --- SPDX-License-Identifier: Apache-2.0 - --- @UNTIL-LF 1.5 --- --- Tests that DAML-LF <= 1.5 does not enforce "submitter --- must be in maintainer" rule. See https://github.com/digital-asset/daml/issues/1866 - -module SubmitterInMaintainers_before_1866 where - --- import DA.Assert - -template Delegated - with - owner : Party - k : Text - where - signatory owner - key (owner, k) : (Party, Text) - maintainer key._1 - -template Delegation - with - owner : Party - delegate : Party - where - signatory owner - observer delegate - - controller delegate can - nonconsuming FetchDelegated: Delegated - with delegated: ContractId Delegated - do fetch delegated - - controller delegate can - nonconsuming FetchByKeyDelegated: () - with - p: Party - k: Text - expected: ContractId Delegated - do - (cid, _) <- fetchByKey @Delegated (p, k) - assertMsg "fetch matches" (expected == cid) - - controller delegate can - nonconsuming LookupByKeyDelegated: () - with - p: Party - k: Text - expected: Optional (ContractId Delegated) - do - actual <- lookupByKey @Delegated (p, k) - assertMsg "lookup matches" (expected == actual) - -template ShowDelegated - with - owner: Party - delegate: Party - where - signatory owner - observer delegate - controller owner can - ShowIt : () - with delegatedId: ContractId Delegated - do - fetch delegatedId - return () - -setup = do - owner <- getParty "owner" - delegate <- getParty "delegate" - delegated <- owner `submit` create Delegated with owner, k = "key" - delegation <- owner `submit` create Delegation with owner, delegate - return (owner, delegate, delegated, delegation) - --- mirrors "reject fetching an undisclosed contract" in --- in `CommandTransactionChecks.scala` -rejectsFetchingAnUndlisclosedContract = scenario do - (owner, delegate, delegated, delegation) <- setup - delegate `submitMustFail` exercise delegation FetchDelegated with delegated - -- this fetch still fails even if we do not check that the submitter - -- is in the lookup maintainer, since we have the visibility check - -- implement as part of #753. - delegate `submitMustFail` exercise delegation FetchByKeyDelegated with p = owner, k = "key", expected = delegated - delegate `submit` exercise delegation LookupByKeyDelegated with p = owner, k = "key", expected = None - --- mirrors "permit fetching a divulged contract" in --- in `CommandTransactionChecks.scala` -permitFetchingADivulgedContract = scenario do - (owner, delegate, delegated, delegation) <- setup - showId <- owner `submit` create ShowDelegated with owner, delegate - owner `submit` exercise showId ShowIt with delegatedId = delegated - delegate `submit` exercise delegation FetchDelegated with delegated - delegate `submit` exercise delegation FetchByKeyDelegated with p = owner, k = "key", expected = delegated - delegate `submit` exercise delegation LookupByKeyDelegated with p = owner, k = "key", expected = Some delegated diff --git a/compiler/damlc/tests/daml-test-files/Text.daml b/compiler/damlc/tests/daml-test-files/Text.daml index 08fd4317a3..08b6976b3c 100644 --- a/compiler/damlc/tests/daml-test-files/Text.daml +++ b/compiler/damlc/tests/daml-test-files/Text.daml @@ -303,3 +303,7 @@ testNuls = scenario do T.reverse "\0\1\2\3" === "\3\2\1\0" parseInt (T.drop 1 "\0\&123") === Some 123 T.splitOn "\0" "Hello\0World" === ["Hello","World"] + +testCodePoints = scenario do + T.toCodePoints "Hello" === [72, 101, 108, 108, 111] + T.fromCodePoints [87, 111, 114, 108, 100] === "World"