From 4e51194041c239054cd11cd66483403f5a5e76e3 Mon Sep 17 00:00:00 2001 From: Remy Date: Thu, 7 Apr 2022 11:06:17 +0200 Subject: [PATCH] LF: Drop byInterface field from Transaction Nodes (#13520) part of #13491 CHANGELOG_BEGIN CHANGELOG_END --- .../engine/preprocessing/Preprocessor.scala | 37 ++++++++----------- .../daml/lf/engine/AuthorizationSpec.scala | 1 - .../daml/lf/engine/BlindingSpec.scala | 2 - .../daml/lf/engine/EngineTest.scala | 7 ++-- .../daml/lf/engine/MetaDataTest.scala | 21 ++++------- .../daml/lf/scenario/ScenarioLedger.scala | 2 +- .../digitalasset/daml/lf/speedy/Pretty.scala | 22 ++--------- .../lf/transaction/PartialTransaction.scala | 10 ----- .../lf/speedy/NormalizeRollbacksSpec.scala | 2 - .../lf/speedy/PartialTransactionSpec.scala | 20 +++++----- .../TransactionConversionsSpec.scala | 1 - .../transaction/test/TransactionBuilder.scala | 9 +---- .../scala/lf/value/test/ValueGenerators.scala | 12 ++---- .../daml/lf/transaction/Node.scala | 6 --- .../daml/lf/transaction/Transaction.scala | 24 +++--------- .../lf/transaction/TransactionCoder.scala | 9 ++--- .../lf/transaction/TransactionCoderSpec.scala | 1 - .../TransactionNodeStatisticsSpec.scala | 4 +- .../daml/lf/transaction/TransactionSpec.scala | 2 - .../daml/lf/validation/ValidationSpec.scala | 9 ----- .../postgres/V10_1__Populate_Event_Data.scala | 2 +- .../dao/JdbcLedgerDaoDivulgenceSpec.scala | 6 --- .../store/dao/JdbcLedgerDaoSuite.scala | 8 ---- .../store/backend/UpdateToDbDtoSpec.scala | 2 - .../state/kvutils/ProjectionsSpec.scala | 2 - .../sandbox/BridgeWriteServiceTest.scala | 1 - security-evidence.md | 28 +++++++------- 27 files changed, 69 insertions(+), 181 deletions(-) diff --git a/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/Preprocessor.scala b/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/Preprocessor.scala index f6327a35d9..0b9bfa765a 100644 --- a/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/Preprocessor.scala +++ b/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/preprocessing/Preprocessor.scala @@ -9,7 +9,7 @@ import java.util import com.daml.lf.data.{ImmArray, Ref} import com.daml.lf.language.{Ast, LookupError} import com.daml.lf.speedy.SValue -import com.daml.lf.transaction.SubmittedTransaction +import com.daml.lf.transaction.{Node, SubmittedTransaction} import com.daml.lf.value.Value import com.daml.nameof.NameOf @@ -86,23 +86,18 @@ private[engine] final class Preprocessor( ResultDone(acc.toList) } - @tailrec private[this] def collectNewPackagesFromTemplateIds( - templateIds: List[Ref.TypeConName], - acc: Map[Ref.PackageId, language.Reference] = Map.empty, - ): Result[List[(Ref.PackageId, language.Reference)]] = - templateIds match { - case templateId :: rest => - val pkgId = templateId.packageId - val newAcc = - if (compiledPackages.packageIds(pkgId) || acc.contains(pkgId)) - acc - else - acc.updated(pkgId, language.Reference.TemplateOrInterface(templateId)) - collectNewPackagesFromTemplateIds(rest, newAcc) - case Nil => - ResultDone(acc.toList) - } + templateIds: Iterable[Ref.TypeConName] + ): List[(Ref.PackageId, language.Reference)] = + templateIds + .foldLeft(Map.empty[Ref.PackageId, language.Reference]) { (acc, tmplId) => + val pkgId = tmplId.packageId + if (compiledPackages.packageIds(pkgId) || acc.contains(pkgId)) + acc + else + acc.updated(pkgId, language.Reference.TemplateOrInterface(tmplId)) + } + .toList private[this] def pullPackages( pkgIds: List[(Ref.PackageId, language.Reference)] @@ -125,8 +120,8 @@ private[engine] final class Preprocessor( private[this] def pullTypePackages(typ: Ast.Type): Result[Unit] = collectNewPackagesFromTypes(List(typ)).flatMap(pullPackages) - private[this] def pullTemplatePackage(tyCons: List[Ref.TypeConName]): Result[Unit] = - collectNewPackagesFromTemplateIds(tyCons).flatMap(pullPackages) + private[this] def pullTemplatePackage(tyCons: Iterable[Ref.TypeConName]): Result[Unit] = + pullPackages(collectNewPackagesFromTemplateIds(tyCons)) /** Translates the LF value `v0` of type `ty0` to a speedy value. * Fails if the nesting is too deep or if v0 does not match the type `ty0`. @@ -149,7 +144,7 @@ private[engine] final class Preprocessor( def preprocessApiCommands( cmds: data.ImmArray[command.ApiCommand] ): Result[ImmArray[speedy.Command]] = - safelyRun(pullTemplatePackage(cmds.toSeq.view.map(_.templateId).toList)) { + safelyRun(pullTemplatePackage(cmds.toSeq.view.map(_.templateId))) { commandPreprocessor.unsafePreprocessApiCommands(cmds) } @@ -166,7 +161,7 @@ private[engine] final class Preprocessor( ): Result[ImmArray[speedy.Command]] = safelyRun( pullTemplatePackage( - tx.rootNodes.toSeq.view.map(_.templateId) ++: tx.byInterfaceNodes.map(_.templateId) + tx.nodes.values.collect { case action: Node.Action => action.templateId } ) ) { transactionPreprocessor.unsafeTranslateTransactionRoots(tx) diff --git a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala index 052a21f5a4..45b5499b7b 100644 --- a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala +++ b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala @@ -37,7 +37,6 @@ class AuthorizationSpec extends AnyFreeSpec with Matchers with Inside { observers = Seq("Carl"), key = Some(Value.ValueUnit), maintainers = maintainers, - byInterface = None, ) "create" - { diff --git a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala index dea2941a3a..0789b34928 100644 --- a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala +++ b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala @@ -103,7 +103,6 @@ class BlindingSpec extends AnyFreeSpec with Matchers { observers = Seq("Carl"), key = Some(ValueRecord(None, ImmArray.empty)), maintainers = Seq("Alice"), - byInterface = None, ) val lookup = builder.lookupByKey(create, true) val nodeId = builder.add(lookup) @@ -125,7 +124,6 @@ class BlindingSpec extends AnyFreeSpec with Matchers { observers = Seq("Carl"), key = Some(ValueRecord(None, ImmArray.empty)), maintainers = Seq("Alice"), - byInterface = None, ) val lookup = builder.lookupByKey(create, false) val nodeId = builder.add(lookup) diff --git a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineTest.scala b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineTest.scala index e135e9d655..9e302de14b 100644 --- a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineTest.scala +++ b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineTest.scala @@ -1147,7 +1147,6 @@ class EngineTest _, _, _, - _, ) => coid shouldBe originalCoid consuming shouldBe true @@ -1234,7 +1233,7 @@ class EngineTest def actFetchActors(n: Node): Set[Party] = { n match { - case Node.Fetch(_, _, actingParties, _, _, _, _, _, _) => actingParties + case Node.Fetch(_, _, actingParties, _, _, _, _, _) => actingParties case _ => Set() } } @@ -1620,7 +1619,7 @@ class EngineTest ) tx.transaction.nodes.values.headOption match { - case Some(Node.Fetch(_, _, _, _, _, key, _, _, _)) => + case Some(Node.Fetch(_, _, _, _, _, key, _, _)) => key match { // just test that the maintainers match here, getting the key out is a bit hairier case Some(Node.KeyWithMaintainers(_, maintainers)) => @@ -1849,7 +1848,7 @@ class EngineTest val stx = suffix(tx) val ImmArray(_, exeNode1) = tx.transaction.roots - val Node.Exercise(_, _, _, _, _, _, _, _, _, children, _, _, _, _, _) = + val Node.Exercise(_, _, _, _, _, _, _, _, _, children, _, _, _, _) = tx.transaction.nodes(exeNode1) val nids = children.toSeq.take(2).toImmArray diff --git a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/MetaDataTest.scala b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/MetaDataTest.scala index be7dc95256..3b906498c0 100644 --- a/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/MetaDataTest.scala +++ b/daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/MetaDataTest.scala @@ -19,7 +19,7 @@ class MetaDataTest extends AnyWordSpec with Matchers with TableDrivenPropertyChe "Engine#desp" should { - val createWithoutInterface = newBuilder.create( + val create = newBuilder.create( id = TransactionBuilder.newCid, templateId = Ref.Identifier("pkgT", "M:T"), argument = ValueUnit, @@ -27,29 +27,27 @@ class MetaDataTest extends AnyWordSpec with Matchers with TableDrivenPropertyChe observers = noOne, key = Some(ValueParty("alice")), maintainers = parties, - byInterface = None, ) val nodeWithoutInterface = Table[TransactionBuilder => Node]( "transaction", - _ => createWithoutInterface, + _ => create, _.exercise( - contract = createWithoutInterface, + contract = create, choice = "ChT", consuming = false, actingParties = parties, argument = ValueUnit, - byInterface = createWithoutInterface.byInterface, ), _.exerciseByKey( - contract = createWithoutInterface, + contract = create, choice = "ChT", consuming = false, actingParties = parties, argument = ValueUnit, ), - _.fetch(contract = createWithoutInterface, byInterface = createWithoutInterface.byInterface), - _.fetchByKey(contract = createWithoutInterface), - _.lookupByKey(contract = createWithoutInterface), + _.fetch(contract = create), + _.fetchByKey(contract = create), + _.lookupByKey(contract = create), ) val createWithInterface = newBuilder.create( @@ -60,7 +58,6 @@ class MetaDataTest extends AnyWordSpec with Matchers with TableDrivenPropertyChe observers = noOne, key = Some(ValueParty("alice")), maintainers = parties, - byInterface = Some(Ref.Identifier("pkgInt", "M:Int")), ) val nodeWithInterface = Table[TransactionBuilder => Node]( "transaction", @@ -71,9 +68,8 @@ class MetaDataTest extends AnyWordSpec with Matchers with TableDrivenPropertyChe consuming = false, actingParties = parties, argument = ValueUnit, - byInterface = createWithInterface.byInterface, ), - _.fetch(contract = createWithInterface, byInterface = createWithInterface.byInterface), + _.fetch(contract = createWithInterface), ) "works as expected on root actions node by template" in { @@ -113,7 +109,6 @@ class MetaDataTest extends AnyWordSpec with Matchers with TableDrivenPropertyChe argument = ValueUnit, signatories = parties, observers = noOne, - byInterface = None, ) forEvery(nodeWithoutInterface) { mkNodeWithout => forEvery(nodeWithInterface) { mkNodeWith => diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/scenario/ScenarioLedger.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/scenario/ScenarioLedger.scala index 0673a37bbb..8885959bf4 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/scenario/ScenarioLedger.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/scenario/ScenarioLedger.scala @@ -488,7 +488,7 @@ object ScenarioLedger { } processNodes(mbNewCache2, idsToProcess) - case Node.Fetch(referencedCoid, templateId @ _, _, _, _, _, _, _, _) => + case Node.Fetch(referencedCoid, templateId @ _, _, _, _, _, _, _) => val newCacheP = newCache.updateLedgerNodeInfo(referencedCoid)(info => info.copy(referencedBy = info.referencedBy + eventId) diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Pretty.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Pretty.scala index ae5ad4109f..705d02e215 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Pretty.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Pretty.scala @@ -257,37 +257,21 @@ private[lf] object Pretty { case Node.Rollback(children) => text("rollback:") / stack(children.toList.map(prettyEventInfo(l, txId))) case create: Node.Create => - val d = - create.byInterface match { - case None => "create" &: prettyContractInst(create.coinst) - case Some(ifaceId) => - ("create" &: prettyContractInst(create.coinst)) & text( - "as interface" - ) & prettyIdentifier(ifaceId) - } + val d = "create" &: prettyContractInst(create.coinst) create.versionedKey match { case None => d case Some(key) => d / text("key") & prettyVersionedKeyWithMaintainers(key) } case ea: Node.Fetch => - val d = "ensure active" &: prettyContractId(ea.coid) - (ea.byInterface match { - case None => d - case Some(ifaceId) => d & text("as interface") & prettyIdentifier(ifaceId) - }) + "ensure active" &: prettyContractId(ea.coid) case ex: Node.Exercise => val children = if (ex.children.nonEmpty) text("children:") / stack(ex.children.toList.map(prettyEventInfo(l, txId))) else text("") - val exercises = - text("exercises") & text(ex.choiceId) + char(':') + prettyIdentifier(ex.templateId) intercalate(text(", "), ex.actingParties.map(p => text(p))) & - (ex.byInterface match { - case None => exercises - case Some(ifaceId) => exercises & text("as interface") & prettyIdentifier(ifaceId) - }) & + (text("exercises") & text(ex.choiceId) + char(':') + prettyIdentifier(ex.templateId)) & text("on") & prettyContractId(ex.targetCoid) / (text(" ") + text("with") & prettyValue(false)(ex.chosenValue) / children) .nested(4) diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/transaction/PartialTransaction.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/transaction/PartialTransaction.scala index 6d7631bc37..5047d393ff 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/transaction/PartialTransaction.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/transaction/PartialTransaction.scala @@ -135,8 +135,6 @@ private[lf] object PartialTransaction { * @param parent The context in which the exercises is * happening. * @param byKey True if the exercise is done "by key" - * @param byInterface The interface through which this exercise - * was invoked, if any. */ final case class ExercisesContextInfo( targetId: Value.ContractId, @@ -152,7 +150,6 @@ private[lf] object PartialTransaction { nodeId: NodeId, parent: Context, byKey: Boolean, - byInterface: Option[TypeConName], version: TxVersion, ) extends ContextInfo { val actionNodeSeed = parent.nextActionChildSeed @@ -398,7 +395,6 @@ private[speedy] case class PartialTransaction( signatories: Set[Party], stakeholders: Set[Party], key: Option[Node.KeyWithMaintainers], - byInterface: Option[TypeConName] = None, version: TxVersion, ): (Value.ContractId, PartialTransaction) = { val actionNodeSeed = context.nextActionChildSeed @@ -413,7 +409,6 @@ private[speedy] case class PartialTransaction( signatories, stakeholders, key, - byInterface, version, ) val nid = NodeId(nextNodeIdx) @@ -492,7 +487,6 @@ private[speedy] case class PartialTransaction( stakeholders: Set[Party], key: Option[Node.KeyWithMaintainers], byKey: Boolean, - byInterface: Option[TypeConName] = None, version: TxVersion, ): PartialTransaction = { val nid = NodeId(nextNodeIdx) @@ -504,7 +498,6 @@ private[speedy] case class PartialTransaction( stakeholders, key, normByKey(version, byKey), - byInterface, version, ) mustBeActive( @@ -550,7 +543,6 @@ private[speedy] case class PartialTransaction( mbKey: Option[Node.KeyWithMaintainers], byKey: Boolean, chosenValue: Value, - byInterface: Option[TypeConName] = None, version: TxVersion, ): PartialTransaction = { val nid = NodeId(nextNodeIdx) @@ -569,7 +561,6 @@ private[speedy] case class PartialTransaction( nodeId = nid, parent = context, byKey = byKey, - byInterface = byInterface, version = version, ) @@ -664,7 +655,6 @@ private[speedy] case class PartialTransaction( exerciseResult = None, key = ec.contractKey, byKey = normByKey(ec.version, ec.byKey), - byInterface = ec.byInterface, version = ec.version, ) } diff --git a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/NormalizeRollbacksSpec.scala b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/NormalizeRollbacksSpec.scala index 983723f389..daaab9bf4a 100644 --- a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/NormalizeRollbacksSpec.scala +++ b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/NormalizeRollbacksSpec.scala @@ -301,7 +301,6 @@ object NormalizeRollbackSpec { signatories = Set.empty, stakeholders = Set.empty, key = None, - byInterface = None, version = TransactionVersion.minVersion, ) @@ -325,7 +324,6 @@ object NormalizeRollbackSpec { exerciseResult = None, key = None, byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ) } diff --git a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/PartialTransactionSpec.scala b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/PartialTransactionSpec.scala index 6a6af5b262..c4219adeeb 100644 --- a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/PartialTransactionSpec.scala +++ b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/PartialTransactionSpec.scala @@ -44,16 +44,15 @@ class PartialTransactionSpec extends AnyWordSpec with Matchers with Inside { def insertCreate_ : PartialTransaction = ptx .insertCreate( - Authorize(Set(party)), - templateId, - Value.ValueUnit, - "agreement", - None, - Set(party), - Set.empty, - None, - None, - TransactionVersion.maxVersion, + auth = Authorize(Set(party)), + templateId = templateId, + arg = Value.ValueUnit, + agreementText = "agreement", + optLocation = None, + signatories = Set(party), + stakeholders = Set.empty, + key = None, + version = TransactionVersion.maxVersion, ) ._2 @@ -71,7 +70,6 @@ class PartialTransactionSpec extends AnyWordSpec with Matchers with Inside { choiceObservers = Set.empty, mbKey = None, byKey = false, - byInterface = None, chosenValue = Value.ValueUnit, version = TransactionVersion.maxVersion, ) diff --git a/daml-lf/kv-support/src/test/scala/com/daml/lf/kv/transactions/TransactionConversionsSpec.scala b/daml-lf/kv-support/src/test/scala/com/daml/lf/kv/transactions/TransactionConversionsSpec.scala index 76ca62b6e2..307faac396 100644 --- a/daml-lf/kv-support/src/test/scala/com/daml/lf/kv/transactions/TransactionConversionsSpec.scala +++ b/daml-lf/kv-support/src/test/scala/com/daml/lf/kv/transactions/TransactionConversionsSpec.scala @@ -538,7 +538,6 @@ object TransactionConversionsSpec { exerciseResult = None, key = None, byKey = false, - byInterface = None, version = TransactionVersion.VDev, ) diff --git a/daml-lf/transaction-test-lib/src/main/scala/lf/transaction/test/TransactionBuilder.scala b/daml-lf/transaction-test-lib/src/main/scala/lf/transaction/test/TransactionBuilder.scala index ab63816882..279ade9e37 100644 --- a/daml-lf/transaction-test-lib/src/main/scala/lf/transaction/test/TransactionBuilder.scala +++ b/daml-lf/transaction-test-lib/src/main/scala/lf/transaction/test/TransactionBuilder.scala @@ -95,9 +95,8 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion signatories: Set[Ref.Party], observers: Set[Ref.Party], key: Option[Value] = None, - byInterface: Option[Ref.Identifier] = None, ): Node.Create = - create(id, templateId, argument, signatories, observers, key, signatories, byInterface) + create(id, templateId, argument, signatories, observers, key, signatories) def create( id: ContractId, @@ -107,7 +106,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion observers: Set[Ref.Party], key: Option[Value], maintainers: Set[Ref.Party], - byInterface: Option[Ref.Identifier], ): Node.Create = { Node.Create( coid = id, @@ -117,7 +115,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion signatories = signatories, stakeholders = signatories | observers, key = key.map(Node.KeyWithMaintainers(_, maintainers)), - byInterface = byInterface, version = pkgTxVersion(templateId.packageId), ) } @@ -131,7 +128,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion result: Option[Value] = None, choiceObservers: Set[Ref.Party] = Set.empty, byKey: Boolean = true, - byInterface: Option[Ref.Identifier] = None, ): Node.Exercise = Node.Exercise( choiceObservers = choiceObservers, @@ -147,7 +143,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion exerciseResult = result, key = contract.key, byKey = byKey, - byInterface = byInterface, version = pkgTxVersion(contract.templateId.packageId), ) @@ -163,7 +158,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion def fetch( contract: Node.Create, byKey: Boolean = false, - byInterface: Option[Ref.Identifier] = None, ): Node.Fetch = Node.Fetch( coid = contract.coid, @@ -173,7 +167,6 @@ final class TransactionBuilder(pkgTxVersion: Ref.PackageId => TransactionVersion stakeholders = contract.stakeholders, key = contract.key, byKey = byKey, - byInterface = byInterface, version = pkgTxVersion(contract.templateId.packageId), ) diff --git a/daml-lf/transaction-test-lib/src/main/scala/lf/value/test/ValueGenerators.scala b/daml-lf/transaction-test-lib/src/main/scala/lf/value/test/ValueGenerators.scala index f05626668d..034b8aec46 100644 --- a/daml-lf/transaction-test-lib/src/main/scala/lf/value/test/ValueGenerators.scala +++ b/daml-lf/transaction-test-lib/src/main/scala/lf/value/test/ValueGenerators.scala @@ -294,7 +294,7 @@ object ValueGenerators { */ def malformedCreateNodeGenWithVersion( version: TransactionVersion - ): Gen[Node.Create] = { + ): Gen[Node.Create] = for { coid <- coidGen templateId <- idGen @@ -311,10 +311,8 @@ object ValueGenerators { signatories = signatories, stakeholders = stakeholders, key = key, - byInterface = None, version = version, ) - } val fetchNodeGen: Gen[Node.Fetch] = for { @@ -322,7 +320,7 @@ object ValueGenerators { node <- fetchNodeGenWithVersion(version) } yield node - def fetchNodeGenWithVersion(version: TransactionVersion): Gen[Node.Fetch] = { + def fetchNodeGenWithVersion(version: TransactionVersion): Gen[Node.Fetch] = for { coid <- coidGen templateId <- idGen @@ -339,10 +337,8 @@ object ValueGenerators { stakeholders = stakeholders, key = key, byKey = byKey, - byInterface = None, version = version, ) - } /** Makes rollback node with some random child IDs. */ val danglingRefRollbackNodeGen: Gen[Node.Rollback] = { @@ -364,7 +360,7 @@ object ValueGenerators { /** Makes exercise nodes with the given version and some random child IDs. */ def danglingRefExerciseNodeGenWithVersion( version: TransactionVersion - ): Gen[Node.Exercise] = { + ): Gen[Node.Exercise] = for { targetCoid <- coidGen templateId <- idGen @@ -396,10 +392,8 @@ object ValueGenerators { exerciseResult = exerciseResult, key = key, byKey = byKey, - byInterface = None, version = version, ) - } val lookupNodeGen: Gen[Node.LookupByKey] = for { diff --git a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Node.scala b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Node.scala index 7301139963..e21c7c59e0 100644 --- a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Node.scala +++ b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Node.scala @@ -54,8 +54,6 @@ object Node { def byKey: Boolean - def byInterface: Option[TypeConName] - protected def versioned[X](x: X): Versioned[X] = Versioned(version, x) } @@ -81,7 +79,6 @@ object Node { signatories: Set[Party], stakeholders: Set[Party], key: Option[KeyWithMaintainers], - override val byInterface: Option[TypeConName], // For the sake of consistency between types with a version field, keep this field the last. override val version: TransactionVersion, ) extends LeafOnlyAction @@ -119,7 +116,6 @@ object Node { stakeholders: Set[Party], key: Option[KeyWithMaintainers], override val byKey: Boolean, // invariant (!byKey || exerciseResult.isDefined) - override val byInterface: Option[TypeConName], // For the sake of consistency between types with a version field, keep this field the last. override val version: TransactionVersion, ) extends LeafOnlyAction @@ -158,7 +154,6 @@ object Node { exerciseResult: Option[Value], key: Option[KeyWithMaintainers], override val byKey: Boolean, // invariant (!byKey || exerciseResult.isDefined) - override val byInterface: Option[TypeConName], // For the sake of consistency between types with a version field, keep this field the last. override val version: TransactionVersion, ) extends Action @@ -206,7 +201,6 @@ object Node { override def keyMaintainers: Set[Party] = key.maintainers override def hasResult: Boolean = result.isDefined override def byKey: Boolean = true - override def byInterface: Option[TypeConName] = None override private[lf] def updateVersion(version: TransactionVersion): Node.LookupByKey = copy(version = version) diff --git a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Transaction.scala b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Transaction.scala index 0db876c94d..d911ba3326 100644 --- a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Transaction.scala +++ b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/Transaction.scala @@ -12,7 +12,6 @@ import com.daml.lf.value.Value.ContractId import scala.annotation.tailrec import scala.collection.immutable.HashMap -import com.daml.scalautil.Statement.discard final case class VersionedTransaction private[lf] ( version: TransactionVersion, @@ -287,17 +286,6 @@ sealed abstract class HasTxNodes { } ) - private[lf] def byInterfaceNodes: List[Node.Action] = { - val builder = List.newBuilder[Node.Action] - foreach { - case (_, action: Node.Action) if action.byInterface.isDefined => - discard(builder += action) - case _ => - () - } - builder.result() - } - /** This function traverses the transaction tree in pre-order traversal (i.e. exercise node are traversed before their children). * * Takes constant stack space. Crashes if the transaction is not well formed (see `isWellFormed`) @@ -450,9 +438,9 @@ sealed abstract class HasTxNodes { */ final def inputContracts[Cid2 >: ContractId]: Set[Cid2] = fold(Set.empty[Cid2]) { - case (acc, (_, Node.Exercise(coid, _, _, _, _, _, _, _, _, _, _, _, _, _, _))) => + case (acc, (_, Node.Exercise(coid, _, _, _, _, _, _, _, _, _, _, _, _, _))) => acc + coid - case (acc, (_, Node.Fetch(coid, _, _, _, _, _, _, _, _))) => + case (acc, (_, Node.Fetch(coid, _, _, _, _, _, _, _))) => acc + coid case (acc, (_, Node.LookupByKey(_, _, Some(coid), _))) => acc + coid @@ -780,13 +768,13 @@ object Transaction { tx.fold(State(Set.empty, Set.empty)) { case (state, (_, node)) => node match { - case Node.Create(_, tmplId, _, _, _, _, Some(key), _, _) => + case Node.Create(_, tmplId, _, _, _, _, Some(key), _) => state.created(globalKey(tmplId, key.key)) - case Node.Exercise(_, tmplId, _, true, _, _, _, _, _, _, _, Some(key), _, _, _) => + case Node.Exercise(_, tmplId, _, true, _, _, _, _, _, _, _, Some(key), _, _) => state.consumed(globalKey(tmplId, key.key)) - case Node.Exercise(_, tmplId, _, false, _, _, _, _, _, _, _, Some(key), _, _, _) => + case Node.Exercise(_, tmplId, _, false, _, _, _, _, _, _, _, Some(key), _, _) => state.referenced(globalKey(tmplId, key.key)) - case Node.Fetch(_, tmplId, _, _, _, Some(key), _, _, _) => + case Node.Fetch(_, tmplId, _, _, _, Some(key), _, _) => state.referenced(globalKey(tmplId, key.key)) case Node.LookupByKey(tmplId, key, Some(_), _) => state.referenced(globalKey(tmplId, key.key)) diff --git a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionCoder.scala b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionCoder.scala index 8394c90505..522c523b0a 100644 --- a/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionCoder.scala +++ b/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/TransactionCoder.scala @@ -278,7 +278,7 @@ object TransactionCoder { node match { - case nc @ Node.Create(_, _, _, _, _, _, _, _, _) => + case nc @ Node.Create(_, _, _, _, _, _, _, _) => val builder = TransactionOuterClass.NodeCreate.newBuilder() nc.stakeholders.foreach(builder.addStakeholders) nc.signatories.foreach(builder.addSignatories) @@ -310,7 +310,7 @@ object TransactionCoder { ) } yield nodeBuilder.setCreate(builder).build() - case nf @ Node.Fetch(_, _, _, _, _, _, _, _, _) => + case nf @ Node.Fetch(_, _, _, _, _, _, _, _) => val builder = TransactionOuterClass.NodeFetch.newBuilder() discard(builder.setTemplateId(ValueCoder.encodeIdentifier(nf.templateId))) nf.stakeholders.foreach(builder.addStakeholders) @@ -329,7 +329,7 @@ object TransactionCoder { ) } yield nodeBuilder.setFetch(builder).build() - case ne @ Node.Exercise(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => + case ne @ Node.Exercise(_, _, _, _, _, _, _, _, _, _, _, _, _, _) => val builder = TransactionOuterClass.NodeExercise.newBuilder() discard( builder @@ -524,7 +524,6 @@ object TransactionCoder { signatories = signatories, stakeholders = stakeholders, key = key, - byInterface = None, version = nodeVersion, ) case NodeTypeCase.FETCH => @@ -553,7 +552,6 @@ object TransactionCoder { stakeholders = stakeholders, key = key, byKey = byKey, - byInterface = None, version = nodeVersion, ) @@ -617,7 +615,6 @@ object TransactionCoder { exerciseResult = rvOpt, key = keyWithMaintainers, byKey = byKey, - byInterface = None, version = nodeVersion, ) case NodeTypeCase.LOOKUP_BY_KEY => diff --git a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionCoderSpec.scala b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionCoderSpec.scala index 82446c5808..dc096f28a3 100644 --- a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionCoderSpec.scala +++ b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionCoderSpec.scala @@ -230,7 +230,6 @@ class TransactionCoderSpec signatories = Set(Party.assertFromString("alice")), stakeholders = Set(Party.assertFromString("alice"), Party.assertFromString("bob")), key = None, - byInterface = None, version = TransactionVersion.minVersion, ) diff --git a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionNodeStatisticsSpec.scala b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionNodeStatisticsSpec.scala index 895aa4cd0f..9376609a2c 100644 --- a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionNodeStatisticsSpec.scala +++ b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionNodeStatisticsSpec.scala @@ -61,7 +61,6 @@ class TransactionNodeStatisticsSpec observers = Set.empty, key = if (withKey) Some(Value.ValueUnit) else None, maintainers = if (withKey) parties else Set.empty, - byInterface = None, ) } @@ -76,12 +75,11 @@ class TransactionNodeStatisticsSpec result = Some(Value.ValueUnit), choiceObservers = Set.empty, byKey = byKey, - byInterface = None, ) } def fetch(byKey: Boolean)(b: TxBuilder) = - b.fetch(create(b, byKey), byKey, None) + b.fetch(create(b, byKey), byKey) def lookup(b: TxBuilder) = b.lookupByKey(create(b, withKey = true), true) diff --git a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionSpec.scala b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionSpec.scala index 4525cdfc49..4b34da22be 100644 --- a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionSpec.scala +++ b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/transaction/TransactionSpec.scala @@ -692,7 +692,6 @@ object TransactionSpec { exerciseResult = if (hasExerciseResult) Some(V.ValueUnit) else None, key = None, byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ) @@ -705,7 +704,6 @@ object TransactionSpec { signatories = Set.empty, stakeholders = Set.empty, key = None, - byInterface = None, version = TransactionVersion.minVersion, ) diff --git a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/validation/ValidationSpec.scala b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/validation/ValidationSpec.scala index cea0b56a08..2f9a3ba655 100644 --- a/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/validation/ValidationSpec.scala +++ b/daml-lf/transaction/src/test/scala/com/digitalasset/daml/lf/validation/ValidationSpec.scala @@ -96,9 +96,6 @@ class ValidationSpec extends AnyFreeSpec with Matchers with TableDrivenPropertyC signatories = samParties1, stakeholders = samParties2, key = key, - byInterface = None, - // TODO https://github.com/digital-asset/daml/issues/12051 - // also vary byInterface version = version, ) @@ -115,9 +112,6 @@ class ValidationSpec extends AnyFreeSpec with Matchers with TableDrivenPropertyC stakeholders = samParties3, key = key, byKey = samBool1, - byInterface = None, - // TODO https://github.com/digital-asset/daml/issues/12051 - // also vary byInterface version = version, ) @@ -151,9 +145,6 @@ class ValidationSpec extends AnyFreeSpec with Matchers with TableDrivenPropertyC exerciseResult = exerciseResult, key = key, byKey = samBool2, - byInterface = None, - // TODO https://github.com/digital-asset/daml/issues/12051 - // also vary byInterface (but this requires an interface choice) version = version, ) diff --git a/ledger/participant-integration-api/src/main/scala/db/migration/postgres/V10_1__Populate_Event_Data.scala b/ledger/participant-integration-api/src/main/scala/db/migration/postgres/V10_1__Populate_Event_Data.scala index ed5012203d..7b9b7d94b1 100644 --- a/ledger/participant-integration-api/src/main/scala/db/migration/postgres/V10_1__Populate_Event_Data.scala +++ b/ledger/participant-integration-api/src/main/scala/db/migration/postgres/V10_1__Populate_Event_Data.scala @@ -52,7 +52,7 @@ private[migration] class V10_1__Populate_Event_Data extends BaseJavaMigration { val txs = loadTransactions(conn) val data = txs.flatMap { case (txId, tx) => tx.nodes.collect { - case (nodeId, Node.Create(cid, _, _, _, signatories, stakeholders, _, _, _)) => + case (nodeId, Node.Create(cid, _, _, _, signatories, stakeholders, _, _)) => (cid, EventId(txId, nodeId), signatories, stakeholders -- signatories) } } diff --git a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoDivulgenceSpec.scala b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoDivulgenceSpec.scala index 43e30b9942..6a785b726a 100644 --- a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoDivulgenceSpec.scala +++ b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoDivulgenceSpec.scala @@ -34,7 +34,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { signatories = Set(alice), stakeholders = Set(alice), key = None, - byInterface = None, version = TransactionVersion.minVersion, ) ) @@ -54,7 +53,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { key = Some( Node.KeyWithMaintainers(someContractKey(bob, "some key"), Set(bob)) ), - byInterface = None, version = TransactionVersion.minVersion, ) ) @@ -77,7 +75,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { exerciseResult = Some(someChoiceResult), key = None, byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ) ) @@ -92,7 +89,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { Node.KeyWithMaintainers(ValueParty(bob), Set(bob)) ), byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ), parentId = rootExercise, @@ -114,7 +110,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { Node.KeyWithMaintainers(someContractKey(bob, "some key"), Set(bob)) ), byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ), parentId = rootExercise, @@ -130,7 +125,6 @@ private[dao] trait JdbcLedgerDaoDivulgenceSpec extends LoneElement with Inside { key = Some( Node.KeyWithMaintainers(someContractKey(bob, "some key"), Set(bob)) ), - byInterface = None, version = TransactionVersion.minVersion, ), parentId = nestedExercise, diff --git a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoSuite.scala b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoSuite.scala index a36c74de24..eab73e1f3e 100644 --- a/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoSuite.scala +++ b/ledger/participant-integration-api/src/test/lib/scala/platform/store/dao/JdbcLedgerDaoSuite.scala @@ -211,7 +211,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { signatories = signatories, stakeholders = stakeholders, key = key, - byInterface = None, version = txVersion, ) @@ -233,7 +232,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { exerciseResult = Some(someChoiceResult), key = key, byKey = false, - byInterface = None, version = txVersion, ) @@ -249,7 +247,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { stakeholders = Set(party), None, byKey = false, - byInterface = None, version = txVersion, ) @@ -391,7 +388,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { exerciseResult = Some(someChoiceResult), key = None, byKey = false, - byInterface = None, version = txVersion, ) ) @@ -404,7 +400,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { stakeholders = Set(alice), None, byKey = false, - byInterface = None, version = txVersion, ), exerciseId, @@ -726,7 +721,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { signatories = Set(party), stakeholders = Set(party), key = Some(Node.KeyWithMaintainers(someContractKey(party, key), Set(party))), - byInterface = None, version = txVersion, ) ) @@ -767,7 +761,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { exerciseResult = Some(LfValue.ValueUnit), key = maybeKey.map(k => Node.KeyWithMaintainers(someContractKey(party, k), Set(party))), byKey = false, - byInterface = None, version = txVersion, ) ) @@ -828,7 +821,6 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend { stakeholders = Set(party), None, byKey = false, - byInterface = None, version = txVersion, ) ) diff --git a/ledger/participant-integration-api/src/test/suite/scala/platform/store/backend/UpdateToDbDtoSpec.scala b/ledger/participant-integration-api/src/test/suite/scala/platform/store/backend/UpdateToDbDtoSpec.scala index 2dec13008f..3486a276d2 100644 --- a/ledger/participant-integration-api/src/test/suite/scala/platform/store/backend/UpdateToDbDtoSpec.scala +++ b/ledger/participant-integration-api/src/test/suite/scala/platform/store/backend/UpdateToDbDtoSpec.scala @@ -772,12 +772,10 @@ class UpdateToDbDtoSpec extends AnyWordSpec with Matchers { val fetchNode = builder.fetch( contract = createNode, byKey = false, - byInterface = None, ) val fetchByKeyNode = builder.fetch( contract = createNode, byKey = true, - byInterface = None, ) val lookupByKeyNode = builder.lookupByKey( contract = createNode, diff --git a/ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/ProjectionsSpec.scala b/ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/ProjectionsSpec.scala index aecc291f02..86d1b6cc43 100644 --- a/ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/ProjectionsSpec.scala +++ b/ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/ProjectionsSpec.scala @@ -23,7 +23,6 @@ class ProjectionsSpec extends AnyWordSpec with Matchers { signatories = signatories, stakeholders = stakeholders, key = None, - byInterface = None, version = TransactionVersion.minVersion, ) @@ -50,7 +49,6 @@ class ProjectionsSpec extends AnyWordSpec with Matchers { exerciseResult = None, key = None, byKey = false, - byInterface = None, version = TransactionVersion.minVersion, ) diff --git a/ledger/sandbox-on-x/src/test/suite/scala/com/daml/ledger/sandbox/BridgeWriteServiceTest.scala b/ledger/sandbox-on-x/src/test/suite/scala/com/daml/ledger/sandbox/BridgeWriteServiceTest.scala index fb7a9f0487..5c47436129 100644 --- a/ledger/sandbox-on-x/src/test/suite/scala/com/daml/ledger/sandbox/BridgeWriteServiceTest.scala +++ b/ledger/sandbox-on-x/src/test/suite/scala/com/daml/ledger/sandbox/BridgeWriteServiceTest.scala @@ -36,7 +36,6 @@ class BridgeWriteServiceTest extends AnyFlatSpec with MockitoSugar with Matchers signatories = Set.empty, stakeholders = Set.empty, key = None, - byInterface = None, version = TransactionVersion.minVersion, ) diff --git a/security-evidence.md b/security-evidence.md index 5441b12506..b6cd75c615 100644 --- a/security-evidence.md +++ b/security-evidence.md @@ -4,20 +4,20 @@ - Updating the package service fails with insufficient authorization: [AuthorizationTest.scala](ledger-service/http-json/src/it/scala/http/AuthorizationTest.scala#L81) - Updating the package service succeeds with sufficient authorization: [AuthorizationTest.scala](ledger-service/http-json/src/it/scala/http/AuthorizationTest.scala#L89) - accept user tokens: [TestMiddleware.scala](triggers/service/auth/src/test/scala/com/daml/auth/middleware/oauth2/TestMiddleware.scala#L151) -- badly-authorized create is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L61) +- badly-authorized create is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L60) - badly-authorized create is rejected: [AbstractHttpServiceIntegrationTest.scala](ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala#L1778) -- badly-authorized exercise is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L159) +- badly-authorized exercise is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L158) - badly-authorized exercise/create (create is unauthorized) is rejected: [AuthPropagationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthPropagationSpec.scala#L274) - badly-authorized exercise/create (exercise is unauthorized) is rejected: [AuthPropagationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthPropagationSpec.scala#L242) - badly-authorized exercise/exercise (no implicit authority from outer exercise) is rejected: [AuthPropagationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthPropagationSpec.scala#L333) -- badly-authorized fetch is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L96) -- badly-authorized lookup is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L118) +- badly-authorized fetch is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L95) +- badly-authorized lookup is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L117) - create IOU should fail if overwritten actAs & readAs result in missing permission even if the user would have the rights: [HttpServiceIntegrationTestUserManagement.scala](ledger-service/http-json/src/it/scala/http/HttpServiceIntegrationTestUserManagement.scala#L134) - create IOU should fail if user has no permission: [HttpServiceIntegrationTestUserManagement.scala](ledger-service/http-json/src/it/scala/http/HttpServiceIntegrationTestUserManagement.scala#L108) - create IOU should work with correct user rights: [HttpServiceIntegrationTestUserManagement.scala](ledger-service/http-json/src/it/scala/http/HttpServiceIntegrationTestUserManagement.scala#L81) -- create with no signatories is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L51) -- create with non-signatory maintainers is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L73) -- exercise with no controllers is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L149) +- create with no signatories is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L50) +- create with non-signatory maintainers is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L72) +- exercise with no controllers is rejected: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L148) - fetch fails when readAs not authed, even if prior fetch succeeded: [AbstractHttpServiceIntegrationTest.scala](ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala#L1836) - forbid a non-authorized party to check the status of a trigger: [TriggerServiceTest.scala](triggers/service/src/test/scala/com/digitalasset/daml/lf/engine/trigger/TriggerServiceTest.scala#L661) - forbid a non-authorized party to list triggers: [TriggerServiceTest.scala](triggers/service/src/test/scala/com/digitalasset/daml/lf/engine/trigger/TriggerServiceTest.scala#L651) @@ -38,22 +38,22 @@ - websocket request with invalid protocol token should be denied: [AbstractWebsocketServiceIntegrationTest.scala](ledger-service/http-json/src/itlib/scala/http/AbstractWebsocketServiceIntegrationTest.scala#L91) - websocket request with valid protocol token should allow client subscribe to stream: [AbstractWebsocketServiceIntegrationTest.scala](ledger-service/http-json/src/itlib/scala/http/AbstractWebsocketServiceIntegrationTest.scala#L79) - websocket request without protocol token should be denied: [AbstractWebsocketServiceIntegrationTest.scala](ledger-service/http-json/src/itlib/scala/http/AbstractWebsocketServiceIntegrationTest.scala#L101) -- well-authorized create is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L44) -- well-authorized exercise is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L142) +- well-authorized create is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L43) +- well-authorized exercise is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L141) - well-authorized exercise/create is accepted: [AuthPropagationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthPropagationSpec.scala#L220) - well-authorized exercise/exercise is accepted: [AuthPropagationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthPropagationSpec.scala#L376) -- well-authorized fetch is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L90) -- well-authorized lookup is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L112) +- well-authorized fetch is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L89) +- well-authorized lookup is accepted: [AuthorizationSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/AuthorizationSpec.scala#L111) ## Privacy: - ensure correct privacy for create node: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L32) - ensure correct privacy for exercise node (consuming): [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L43) - ensure correct privacy for exercise node (non-consuming): [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L62) -- ensure correct privacy for exercise subtree: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L139) +- ensure correct privacy for exercise subtree: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L137) - ensure correct privacy for fetch node: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L82) - ensure correct privacy for lookup-by-key node (found): [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L94) -- ensure correct privacy for lookup-by-key node (not-found): [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L116) -- ensure correct privacy for rollback subtree: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L201) +- ensure correct privacy for lookup-by-key node (not-found): [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L115) +- ensure correct privacy for rollback subtree: [BlindingSpec.scala](daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/BlindingSpec.scala#L199) ## Semantics: - /v1/query GET succeeds after reconnect: [FailureTests.scala](ledger-service/http-json/src/failurelib/scala/http/FailureTests.scala#L153)