From e8a87f2b6aa6079e440e5d365a39fc24e7bfc351 Mon Sep 17 00:00:00 2001 From: Paul Brauner <141240651+paulbrauner-da@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:00:20 +0100 Subject: [PATCH] Apply suggestion Co-authored-by: Remy --- .../main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala | 3 ++- .../main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala b/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala index 618f8b11eb80..19814488eab8 100644 --- a/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala +++ b/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala @@ -2403,7 +2403,7 @@ private[lf] object SBuiltin { List( check(_.signatories, "signatories"), // This definition of observers allows observers to lose parties that are signatories - check(c => c.stakeholders -- c.signatories, "observers"), + check(_.nonSignatoryStakeholders, "non signatory stakeholders"), check(_.keyOpt.map(_.maintainers), "key maintainers"), check(_.keyOpt.map(_.globalKey.key), "key value"), ).flatten match { @@ -2411,6 +2411,7 @@ private[lf] object SBuiltin { case errors => Control.Error( IE.Upgrade( + // TODO(https://github.com/digital-asset/daml/issues/20305): also include the original metadata IE.Upgrade.ValidationFailed( coid = coid, srcTemplateId = original.templateId, diff --git a/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala b/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala index 142639b6afbf..d3093d98e455 100644 --- a/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala +++ b/sdk/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala @@ -146,6 +146,7 @@ private[lf] object Speedy { keyOpt: Option[CachedKey], ) { val stakeholders: Set[Party] = signatories union observers + lazy val nonSignatoryStakeholders: Set[Party] = stakeholders -- signatories private[speedy] val any = SValue.SAnyContract(templateId, value) private[speedy] def arg = value.toNormalizedValue(version)