Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
remyhaemmerle-da committed Jul 15, 2024
1 parent 12acc75 commit ab054bc
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -705,21 +705,21 @@ class EngineTest(majorLanguageVersion: LanguageMajorVersion)
// FixMe match the proper error
err match {
case Interpretation.DamlException(
interpretation.Error.UnhandledException(_, _)
// interpretation.Error.ContractKeyNotFound(
// GlobalKey.assertBuild(
// templateId = BasicTests_WithKey,
// key = ValueRecord(
// Some(BasicTests_WithKey),
// ImmArray(
// (Some[Ref.Name]("p"), ValueParty(alice)),
// (Some[Ref.Name]("k"), ValueInt64(43)),
// ),
// ),
// packageName = basicTestsPkg.pkgName,
// )
// )
) =>
interpretation.Error.UnhandledException(_, _)
// interpretation.Error.ContractKeyNotFound(
// GlobalKey.assertBuild(
// templateId = BasicTests_WithKey,
// key = ValueRecord(
// Some(BasicTests_WithKey),
// ImmArray(
// (Some[Ref.Name]("p"), ValueParty(alice)),
// (Some[Ref.Name]("k"), ValueInt64(43)),
// ),
// ),
// packageName = basicTestsPkg.pkgName,
// )
// )
) =>
succeed
case _ =>
fail("not the expected error")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,14 @@ private[lf] final class Compiler(
topLevelFunction3(t.ChoiceByKeyDefRef(tmplId, choice.name)) {
(keyPos, choiceArgPos, tokenPos, env) =>
let(env, translateKeyWithMaintainers(env, keyPos, tmplKey)) { (keyWithMPos, env) =>
let(env, SBUFetchKey(tmplId)(s.SEValue(SInt64(1)), env.toSEVar(keyWithMPos))) { (cidPos, env) =>
translateChoiceBody(env, tmplId, tmpl, choice)(
choiceArgPos,
cidPos,
Some(keyWithMPos),
tokenPos,
)
let(env, SBUFetchKey(tmplId)(s.SEValue(SInt64(1)), env.toSEVar(keyWithMPos))) {
(cidPos, env) =>
translateChoiceBody(env, tmplId, tmpl, choice)(
choiceArgPos,
cidPos,
Some(keyWithMPos),
tokenPos,
)
}
}
}
Expand Down Expand Up @@ -983,13 +984,14 @@ private[lf] final class Compiler(
// in <mbCid>
topLevelFunction3(t.LookupByKeyDefRef(tmplId)) { (nPos, keyPos, _, env) =>
let(env, translateKeyWithMaintainers(env, keyPos, tmplKey)) { (keyWithMPos, env) =>
let(env, SBULookupKey(tmplId)(env.toSEVar(nPos), env.toSEVar(keyWithMPos))) { (maybeCidPos, env) =>
let(
env,
SBUInsertLookupNode(tmplId)(env.toSEVar(keyWithMPos), env.toSEVar(maybeCidPos)),
) { (_, env) =>
env.toSEVar(maybeCidPos)
}
let(env, SBULookupKey(tmplId)(env.toSEVar(nPos), env.toSEVar(keyWithMPos))) {
(maybeCidPos, env) =>
let(
env,
SBUInsertLookupNode(tmplId)(env.toSEVar(keyWithMPos), env.toSEVar(maybeCidPos)),
) { (_, env) =>
env.toSEVar(maybeCidPos)
}
}
}
}
Expand All @@ -1013,17 +1015,18 @@ private[lf] final class Compiler(
// in { contractId: ContractId Foo, contract: Foo }
topLevelFunction3(t.FetchByKeyDefRef(tmplId)) { (nPos, keyPos, tokenPos, env) =>
let(env, translateKeyWithMaintainers(env, keyPos, tmplKey)) { (keyWithMPos, env) =>
let(env, SBUFetchKey(tmplId)(env.toSEVar(nPos), env.toSEVar(keyWithMPos))) { (cidPos, env) =>
let(
env,
translateFetchTemplateBody(env, tmplId)(
cidPos,
Some(keyWithMPos),
tokenPos,
),
) { (contractPos, env) =>
Tuple2(env.toSEVar(cidPos), env.toSEVar(contractPos))
}
let(env, SBUFetchKey(tmplId)(env.toSEVar(nPos), env.toSEVar(keyWithMPos))) {
(cidPos, env) =>
let(
env,
translateFetchTemplateBody(env, tmplId)(
cidPos,
Some(keyWithMPos),
tokenPos,
),
) { (contractPos, env) =>
Tuple2(env.toSEVar(cidPos), env.toSEVar(contractPos))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,6 @@ abstract class EvaluationOrderTest(languageVersion: LanguageVersion)
}
}


// FixMe nuck
"fetch_by_key" ignore {

Expand Down
Loading

0 comments on commit ab054bc

Please sign in to comment.