From bde6a32ae884d1d47de8ec28ac944c829566f442 Mon Sep 17 00:00:00 2001 From: Remy Haemmerle Date: Tue, 18 Feb 2020 10:59:58 +0100 Subject: [PATCH 1/2] DAML-LF: clean transaction versions drop unused and non-necessary transaction version 10. CHANGELOG_BEGIN CHANGELOG_END --- .../daml/lf/transaction/TransactionVersion.scala | 12 ------------ .../daml/lf/transaction/VersionTimeline.scala | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionVersion.scala b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionVersion.scala index e3837b0dda76..4414ab010602 100644 --- a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionVersion.scala +++ b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionVersion.scala @@ -25,7 +25,6 @@ object TransactionVersions private[transaction] val minExerciseResult = TransactionVersion("7") private[transaction] val minContractKeyInExercise = TransactionVersion("8") private[transaction] val minMaintainersInExercise = TransactionVersion("9") - private[transaction] val minContractIdV1 = TransactionVersion("10") def assignVersion( a: GenTransaction[_, Value.ContractId, VersionedValue[Value.ContractId]], @@ -82,17 +81,6 @@ object TransactionVersions minMaintainersInExercise else minVersion, - if (a.transactionSeed.isDefined || a.nodes.values.exists { - case Node.NodeCreate(nodeSeed, _, _, _, _, _, _) => - nodeSeed.isDefined - case Node.NodeExercises(nodeSeed, _, _, _, _, _, _, _, _, _, _, _, _, _) => - nodeSeed.isDefined - case _ => - false - }) - minContractIdV1 - else - minVersion ) } } diff --git a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/VersionTimeline.scala b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/VersionTimeline.scala index 94f3c3359d96..1208429f7861 100644 --- a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/VersionTimeline.scala +++ b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/VersionTimeline.scala @@ -59,7 +59,7 @@ object VersionTimeline { // FIXME https://github.com/digital-asset/daml/issues/2256 // * change the following line when LF 1.8 is frozen. // * do not insert line after this once until 1.8 is frozen. - This(Both(ValueVersion("7"), TransactionVersion("10"))), + This(This(ValueVersion("7"))), // add new versions above this line (but see more notes below) That(LanguageVersion(LMV.V1, Dev)), // do *not* backfill to make more Boths, because such would From 7b9b745fb4ebbb2ca9ebffb30612f19afcf976e0 Mon Sep 17 00:00:00 2001 From: Remy Haemmerle Date: Tue, 18 Feb 2020 13:08:42 +0100 Subject: [PATCH 2/2] engine: fix test --- .../digitalasset/daml/lf/engine/EngineInfoTest.scala | 2 +- daml-lf/interpreter/src/main/lf/internal.lf | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 daml-lf/interpreter/src/main/lf/internal.lf diff --git a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineInfoTest.scala b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineInfoTest.scala index b580a37ff3da..8f88eaade14b 100644 --- a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineInfoTest.scala +++ b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineInfoTest.scala @@ -9,7 +9,7 @@ class EngineInfoTest extends WordSpec with Matchers { EngineInfo.getClass.getSimpleName should { "show supported LF, Transaction and Value versions" in { EngineInfo.show shouldBe - "DAML LF Engine supports LF versions: 0, 0.dev, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.dev; Transaction versions: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; Value versions: 1, 2, 3, 4, 5, 6, 7" + "DAML LF Engine supports LF versions: 0, 0.dev, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.dev; Transaction versions: 1, 2, 3, 4, 5, 6, 7, 8, 9; Value versions: 1, 2, 3, 4, 5, 6, 7" } "toString returns the same value as show" in { diff --git a/daml-lf/interpreter/src/main/lf/internal.lf b/daml-lf/interpreter/src/main/lf/internal.lf new file mode 100644 index 000000000000..59c2ef80980d --- /dev/null +++ b/daml-lf/interpreter/src/main/lf/internal.lf @@ -0,0 +1,10 @@ +// Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +module INTERNAL { + + record UNIT = {}; + + variant OPTION (a: *) = NONE: INTERNAL:UNIT | SOME: a ; + +}