diff --git a/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Engine.scala b/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Engine.scala index b3de1b8c630..3b33817a825 100644 --- a/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Engine.scala +++ b/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/Engine.scala @@ -353,7 +353,7 @@ class Engine(val config: EngineConfig = Engine.StableConfig) { }, ) - case SResultNeedContract(contractId, _, _, callback) => + case SResultNeedContract(contractId, _, callback) => return Result.needContract( contractId, { coinst => 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 39c582d7ced..dedea52d2ad 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 @@ -623,7 +623,7 @@ class EngineTest speedy.Command.CreateAndExercise( templateId = tmplId, createArgument = - SRecord(null, ImmArray(Ref.Name.assertFromString("name")), ArrayList(SParty(alice))), + SRecord(tmplId, ImmArray(Ref.Name.assertFromString("name")), ArrayList(SParty(alice))), choiceId = ChoiceName.assertFromString("Exercise"), choiceArgument = SUnit, ) diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala index 49958dd8a64..0b83ef7301d 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala @@ -429,9 +429,13 @@ private[lf] final class Compiler( ) = let( env, - SBUFetch( - tmplId - )(env.toSEVar(cidPos), mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos)))), + SBCastAnyContract(tmplId)( + env.toSEVar(cidPos), + SBFetchAny( + env.toSEVar(cidPos), + mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos))), + ), + ), ) { (tmplArgPos, _env) => val env = _env.bindExprVar(tmpl.param, tmplArgPos).bindExprVar(choice.argBinder._1, choiceArgPos) @@ -475,39 +479,45 @@ private[lf] final class Compiler( typeRepPos: Position, guardPos: Position, ) = - let(env, SBUFetchInterface(ifaceId)(env.toSEVar(cidPos), env.toSEVar(typeRepPos))) { - (payloadPos, _env) => - val env = _env.bindExprVar(param, payloadPos).bindExprVar(choice.argBinder._1, choiceArgPos) + let( + env, + SBCastAnyInterface(ifaceId)( + env.toSEVar(cidPos), + env.toSEVar(typeRepPos), + SBFetchAny(env.toSEVar(cidPos), s.SEValue.None), + ), + ) { (payloadPos, _env) => + val env = _env.bindExprVar(param, payloadPos).bindExprVar(choice.argBinder._1, choiceArgPos) + let( + env, + SBApplyChoiceGuard(choice.name, Some(ifaceId))( + env.toSEVar(guardPos), + env.toSEVar(payloadPos), + env.toSEVar(cidPos), + ), + ) { (_, env) => let( env, - SBApplyChoiceGuard(choice.name, Some(ifaceId))( - env.toSEVar(guardPos), + SBResolveSBUBeginExercise( + choiceName = choice.name, + consuming = choice.consuming, + byKey = false, + ifaceId = ifaceId, + )( env.toSEVar(payloadPos), + env.toSEVar(choiceArgPos), env.toSEVar(cidPos), + translateExp(env, choice.controllers), + choice.choiceObservers match { + case Some(observers) => translateExp(env, observers) + case None => s.SEValue.EmptyList + }, ), - ) { (_, env) => - let( - env, - SBResolveSBUBeginExercise( - choice.name, - choice.consuming, - byKey = false, - ifaceId = ifaceId, - )( - env.toSEVar(payloadPos), - env.toSEVar(choiceArgPos), - env.toSEVar(cidPos), - translateExp(env, choice.controllers), - choice.choiceObservers match { - case Some(observers) => translateExp(env, observers) - case None => s.SEValue.EmptyList - }, - ), - ) { (_, _env) => - val env = _env.bindExprVar(choice.selfBinder, cidPos) - s.SEScopeExercise(app(translateExp(env, choice.update), env.toSEVar(tokenPos))) - } + ) { (_, _env) => + val env = _env.bindExprVar(choice.selfBinder, cidPos) + s.SEScopeExercise(app(translateExp(env, choice.update), env.toSEVar(tokenPos))) } + } } private[this] def compileInterfaceChoice( @@ -606,9 +616,13 @@ private[lf] final class Compiler( ) = let( env, - SBUFetch( - tmplId - )(env.toSEVar(cidPos), mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos)))), + SBCastAnyContract(tmplId)( + env.toSEVar(cidPos), + SBFetchAny( + env.toSEVar(cidPos), + mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos))), + ), + ), ) { (tmplArgPos, _env) => val env = _env.bindExprVar(tmpl.param, tmplArgPos) let( @@ -638,14 +652,20 @@ private[lf] final class Compiler( cidPos: Position, typeRepPos: Position, ) = - let(env, SBUFetchInterface(ifaceId)(env.toSEVar(cidPos), env.toSEVar(typeRepPos))) { - (payloadPos, env) => - let( - env, - SBResolveSBUInsertFetchNode(ifaceId)(env.toSEVar(payloadPos), env.toSEVar(cidPos)), - ) { (_, env) => - env.toSEVar(payloadPos) - } + let( + env, + SBCastAnyInterface(ifaceId)( + env.toSEVar(cidPos), + env.toSEVar(typeRepPos), + SBFetchAny(env.toSEVar(cidPos), s.SEValue.None), + ), + ) { (payloadPos, env) => + let( + env, + SBResolveSBUInsertFetchNode(ifaceId)(env.toSEVar(payloadPos), env.toSEVar(cidPos)), + ) { (_, env) => + env.toSEVar(payloadPos) + } } private[this] def compileFetchInterface( 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 bf4cf06dd45..46fdd394240 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 @@ -508,8 +508,7 @@ private[lf] object Pretty { case SBUCreate(Some(iface)) => text("$createByInterface") + char(',') + text(iface.qualifiedName.toString) + char(']') - case SBUFetch(ref) => - text("$fetch") + char('[') + text(ref.qualifiedName.toString) + char(']') + case SBFetchAny => text("$fetchAny") case SBGetTime => text("$getTime") case _ => str(x) } diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala index a418ebf61cc..63dc084dae3 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala @@ -63,7 +63,7 @@ private[speedy] sealed abstract class SBuiltin(val arity: Int) { */ private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit - private def unexpectedType(i: Int, expected: String, found: SValue) = + protected def unexpectedType(i: Int, expected: String, found: SValue) = crash(s"type mismatch of argument $i: expect $expected but got $found") final protected def getSBool(args: util.ArrayList[SValue], i: Int): Boolean = @@ -186,13 +186,13 @@ private[speedy] sealed abstract class SBuiltin(val arity: Int) { case otherwise => unexpectedType(i, "Exception", otherwise) } - final protected def getSAnyInterface( + final protected def getSAnyContract( args: util.ArrayList[SValue], i: Int, ): (TypeConName, SRecord) = args.get(i) match { - case SAnyInterface(tyCon, value) => (tyCon, value) - case otherwise => unexpectedType(i, "Interface", otherwise) + case SAnyContract(tyCon, value) => (tyCon, value) + case otherwise => unexpectedType(i, "AnyContract", otherwise) } final protected def checkToken(args: util.ArrayList[SValue], i: Int): Unit = @@ -1025,15 +1025,41 @@ private[lf] object SBuiltin { } } - /** $fetch[T] + // SBCastAnyContract: ContractId templateId -> Any -> templateId + final case class SBCastAnyContract(templateId: TypeConName) extends SBuiltinPure(2) { + override private[speedy] def executePure(args: util.ArrayList[SValue]) = { + def coid = getSContractId(args, 0) + val (actualTemplateId, record) = getSAnyContract(args, 1) + if (actualTemplateId != templateId) + throw SErrorDamlException(IE.WronglyTypedContract(coid, templateId, actualTemplateId)) + record + } + } + + // SBCastAnyInterface: ContractId ifaceId -> Option TypRep -> Any -> ifaceId + final case class SBCastAnyInterface(ifaceId: TypeConName) extends SBuiltin(3) { + override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = { + def coid = getSContractId(args, 0) + val (actualTmplId, _) = getSAnyContract(args, 2) + getSOptional(args, 1).foreach { + case STypeRep(Ast.TTyCon(expectedTmplId)) => + if (actualTmplId != expectedTmplId) + throw SErrorDamlException(IE.WronglyTypedContract(coid, expectedTmplId, actualTmplId)) + case otherwise => + crash(s"expected a type constructor, but got $otherwise") + } + if (machine.compiledPackages.getDefinition(ImplementsDefRef(actualTmplId, ifaceId)).isEmpty) + throw SErrorDamlException(IE.ContractDoesNotImplementInterface(ifaceId, coid, actualTmplId)) + machine.returnValue = args.get(2) + } + } + + /** $fetchAny[T] * :: ContractId a + * -> Optional {key: key, maintainers: List Party} (template key, if present) * -> a */ - final case class SBUFetch( - templateId: TypeConName - ) extends OnLedgerBuiltin(2) { - private[this] val eValCachedContractDefRef = SEVal(ToCachedContractDefRef(templateId)) - private[this] val typ = Ast.TTyCon(templateId) + final case object SBFetchAny extends OnLedgerBuiltin(2) { override protected def execute( args: util.ArrayList[SValue], machine: Machine, @@ -1044,27 +1070,24 @@ private[lf] object SBuiltin { case Some(cached) => onLedger.ptx.consumedBy .get(coid) - .foreach(nid => throw SErrorDamlException(IE.ContractNotActive(coid, templateId, nid))) - if (cached.templateId != templateId) - throw SErrorDamlException(IE.WronglyTypedContract(coid, templateId, cached.templateId)) - machine.returnValue = cached.value + .foreach(nid => + throw SErrorDamlException(IE.ContractNotActive(coid, cached.templateId, nid)) + ) + machine.returnValue = cached.any case None => throw SpeedyHungry( SResultNeedContract( coid, - templateId, onLedger.committers, { case Versioned(_, V.ContractInstance(actualTmplId, arg, _)) => - if (actualTmplId != templateId) { - machine.ctrl = - SEDamlException(IE.WronglyTypedContract(coid, templateId, actualTmplId)) - } else { - machine.pushKont(KCacheContract(machine, coid)) - machine.ctrl = SEApp( - eValCachedContractDefRef, - Array(SEImportValue(typ, arg), SEValue(args.get(1))), - ) - } + machine.pushKont(KCacheContract(machine, coid)) + machine.ctrl = SEApp( + SEVal(ToCachedContractDefRef(actualTmplId)), + Array( + SEImportValue(Ast.TTyCon(actualTmplId), arg), + SEValue(args.get(1)), + ), + ) }, ) ) @@ -1073,85 +1096,20 @@ private[lf] object SBuiltin { } } - // Similar to SBUFetch but is never performed "by key". - final case class SBUFetchInterface(ifaceId: TypeConName) extends OnLedgerBuiltin(2) { - override protected def execute( - args: util.ArrayList[SValue], - machine: Machine, - onLedger: OnLedger, - ): Unit = { - val coid = getSContractId(args, 0) - val expectedTemplateIdOpt = getSOptional(args, 1).map(typeRep => - typeRep match { - case STypeRep(Ast.TTyCon(tpl)) => tpl - case STypeRep(_) => - throw SErrorDamlException(IE.UserError("unexpected typerep during interface fetch")) - case _ => - crash(s"expected a typerep in SBUFetchInterface") - } - ) - - def checkTemplateId(actualTemplateId: TypeConName)(onSuccess: => Unit): Unit = { - // NOTE(Sofia): We can't throw directly here, because this is run - // in the SpeedyHungry callback. See the comment on SEDamlException. - val expectedTemplateId = expectedTemplateIdOpt.getOrElse(actualTemplateId) - if (actualTemplateId != expectedTemplateId) { - machine.ctrl = SEDamlException( - IE.WronglyTypedContract(coid, expectedTemplateId, actualTemplateId) - ) - } else if ( - machine.compiledPackages - .getDefinition(ImplementsDefRef(actualTemplateId, ifaceId)) - .isEmpty - ) { - machine.ctrl = SEDamlException( - IE.ContractDoesNotImplementInterface( - interfaceId = ifaceId, - coid = coid, - templateId = actualTemplateId, - ) - ) - } else { - onSuccess - } - } - - onLedger.cachedContracts.get(coid) match { - case Some(cached) => - onLedger.ptx.consumedBy - .get(coid) - .foreach(nid => - throw SErrorDamlException( - IE.ContractNotActive(coid, expectedTemplateIdOpt.getOrElse(ifaceId), nid) - ) - ) - checkTemplateId(cached.templateId) { - machine.returnValue = SAny( - ty = Ast.TTyCon(cached.templateId), - value = cached.value, - ) - } - case None => - throw SpeedyHungry( - SResultNeedContract( - coid, - ifaceId, - onLedger.committers, - { case Versioned(_, V.ContractInstance(actualTmplId, arg, _)) => - checkTemplateId(actualTmplId) { - machine.pushKont( - KBuiltin(machine, SBToInterface(actualTmplId), new util.ArrayList[SValue]) - ) - machine.pushKont(KCacheContract(machine, coid)) - machine.ctrl = SEApp( - SEVal(ToCachedContractDefRef(actualTmplId)), - Array(SEImportValue(Ast.TTyCon(actualTmplId), arg), SEValue(args.get(1))), - ) - } - }, - ) - ) + final case object SBCheckTemplateType extends SBuiltinPure(3) { + override private[speedy] def executePure(args: util.ArrayList[SValue]): SValue = { + val expectedTmplId = getSTypeRep(args, 0) match { + case Ast.TTyCon(tplId) => tplId + case _ => + throw SErrorDamlException(IE.UserError("unexpected typerep during interface fetch")) } + def coid = getSContractId(args, 1) + val (actualTemplateId, _) = getSAnyContract(args, 2) + if (actualTemplateId != expectedTmplId) + throw SErrorDamlException( + IE.WronglyTypedContract(coid, expectedTmplId, actualTemplateId) + ) + SUnit } } @@ -1164,10 +1122,10 @@ private[lf] object SBuiltin { machine: Machine, ): Unit = { val guard = args.get(0) - val (templateId, record) = getSAnyInterface(args, 1) + val (templateId, record) = getSAnyContract(args, 1) val coid = getSContractId(args, 2) - machine.ctrl = SEApp(SEValue(guard), Array(SEValue(SAnyInterface(templateId, record)))) + machine.ctrl = SEApp(SEValue(guard), Array(SEValue(SAnyContract(templateId, record)))) machine.pushKont(KCheckChoiceGuard(machine, coid, templateId, choiceName, byInterface)) } } @@ -1176,7 +1134,7 @@ private[lf] object SBuiltin { override private[speedy] def executePure( args: util.ArrayList[SValue] ): SBool = { - discard(getSAnyInterface(args, 0)) + discard(getSAnyContract(args, 0)) SBool(true) } } @@ -1190,7 +1148,7 @@ private[lf] object SBuiltin { override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = machine.ctrl = SEBuiltin( SBUBeginExercise( - getSAnyInterface(args, 0)._1, + getSAnyContract(args, 0)._1, choiceName, consuming, byKey, @@ -1204,14 +1162,14 @@ private[lf] object SBuiltin { ) extends SBuiltin(1) { override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = machine.ctrl = SEBuiltin( - SBUInsertFetchNode(getSAnyInterface(args, 0)._1, byKey = false, byInterface = Some(ifaceId)) + SBUInsertFetchNode(getSAnyContract(args, 0)._1, byKey = false, byInterface = Some(ifaceId)) ) } // Return a definition matching the templateId of a given payload sealed class SBResolveVirtual(toDef: Ref.Identifier => SDefinitionRef) extends SBuiltin(1) { override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = { - val (ty, record) = getSAnyInterface(args, 0) + val (ty, record) = getSAnyContract(args, 0) machine.ctrl = SEApp(SEVal(toDef(ty)), Array(SEValue(record))) } } @@ -1231,7 +1189,7 @@ private[lf] object SBuiltin { tplId: TypeConName ) extends SBuiltinPure(1) { override private[speedy] def executePure(args: util.ArrayList[SValue]): SAny = { - SAnyInterface(tplId, getSRecord(args, 0)) + SAnyContract(tplId, getSRecord(args, 0)) } } @@ -1242,7 +1200,7 @@ private[lf] object SBuiltin { tplId: TypeConName ) extends SBuiltinPure(1) { override private[speedy] def executePure(args: util.ArrayList[SValue]): SOptional = { - val (tyCon, record) = getSAnyInterface(args, 0) + val (tyCon, record) = getSAnyContract(args, 0) if (tplId == tyCon) { SOptional(Some(record)) } else { @@ -1261,13 +1219,13 @@ private[lf] object SBuiltin { args: util.ArrayList[SValue], machine: Machine, ) = { - val (tyCon, record) = getSAnyInterface(args, 0) + val (tyCon, record) = getSAnyContract(args, 0) // TODO https://github.com/digital-asset/daml/issues/12051 // TODO https://github.com/digital-asset/daml/issues/11345 // The lookup is probably slow. We may want to investigate way to make the feature faster. machine.returnValue = machine.compiledPackages.interface.lookupTemplate(tyCon) match { case Right(ifaceSignature) if ifaceSignature.implements.contains(requiringIface) => - SOptional(Some(SAnyInterface(tyCon, record))) + SOptional(Some(SAnyContract(tyCon, record))) case _ => SOptional(None) } @@ -1279,7 +1237,7 @@ private[lf] object SBuiltin { methodName: MethodName, ) extends SBuiltin(1) { override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = { - val (tyCon, record) = getSAnyInterface(args, 0) + val (tyCon, record) = getSAnyContract(args, 0) machine.ctrl = SEApp(SEVal(ImplementsMethodDefRef(tyCon, ifaceId, methodName)), Array(SEValue(record))) } @@ -1668,7 +1626,7 @@ private[lf] object SBuiltin { */ final case class SBInterfaceTemplateTypeRep(tycon: TypeConName) extends SBuiltinPure(1) { override private[speedy] def executePure(args: util.ArrayList[SValue]): STypeRep = { - val (tyCon, _) = getSAnyInterface(args, 0) + val (tyCon, _) = getSAnyContract(args, 0) STypeRep(Ast.TTyCon(tyCon)) } } diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SResult.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SResult.scala index 33da63ce3f4..dfadf604c9f 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SResult.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SResult.scala @@ -31,7 +31,6 @@ object SResult { /** Update interpretation requires access to a contract on the ledger. */ final case class SResultNeedContract( contractId: ContractId, - templateId: TypeConName, committers: Set[Party], // Callback // returns the next expression to evaluate. diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SValue.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SValue.scala index 110f78ae9c6..5d11d7d5897 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SValue.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SValue.scala @@ -250,12 +250,12 @@ object SValue { } } - object SAnyInterface { + object SAnyContract { def apply(tyCon: Ref.TypeConName, record: SRecord): SAny = SAny(TTyCon(tyCon), record) def unapply(any: SAny): Option[(TypeConName, SRecord)] = any match { - case SAny(TTyCon(tyCon0), record @ SRecord(tyCon1, _, _)) if tyCon0 == tyCon1 => + case SAny(TTyCon(tyCon0), record: SRecord) if record.id == tyCon0 => Some(tyCon0, record) case _ => None diff --git a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala index cce6a65081e..4ba941cfef4 100644 --- a/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala +++ b/daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Speedy.scala @@ -107,7 +107,8 @@ private[lf] object Speedy { observers: Set[Party], key: Option[Node.KeyWithMaintainers], ) { - private[lf] val stakeholders: Set[Party] = signatories union observers; + private[lf] val stakeholders: Set[Party] = signatories union observers + private[speedy] val any = SValue.SAny(TTyCon(templateId), value) } private[this] def enforceLimit(actual: Int, limit: Int, error: Int => IError.Limit.Error) = @@ -1348,9 +1349,9 @@ private[lf] object Speedy { def execute(sv: SValue): Unit = { machine.withOnLedger("KCacheContract") { onLedger => val cached = SBuiltin.extractCachedContract(machine, sv) - machine.checkContractVisibility(onLedger, cid, cached); + machine.checkContractVisibility(onLedger, cid, cached) onLedger.addGlobalContract(cid, cached) - machine.returnValue = cached.value + machine.returnValue = cached.any } } } diff --git a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala index a7b72569cc9..7139565e9ba 100644 --- a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala +++ b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala @@ -723,8 +723,9 @@ class EvaluationOrderTest extends AnyFreeSpec with Matchers with Inside { Set(alice), getContract = getWronglyTypedContract, ) - inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => - msgs shouldBe Seq("starts test") + inside(res) { + case Success(Left(SErrorDamlException(IE.ContractNotActive(_, Dummy, _)))) => + msgs shouldBe Seq("starts test") } } @@ -822,8 +823,9 @@ class EvaluationOrderTest extends AnyFreeSpec with Matchers with Inside { Array(SParty(alice), SParty(alice)), Set(alice), ) - inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => - msgs shouldBe Seq("starts test") + inside(res) { + case Success(Left(SErrorDamlException(IE.ContractNotActive(_, Dummy, _)))) => + msgs shouldBe Seq("starts test") } } @@ -1399,8 +1401,9 @@ class EvaluationOrderTest extends AnyFreeSpec with Matchers with Inside { Set(alice), getContract = getWronglyTypedContract, ) - inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => - msgs shouldBe Seq("starts test") + inside(res) { + case Success(Left(SErrorDamlException(IE.ContractNotActive(_, Dummy, _)))) => + msgs shouldBe Seq("starts test") } } @@ -1485,8 +1488,9 @@ class EvaluationOrderTest extends AnyFreeSpec with Matchers with Inside { Array(SParty(alice), SParty(alice)), Set(alice), ) - inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => - msgs shouldBe Seq("starts test") + inside(res) { + case Success(Left(SErrorDamlException(IE.ContractNotActive(_, Dummy, _)))) => + msgs shouldBe Seq("starts test") } } diff --git a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/SpeedyTestLib.scala b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/SpeedyTestLib.scala index 6c15fe57da0..a9d1d98cb4c 100644 --- a/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/SpeedyTestLib.scala +++ b/daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/SpeedyTestLib.scala @@ -54,7 +54,7 @@ private[speedy] object SpeedyTestLib { case None => throw UnexpectedSResultNeedTime } - case SResultNeedContract(contractId, _, _, callback) => + case SResultNeedContract(contractId, _, callback) => getContract.lift(contractId) match { case Some(value) => callback(value) diff --git a/daml-lf/scenario-interpreter/src/main/scala/com/digitalasset/daml/lf/ScenarioRunner.scala b/daml-lf/scenario-interpreter/src/main/scala/com/digitalasset/daml/lf/ScenarioRunner.scala index d07262b380b..ad0e36d1d88 100644 --- a/daml-lf/scenario-interpreter/src/main/scala/com/digitalasset/daml/lf/ScenarioRunner.scala +++ b/daml-lf/scenario-interpreter/src/main/scala/com/digitalasset/daml/lf/ScenarioRunner.scala @@ -422,7 +422,7 @@ object ScenarioRunner { } case SResultError(err) => SubmissionError(Error.RunnerException(err), enrich(onLedger.incompleteTransaction)) - case SResultNeedContract(coid, tid @ _, committers, callback) => + case SResultNeedContract(coid, committers, callback) => ledger.lookupContract(coid, committers, readAs, callback) match { case Left(err) => SubmissionError(err, enrich(onLedger.incompleteTransaction)) case Right(_) => go() diff --git a/daml-lf/scenario-interpreter/src/perf/benches/scala/com/digitalasset/daml/lf/speedy/perf/CollectAuthority.scala b/daml-lf/scenario-interpreter/src/perf/benches/scala/com/digitalasset/daml/lf/speedy/perf/CollectAuthority.scala index c88d5b24573..5f0369bd826 100644 --- a/daml-lf/scenario-interpreter/src/perf/benches/scala/com/digitalasset/daml/lf/speedy/perf/CollectAuthority.scala +++ b/daml-lf/scenario-interpreter/src/perf/benches/scala/com/digitalasset/daml/lf/speedy/perf/CollectAuthority.scala @@ -99,7 +99,7 @@ class CollectAuthorityState { callback(value) case ScenarioRunner.SubmissionError(err, _) => crash(s"Submission failed $err") } - case SResultNeedContract(_, _, _, _) => + case SResultNeedContract(_, _, _) => crash("Off-ledger need contract callback") case SResultFinalValue(v) => finalValue = v case r => crash(s"bench run: unexpected result from speedy: ${r}") diff --git a/security-evidence.md b/security-evidence.md index 4c8d95f3dd6..d51aa7a68c2 100644 --- a/security-evidence.md +++ b/security-evidence.md @@ -36,73 +36,73 @@ - Evaluation order of create with duplicate contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L438) - Evaluation order of create with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L463) - Evaluation order of create with failed precondition: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L388) -- Evaluation order of exercise of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L830) +- Evaluation order of exercise of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L832) - Evaluation order of exercise of a non-cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L629) - Evaluation order of exercise of a wrongly typed cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L696) - Evaluation order of exercise of a wrongly typed non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L614) - Evaluation order of exercise of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L679) -- Evaluation order of exercise of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L773) -- Evaluation order of exercise of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L854) -- Evaluation order of exercise of an wrongly typed local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L792) -- Evaluation order of exercise of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L731) -- Evaluation order of exercise with argument exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L868) -- Evaluation order of exercise with output exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L891) -- Evaluation order of exercise_by_key of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1125) -- Evaluation order of exercise_by_key of a non-cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L962) -- Evaluation order of exercise_by_key of a wrongly typed cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1035) -- Evaluation order of exercise_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1016) -- Evaluation order of exercise_by_key of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1105) -- Evaluation order of exercise_by_key of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1181) -- Evaluation order of exercise_by_key of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1054) -- Evaluation order of exercise_by_key with argument exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1196) -- Evaluation order of exercise_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1259) -- Evaluation order of exercise_by_key with result exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1220) -- Evaluation order of exercise_vy_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1245) -- Evaluation order of fetch of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1493) -- Evaluation order of fetch of a non-cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1316) -- Evaluation order of fetch of a wrongly typed cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1374) -- Evaluation order of fetch of a wrongly typed non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1301) -- Evaluation order of fetch of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1358) -- Evaluation order of fetch of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1442) -- Evaluation order of fetch of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1511) -- Evaluation order of fetch of an wrongly typed local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1459) -- Evaluation order of fetch of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1407) -- Evaluation order of fetch_by_key of a cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1635) -- Evaluation order of fetch_by_key of a local contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1689) -- Evaluation order of fetch_by_key of a non-cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1574) -- Evaluation order of fetch_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1616) -- Evaluation order of fetch_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1671) -- Evaluation order of fetch_by_key of an unknown contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1722) -- Evaluation order of fetch_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1752) -- Evaluation order of fetch_by_key with contract key exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1766) -- Evaluation order of fetch_by_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1738) -- Evaluation order of lookup of a local contract with visibility failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1148) -- Evaluation order of lookup_by_key of a cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1857) -- Evaluation order of lookup_by_key of a local contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1926) -- Evaluation order of lookup_by_key of a local contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1910) -- Evaluation order of lookup_by_key of a non-cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1804) -- Evaluation order of lookup_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1839) -- Evaluation order of lookup_by_key of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1893) -- Evaluation order of lookup_by_key of an unknown contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1960) -- Evaluation order of lookup_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1990) -- Evaluation order of lookup_by_key with contract key exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L2004) -- Evaluation order of lookup_by_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1976) +- Evaluation order of exercise of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L774) +- Evaluation order of exercise of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L856) +- Evaluation order of exercise of an wrongly typed local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L793) +- Evaluation order of exercise of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L732) +- Evaluation order of exercise with argument exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L870) +- Evaluation order of exercise with output exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L893) +- Evaluation order of exercise_by_key of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1127) +- Evaluation order of exercise_by_key of a non-cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L964) +- Evaluation order of exercise_by_key of a wrongly typed cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1037) +- Evaluation order of exercise_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1018) +- Evaluation order of exercise_by_key of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1107) +- Evaluation order of exercise_by_key of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1183) +- Evaluation order of exercise_by_key of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1056) +- Evaluation order of exercise_by_key with argument exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1198) +- Evaluation order of exercise_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1261) +- Evaluation order of exercise_by_key with result exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1222) +- Evaluation order of exercise_vy_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1247) +- Evaluation order of fetch of a cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1497) +- Evaluation order of fetch of a non-cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1318) +- Evaluation order of fetch of a wrongly typed cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1376) +- Evaluation order of fetch of a wrongly typed non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1303) +- Evaluation order of fetch of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1360) +- Evaluation order of fetch of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1445) +- Evaluation order of fetch of an unknown contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1515) +- Evaluation order of fetch of an wrongly typed local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1462) +- Evaluation order of fetch of cached global contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1410) +- Evaluation order of fetch_by_key of a cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1639) +- Evaluation order of fetch_by_key of a local contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1693) +- Evaluation order of fetch_by_key of a non-cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1578) +- Evaluation order of fetch_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1620) +- Evaluation order of fetch_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1675) +- Evaluation order of fetch_by_key of an unknown contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1726) +- Evaluation order of fetch_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1756) +- Evaluation order of fetch_by_key with contract key exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1770) +- Evaluation order of fetch_by_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1742) +- Evaluation order of lookup of a local contract with visibility failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1150) +- Evaluation order of lookup_by_key of a cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1861) +- Evaluation order of lookup_by_key of a local contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1930) +- Evaluation order of lookup_by_key of a local contract with failure authorization: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1914) +- Evaluation order of lookup_by_key of a non-cached global contract with authorization failure: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1808) +- Evaluation order of lookup_by_key of an inactive global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1843) +- Evaluation order of lookup_by_key of an inactive local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1897) +- Evaluation order of lookup_by_key of an unknown contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1964) +- Evaluation order of lookup_by_key with contract ID in contract key: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1994) +- Evaluation order of lookup_by_key with contract key exceeding max nesting: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L2008) +- Evaluation order of lookup_by_key with empty contract key maintainers: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1980) - Evaluation order of successful create: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L364) - Evaluation order of successful exercise of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L656) -- Evaluation order of successful exercise of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L751) +- Evaluation order of successful exercise of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L752) - Evaluation order of successful exercise of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L589) -- Evaluation order of successful exercise_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L990) -- Evaluation order of successful exercise_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1082) -- Evaluation order of successful exercise_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L920) -- Evaluation order of successful fetch of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1341) -- Evaluation order of successful fetch of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1427) -- Evaluation order of successful fetch of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1279) -- Evaluation order of successful fetch_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1599) -- Evaluation order of successful fetch_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1655) -- Evaluation order of successful fetch_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1530) -- Evaluation order of successful lookup_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1822) -- Evaluation order of successful lookup_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1877) -- Evaluation order of successful lookup_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1784) +- Evaluation order of successful exercise_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L992) +- Evaluation order of successful exercise_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1084) +- Evaluation order of successful exercise_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L922) +- Evaluation order of successful fetch of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1343) +- Evaluation order of successful fetch of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1430) +- Evaluation order of successful fetch of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1281) +- Evaluation order of successful fetch_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1603) +- Evaluation order of successful fetch_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1659) +- Evaluation order of successful fetch_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1534) +- Evaluation order of successful lookup_by_key of a cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1826) +- Evaluation order of successful lookup_by_key of a local contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1881) +- Evaluation order of successful lookup_by_key of a non-cached global contract: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L1788) - Evaluation order: Interface preconditions are evaluated in the order given by the implementation list.: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L422) - Evaluation order: Template precondition before interface preconditions.: [EvaluationOrderTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala#L406) - Exceptions, throw/catch.: [ExceptionTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ExceptionTest.scala#L25)