Speedy: Factorize fetch part between fetch by template and by itnerface (#13148)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Remy 2022-03-07 20:32:47 +01:00 committed by GitHub
parent 235254998f
commit d5471076ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 218 additions and 237 deletions

View File

@ -353,7 +353,7 @@ class Engine(val config: EngineConfig = Engine.StableConfig) {
}, },
) )
case SResultNeedContract(contractId, _, _, callback) => case SResultNeedContract(contractId, _, callback) =>
return Result.needContract( return Result.needContract(
contractId, contractId,
{ coinst => { coinst =>

View File

@ -623,7 +623,7 @@ class EngineTest
speedy.Command.CreateAndExercise( speedy.Command.CreateAndExercise(
templateId = tmplId, templateId = tmplId,
createArgument = 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"), choiceId = ChoiceName.assertFromString("Exercise"),
choiceArgument = SUnit, choiceArgument = SUnit,
) )

View File

@ -429,9 +429,13 @@ private[lf] final class Compiler(
) = ) =
let( let(
env, env,
SBUFetch( SBCastAnyContract(tmplId)(
tmplId env.toSEVar(cidPos),
)(env.toSEVar(cidPos), mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos)))), SBFetchAny(
env.toSEVar(cidPos),
mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos))),
),
),
) { (tmplArgPos, _env) => ) { (tmplArgPos, _env) =>
val env = val env =
_env.bindExprVar(tmpl.param, tmplArgPos).bindExprVar(choice.argBinder._1, choiceArgPos) _env.bindExprVar(tmpl.param, tmplArgPos).bindExprVar(choice.argBinder._1, choiceArgPos)
@ -475,39 +479,45 @@ private[lf] final class Compiler(
typeRepPos: Position, typeRepPos: Position,
guardPos: Position, guardPos: Position,
) = ) =
let(env, SBUFetchInterface(ifaceId)(env.toSEVar(cidPos), env.toSEVar(typeRepPos))) { let(
(payloadPos, _env) => env,
val env = _env.bindExprVar(param, payloadPos).bindExprVar(choice.argBinder._1, choiceArgPos) 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( let(
env, env,
SBApplyChoiceGuard(choice.name, Some(ifaceId))( SBResolveSBUBeginExercise(
env.toSEVar(guardPos), choiceName = choice.name,
consuming = choice.consuming,
byKey = false,
ifaceId = ifaceId,
)(
env.toSEVar(payloadPos), env.toSEVar(payloadPos),
env.toSEVar(choiceArgPos),
env.toSEVar(cidPos), env.toSEVar(cidPos),
translateExp(env, choice.controllers),
choice.choiceObservers match {
case Some(observers) => translateExp(env, observers)
case None => s.SEValue.EmptyList
},
), ),
) { (_, env) => ) { (_, _env) =>
let( val env = _env.bindExprVar(choice.selfBinder, cidPos)
env, s.SEScopeExercise(app(translateExp(env, choice.update), env.toSEVar(tokenPos)))
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)))
}
} }
}
} }
private[this] def compileInterfaceChoice( private[this] def compileInterfaceChoice(
@ -606,9 +616,13 @@ private[lf] final class Compiler(
) = ) =
let( let(
env, env,
SBUFetch( SBCastAnyContract(tmplId)(
tmplId env.toSEVar(cidPos),
)(env.toSEVar(cidPos), mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos)))), SBFetchAny(
env.toSEVar(cidPos),
mbKey.fold(s.SEValue.None: s.SExpr)(pos => SBSome(env.toSEVar(pos))),
),
),
) { (tmplArgPos, _env) => ) { (tmplArgPos, _env) =>
val env = _env.bindExprVar(tmpl.param, tmplArgPos) val env = _env.bindExprVar(tmpl.param, tmplArgPos)
let( let(
@ -638,14 +652,20 @@ private[lf] final class Compiler(
cidPos: Position, cidPos: Position,
typeRepPos: Position, typeRepPos: Position,
) = ) =
let(env, SBUFetchInterface(ifaceId)(env.toSEVar(cidPos), env.toSEVar(typeRepPos))) { let(
(payloadPos, env) => env,
let( SBCastAnyInterface(ifaceId)(
env, env.toSEVar(cidPos),
SBResolveSBUInsertFetchNode(ifaceId)(env.toSEVar(payloadPos), env.toSEVar(cidPos)), env.toSEVar(typeRepPos),
) { (_, env) => SBFetchAny(env.toSEVar(cidPos), s.SEValue.None),
env.toSEVar(payloadPos) ),
} ) { (payloadPos, env) =>
let(
env,
SBResolveSBUInsertFetchNode(ifaceId)(env.toSEVar(payloadPos), env.toSEVar(cidPos)),
) { (_, env) =>
env.toSEVar(payloadPos)
}
} }
private[this] def compileFetchInterface( private[this] def compileFetchInterface(

View File

@ -508,8 +508,7 @@ private[lf] object Pretty {
case SBUCreate(Some(iface)) => case SBUCreate(Some(iface)) =>
text("$createByInterface") + char(',') + text(iface.qualifiedName.toString) + text("$createByInterface") + char(',') + text(iface.qualifiedName.toString) +
char(']') char(']')
case SBUFetch(ref) => case SBFetchAny => text("$fetchAny")
text("$fetch") + char('[') + text(ref.qualifiedName.toString) + char(']')
case SBGetTime => text("$getTime") case SBGetTime => text("$getTime")
case _ => str(x) case _ => str(x)
} }

View File

@ -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[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") crash(s"type mismatch of argument $i: expect $expected but got $found")
final protected def getSBool(args: util.ArrayList[SValue], i: Int): Boolean = 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) case otherwise => unexpectedType(i, "Exception", otherwise)
} }
final protected def getSAnyInterface( final protected def getSAnyContract(
args: util.ArrayList[SValue], args: util.ArrayList[SValue],
i: Int, i: Int,
): (TypeConName, SRecord) = ): (TypeConName, SRecord) =
args.get(i) match { args.get(i) match {
case SAnyInterface(tyCon, value) => (tyCon, value) case SAnyContract(tyCon, value) => (tyCon, value)
case otherwise => unexpectedType(i, "Interface", otherwise) case otherwise => unexpectedType(i, "AnyContract", otherwise)
} }
final protected def checkToken(args: util.ArrayList[SValue], i: Int): Unit = 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 * :: ContractId a
* -> Optional {key: key, maintainers: List Party} (template key, if present)
* -> a * -> a
*/ */
final case class SBUFetch( final case object SBFetchAny extends OnLedgerBuiltin(2) {
templateId: TypeConName
) extends OnLedgerBuiltin(2) {
private[this] val eValCachedContractDefRef = SEVal(ToCachedContractDefRef(templateId))
private[this] val typ = Ast.TTyCon(templateId)
override protected def execute( override protected def execute(
args: util.ArrayList[SValue], args: util.ArrayList[SValue],
machine: Machine, machine: Machine,
@ -1044,27 +1070,24 @@ private[lf] object SBuiltin {
case Some(cached) => case Some(cached) =>
onLedger.ptx.consumedBy onLedger.ptx.consumedBy
.get(coid) .get(coid)
.foreach(nid => throw SErrorDamlException(IE.ContractNotActive(coid, templateId, nid))) .foreach(nid =>
if (cached.templateId != templateId) throw SErrorDamlException(IE.ContractNotActive(coid, cached.templateId, nid))
throw SErrorDamlException(IE.WronglyTypedContract(coid, templateId, cached.templateId)) )
machine.returnValue = cached.value machine.returnValue = cached.any
case None => case None =>
throw SpeedyHungry( throw SpeedyHungry(
SResultNeedContract( SResultNeedContract(
coid, coid,
templateId,
onLedger.committers, onLedger.committers,
{ case Versioned(_, V.ContractInstance(actualTmplId, arg, _)) => { case Versioned(_, V.ContractInstance(actualTmplId, arg, _)) =>
if (actualTmplId != templateId) { machine.pushKont(KCacheContract(machine, coid))
machine.ctrl = machine.ctrl = SEApp(
SEDamlException(IE.WronglyTypedContract(coid, templateId, actualTmplId)) SEVal(ToCachedContractDefRef(actualTmplId)),
} else { Array(
machine.pushKont(KCacheContract(machine, coid)) SEImportValue(Ast.TTyCon(actualTmplId), arg),
machine.ctrl = SEApp( SEValue(args.get(1)),
eValCachedContractDefRef, ),
Array(SEImportValue(typ, arg), SEValue(args.get(1))), )
)
}
}, },
) )
) )
@ -1073,85 +1096,20 @@ private[lf] object SBuiltin {
} }
} }
// Similar to SBUFetch but is never performed "by key". final case object SBCheckTemplateType extends SBuiltinPure(3) {
final case class SBUFetchInterface(ifaceId: TypeConName) extends OnLedgerBuiltin(2) { override private[speedy] def executePure(args: util.ArrayList[SValue]): SValue = {
override protected def execute( val expectedTmplId = getSTypeRep(args, 0) match {
args: util.ArrayList[SValue], case Ast.TTyCon(tplId) => tplId
machine: Machine, case _ =>
onLedger: OnLedger, throw SErrorDamlException(IE.UserError("unexpected typerep during interface fetch"))
): 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))),
)
}
},
)
)
} }
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, machine: Machine,
): Unit = { ): Unit = {
val guard = args.get(0) val guard = args.get(0)
val (templateId, record) = getSAnyInterface(args, 1) val (templateId, record) = getSAnyContract(args, 1)
val coid = getSContractId(args, 2) 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)) machine.pushKont(KCheckChoiceGuard(machine, coid, templateId, choiceName, byInterface))
} }
} }
@ -1176,7 +1134,7 @@ private[lf] object SBuiltin {
override private[speedy] def executePure( override private[speedy] def executePure(
args: util.ArrayList[SValue] args: util.ArrayList[SValue]
): SBool = { ): SBool = {
discard(getSAnyInterface(args, 0)) discard(getSAnyContract(args, 0))
SBool(true) SBool(true)
} }
} }
@ -1190,7 +1148,7 @@ private[lf] object SBuiltin {
override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit =
machine.ctrl = SEBuiltin( machine.ctrl = SEBuiltin(
SBUBeginExercise( SBUBeginExercise(
getSAnyInterface(args, 0)._1, getSAnyContract(args, 0)._1,
choiceName, choiceName,
consuming, consuming,
byKey, byKey,
@ -1204,14 +1162,14 @@ private[lf] object SBuiltin {
) extends SBuiltin(1) { ) extends SBuiltin(1) {
override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit =
machine.ctrl = SEBuiltin( 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 // Return a definition matching the templateId of a given payload
sealed class SBResolveVirtual(toDef: Ref.Identifier => SDefinitionRef) extends SBuiltin(1) { sealed class SBResolveVirtual(toDef: Ref.Identifier => SDefinitionRef) extends SBuiltin(1) {
override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = { 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))) machine.ctrl = SEApp(SEVal(toDef(ty)), Array(SEValue(record)))
} }
} }
@ -1231,7 +1189,7 @@ private[lf] object SBuiltin {
tplId: TypeConName tplId: TypeConName
) extends SBuiltinPure(1) { ) extends SBuiltinPure(1) {
override private[speedy] def executePure(args: util.ArrayList[SValue]): SAny = { 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 tplId: TypeConName
) extends SBuiltinPure(1) { ) extends SBuiltinPure(1) {
override private[speedy] def executePure(args: util.ArrayList[SValue]): SOptional = { 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) { if (tplId == tyCon) {
SOptional(Some(record)) SOptional(Some(record))
} else { } else {
@ -1261,13 +1219,13 @@ private[lf] object SBuiltin {
args: util.ArrayList[SValue], args: util.ArrayList[SValue],
machine: Machine, 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/12051
// TODO https://github.com/digital-asset/daml/issues/11345 // 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. // The lookup is probably slow. We may want to investigate way to make the feature faster.
machine.returnValue = machine.compiledPackages.interface.lookupTemplate(tyCon) match { machine.returnValue = machine.compiledPackages.interface.lookupTemplate(tyCon) match {
case Right(ifaceSignature) if ifaceSignature.implements.contains(requiringIface) => case Right(ifaceSignature) if ifaceSignature.implements.contains(requiringIface) =>
SOptional(Some(SAnyInterface(tyCon, record))) SOptional(Some(SAnyContract(tyCon, record)))
case _ => case _ =>
SOptional(None) SOptional(None)
} }
@ -1279,7 +1237,7 @@ private[lf] object SBuiltin {
methodName: MethodName, methodName: MethodName,
) extends SBuiltin(1) { ) extends SBuiltin(1) {
override private[speedy] def execute(args: util.ArrayList[SValue], machine: Machine): Unit = { 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 = machine.ctrl =
SEApp(SEVal(ImplementsMethodDefRef(tyCon, ifaceId, methodName)), Array(SEValue(record))) 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) { final case class SBInterfaceTemplateTypeRep(tycon: TypeConName) extends SBuiltinPure(1) {
override private[speedy] def executePure(args: util.ArrayList[SValue]): STypeRep = { override private[speedy] def executePure(args: util.ArrayList[SValue]): STypeRep = {
val (tyCon, _) = getSAnyInterface(args, 0) val (tyCon, _) = getSAnyContract(args, 0)
STypeRep(Ast.TTyCon(tyCon)) STypeRep(Ast.TTyCon(tyCon))
} }
} }

View File

@ -31,7 +31,6 @@ object SResult {
/** Update interpretation requires access to a contract on the ledger. */ /** Update interpretation requires access to a contract on the ledger. */
final case class SResultNeedContract( final case class SResultNeedContract(
contractId: ContractId, contractId: ContractId,
templateId: TypeConName,
committers: Set[Party], committers: Set[Party],
// Callback // Callback
// returns the next expression to evaluate. // returns the next expression to evaluate.

View File

@ -250,12 +250,12 @@ object SValue {
} }
} }
object SAnyInterface { object SAnyContract {
def apply(tyCon: Ref.TypeConName, record: SRecord): SAny = SAny(TTyCon(tyCon), record) def apply(tyCon: Ref.TypeConName, record: SRecord): SAny = SAny(TTyCon(tyCon), record)
def unapply(any: SAny): Option[(TypeConName, SRecord)] = def unapply(any: SAny): Option[(TypeConName, SRecord)] =
any match { 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) Some(tyCon0, record)
case _ => case _ =>
None None

View File

@ -107,7 +107,8 @@ private[lf] object Speedy {
observers: Set[Party], observers: Set[Party],
key: Option[Node.KeyWithMaintainers], 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) = 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 = { def execute(sv: SValue): Unit = {
machine.withOnLedger("KCacheContract") { onLedger => machine.withOnLedger("KCacheContract") { onLedger =>
val cached = SBuiltin.extractCachedContract(machine, sv) val cached = SBuiltin.extractCachedContract(machine, sv)
machine.checkContractVisibility(onLedger, cid, cached); machine.checkContractVisibility(onLedger, cid, cached)
onLedger.addGlobalContract(cid, cached) onLedger.addGlobalContract(cid, cached)
machine.returnValue = cached.value machine.returnValue = cached.any
} }
} }
} }

View File

@ -723,8 +723,9 @@ class EvaluationOrderTest extends AnyFreeSpec with Matchers with Inside {
Set(alice), Set(alice),
getContract = getWronglyTypedContract, getContract = getWronglyTypedContract,
) )
inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => inside(res) {
msgs shouldBe Seq("starts test") 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)), Array(SParty(alice), SParty(alice)),
Set(alice), Set(alice),
) )
inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => inside(res) {
msgs shouldBe Seq("starts test") 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), Set(alice),
getContract = getWronglyTypedContract, getContract = getWronglyTypedContract,
) )
inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => inside(res) {
msgs shouldBe Seq("starts test") 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)), Array(SParty(alice), SParty(alice)),
Set(alice), Set(alice),
) )
inside(res) { case Success(Left(SErrorDamlException(IE.ContractNotActive(_, T, _)))) => inside(res) {
msgs shouldBe Seq("starts test") case Success(Left(SErrorDamlException(IE.ContractNotActive(_, Dummy, _)))) =>
msgs shouldBe Seq("starts test")
} }
} }

