diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf2.proto b/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf2.proto index c96c0e07c1e3..dcb9a3226d99 100644 --- a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf2.proto +++ b/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf2.proto @@ -1365,8 +1365,7 @@ message DefValue { Expr expr = 3; - bool is_test = 4; - + bool is_test = 1000; // *Available in versions >= 2.dev* } message FeatureFlags { diff --git a/daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV2.scala b/daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV2.scala index 3c336b836efa..3389448d80d4 100644 --- a/daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV2.scala +++ b/daml-lf/archive/src/main/scala/com/digitalasset/daml/lf/archive/DecodeV2.scala @@ -409,6 +409,9 @@ private[archive] class DecodeV2(minor: LV.Minor) { } private def decodeDefValue(lfValue: PLF.DefValue): Work[DValue] = { + if (lfValue.getIsTest) { + assertSince(LV.Features.scenarios, "is_test") + } val name = getInternedDottedName(lfValue.getNameWithType.getNameInternedDname) decodeType(lfValue.getNameWithType.getType) { typ => decodeExpr(lfValue.getExpr, name.toString) { body => diff --git a/daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/EncodeV2.scala b/daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/EncodeV2.scala index 174b83dc8b3d..16230c578e66 100644 --- a/daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/EncodeV2.scala +++ b/daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/EncodeV2.scala @@ -852,6 +852,9 @@ private[daml] class EncodeV2(minorLanguageVersion: LV.Minor) { private implicit def encodeValueDef(nameWithDef: (DottedName, DValue)): PLF.DefValue = { val (dottedName, value) = nameWithDef + if (value.isTest) { + assertSince(LV.Features.scenarios, "Value.isTest") + } PLF.DefValue .newBuilder() .setNameWithType(dottedName -> value.typ)