View File

@ -54,7 +54,7 @@ private[speedy] object SpeedyTestLib {
case None => case None =>
throw UnexpectedSResultNeedTime throw UnexpectedSResultNeedTime
} }
case SResultNeedContract(contractId, _, _, callback) => case SResultNeedContract(contractId, _, callback) =>
getContract.lift(contractId) match { getContract.lift(contractId) match {
case Some(value) => case Some(value) =>
callback(value) callback(value)

View File

@ -422,7 +422,7 @@ object ScenarioRunner {
} }
case SResultError(err) => case SResultError(err) =>
SubmissionError(Error.RunnerException(err), enrich(onLedger.incompleteTransaction)) 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 { ledger.lookupContract(coid, committers, readAs, callback) match {
case Left(err) => SubmissionError(err, enrich(onLedger.incompleteTransaction)) case Left(err) => SubmissionError(err, enrich(onLedger.incompleteTransaction))
case Right(_) => go() case Right(_) => go()

View File

@ -99,7 +99,7 @@ class CollectAuthorityState {
callback(value) callback(value)
case ScenarioRunner.SubmissionError(err, _) => crash(s"Submission failed $err") case ScenarioRunner.SubmissionError(err, _) => crash(s"Submission failed $err")
} }
case SResultNeedContract(_, _, _, _) => case SResultNeedContract(_, _, _) =>
crash("Off-ledger need contract callback") crash("Off-ledger need contract callback")
case SResultFinalValue(v) => finalValue = v case SResultFinalValue(v) => finalValue = v
case r => crash(s"bench run: unexpected result from speedy: ${r}") case r => crash(s"bench run: unexpected result from speedy: ${r}")

View File

@ -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 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 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 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 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 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 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 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 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#L854) - 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#L792) - 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#L731) - 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#L868) - 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#L891) - 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#L1125) - 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#L962) - 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#L1035) - 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#L1016) - 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#L1105) - 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#L1181) - 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#L1054) - 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#L1196) - 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#L1259) - 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#L1220) - 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#L1245) - 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#L1493) - 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#L1316) - 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#L1374) - 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#L1301) - 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#L1358) - 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#L1442) - 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#L1511) - 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#L1459) - 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#L1407) - 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#L1635) - 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#L1689) - 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#L1574) - 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#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#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#L1671) - 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#L1722) - 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#L1752) - 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#L1766) - 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#L1738) - 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#L1148) - 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#L1857) - 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#L1926) - 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#L1910) - 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#L1804) - 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#L1839) - 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#L1893) - 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#L1960) - 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#L1990) - 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#L2004) - 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#L1976) - 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 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 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 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 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#L1082) - 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#L920) - 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#L1341) - 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#L1427) - 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#L1279) - 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#L1599) - 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#L1655) - 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#L1530) - 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#L1822) - 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#L1877) - 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#L1784) - 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: 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) - 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) - Exceptions, throw/catch.: [ExceptionTest.scala](daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ExceptionTest.scala#L25)