Port the rest //daml-lf/... to Scala 2.13 (#8436)

* Port the rest //daml-lf/... to Scala 2.13

Draw the rest of the owl

changelog_begin
changelog_end

* Update daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/DamlLfEncoder.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
This commit is contained in:
Moritz Kiefer 2021-01-08 10:38:17 +01:00 committed by GitHub
parent 7bae2be354
commit 0af4f522c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 119 additions and 80 deletions

View File

@ -219,9 +219,11 @@ def _wrap_rule(
**kwargs
)
def _wrap_rule_no_plugins(rule, scalacopts = [], **kwargs):
def _wrap_rule_no_plugins(rule, deps = [], scala_deps = [], versioned_scala_deps = {}, scalacopts = [], **kwargs):
deps = deps + ["{}_{}".format(d, scala_major_version_suffix) for d in scala_deps + versioned_scala_deps.get(scala_major_version, [])]
rule(
scalacopts = common_scalacopts + scalacopts,
deps = deps,
**kwargs
)

View File

@ -164,9 +164,14 @@ jobs:
- bash: |
set -euo pipefail
eval "$(./dev-env/bin/dade-assist)"
bazel build --config scala_2_13 -- //libs-scala/... //daml-lf/data/... //daml-lf/language/... //daml-lf/transaction/... //daml-lf/validation/... //daml-lf/parser/... //daml-lf/interpreter/...
# gatling-utils tests fail with a ClassNotFoundException for scala.collection.SeqLike
bazel test --config scala_2_13 -- //libs-scala/... //daml-lf/data/... //daml-lf/language/... //daml-lf/transaction/... //daml-lf/validation/... //daml-lf/parser/... //daml-lf/interpreter/... -//libs-scala/gatling-utils/...
bazel build --config scala_2_13 -- \
//libs-scala/... \
//daml-lf/...
# gatling-utils tests fail with a ClassNotFoundException for scala.collection.SeqLike
bazel test --config scala_2_13 -- \
//libs-scala/... \
//daml-lf/... \
-//libs-scala/gatling-utils/...
displayName: 'Build'
- template: tell-slack-failed.yml
parameters:

View File

@ -131,7 +131,17 @@ da_scala_test_suite(
":daml_lf_1.7_archive_proto_srcs",
":daml_lf_1.8_archive_proto_srcs",
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatest_scalatest",
"@maven//:org_scalatestplus_scalacheck_1_14",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scalaz_scalaz_scalacheck_binding",
],
scalacopts = lf_scalacopts,
versioned_scala_deps = {
"2.12": ["@maven//:org_scala_lang_modules_scala_collection_compat"],
},
deps = [
":daml_lf_1.11_archive_proto_java",
":daml_lf_1.6_archive_proto_java",
@ -145,11 +155,6 @@ da_scala_test_suite(
"//daml-lf/transaction",
"//libs-scala/scalatest-utils",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalatestplus_scalacheck_1_14_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_scalaz_scalaz_scalacheck_binding_2_12",
],
)
@ -159,6 +164,10 @@ da_scala_test_suite(
data = [
":DarReaderTest.dar",
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatestplus_scalacheck_1_14",
],
scalacopts = lf_scalacopts,
deps = [
":daml_lf_1.11_archive_proto_java",
@ -170,8 +179,6 @@ da_scala_test_suite(
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalatestplus_scalacheck_1_14_2_12",
],
)

View File

@ -15,7 +15,7 @@ import org.scalatest.Assertion
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
class ProtoTest extends AnyWordSpec with Matchers with TableDrivenPropertyChecks {

View File

@ -12,7 +12,7 @@ import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
class DarReaderTest
extends AnyWordSpec
@ -37,7 +37,7 @@ class DarReaderTest
forAll(dar.all) {
case ((packageId, archive), ver) =>
packageId shouldNot be('empty)
packageId shouldNot be(Symbol("empty"))
archive.getDamlLf1.getModulesCount should be > 0
ver should be(LanguageMajorVersion.V1)
}
@ -61,7 +61,7 @@ class DarReaderTest
mainArchiveInternedDotted,
mainArchiveInternedStrings,
t.getNameInternedDname))
actualTypes should contain allOf ("Transfer", "Call2", "CallablePayout", "PayOut")
actualTypes should contain.allOf("Transfer", "Call2", "CallablePayout", "PayOut")
}
forExactly(1, dar.dependencies) {
@ -87,8 +87,8 @@ class DarReaderTest
}
private def internedName(
internedDotted: Seq[DamlLf1.InternedDottedName],
internedStrings: Seq[String],
internedDotted: collection.Seq[DamlLf1.InternedDottedName],
internedStrings: collection.Seq[String],
n: Int): String = {
internedDotted(n).getSegmentsInternedStrList.asScala.map(i => internedStrings(i)).mkString(".")
}

View File

@ -19,7 +19,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.Ordering.Implicits.infixOrderingOps
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success, Try}
class DecodeV1Spec

View File

@ -8,7 +8,7 @@ import com.daml.lf.language.{Ast, TypeOrdering}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
class TypeOrderingSpec extends AnyWordSpec with Matchers {

View File

@ -29,6 +29,9 @@ da_scala_library(
["src/main/**/*.scala"],
exclude = ["src/main/scala/com/digitalasset/daml/lf/archive/testing/DamlLfEncoder.scala"],
),
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts,
visibility = [
"//daml-lf:__subpackages__",
@ -40,7 +43,6 @@ da_scala_library(
"//daml-lf/data",
"//daml-lf/language",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)
@ -49,7 +51,16 @@ da_scala_test_suite(
size = "small",
srcs = glob(["src/test/scala/**/*.scala"]),
data = [":testing-dar-%s" % target for target in lf_targets],
scala_deps = [
"@maven//:org_scalatest_scalatest",
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts,
versioned_scala_deps = {
"2.12": [
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
},
deps = [
":encoder",
"//bazel_tools/runfiles:scala_runfiles",
@ -60,8 +71,6 @@ da_scala_test_suite(
"//daml-lf/parser",
"//daml-lf/validation",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)

View File

@ -16,7 +16,6 @@ import com.daml.lf.validation.Validation
import scala.Ordering.Implicits.infixOrderingOps
import scala.annotation.tailrec
import scala.collection.breakOut
import scala.io.Source
import scala.util.control.NonFatal
@ -52,7 +51,7 @@ private[daml] object DamlLfEncoder extends App {
}
private def readSources(files: Seq[String]): String =
files.flatMap(file => Source.fromFile(Paths.get(file).toFile, "UTF8"))(breakOut)
files.view.flatMap(file => Source.fromFile(Paths.get(file).toFile, "UTF8")).mkString
private def makeArchive(source: String)(
implicit parserParameters: ParserParameters[this.type]) = {

View File

@ -13,7 +13,7 @@ import org.scalatest.prop.TableDrivenPropertyChecks
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.language.implicitConversions
class DamlLfEncoderTest
@ -64,7 +64,7 @@ class DamlLfEncoderTest
UniversalArchiveReader()
.readFile(new File(rlocation(s"daml-lf/encoder/test-$version.dar")))
dar shouldBe 'success
dar shouldBe Symbol("success")
val findModules = dar.toOption.toList.flatMap(getNonEmptyModules).toSet

View File

@ -199,12 +199,12 @@ class ContractDiscriminatorFreshnessCheckSpec
)
forAll(negativeTestCases) { cmd =>
run(cmd) shouldBe 'right
run(cmd) shouldBe a[Right[_, _]]
}
forAll(positiveTestCases) { cmd =>
val r = run(cmd)
r shouldBe 'left
r shouldBe a[Left[_, _]]
r.left.exists(_.msg.contains("Conflicting discriminators")) shouldBe true
}
@ -270,12 +270,12 @@ class ContractDiscriminatorFreshnessCheckSpec
)
forAll(negativeTestCases) { cmd =>
Right(cmd) shouldBe 'right
Right(cmd) shouldBe a[Right[_, _]]
}
forAll(positiveTestCases) { cmd =>
val r = run(cmd)
r shouldBe 'left
r shouldBe a[Left[_, _]]
r.left.exists(_.msg.contains("Conflicting discriminators")) shouldBe true
}

View File

@ -94,8 +94,8 @@ class EngineTest
ValueRecord(
Some(BasicTests_WithKey),
ImmArray(
(Some("p"), ValueParty(alice)),
(Some("k"), ValueInt64(42))
(Some[Ref.Name]("p"), ValueParty(alice)),
(Some[Ref.Name]("k"), ValueInt64(42))
))),
""
)
@ -187,7 +187,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
@ -199,7 +199,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"not translate create commands argument wrong label" in {
@ -212,7 +212,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'left
res shouldBe a[Left[_, _]]
}
"translate exercise commands argument including labels" in {
@ -227,7 +227,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"translate exercise commands argument without labels" in {
@ -242,7 +242,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"translate exercise-by-key commands with argument with labels" in {
@ -257,7 +257,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"translate exercise-by-key commands with argument without labels" in {
@ -272,7 +272,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"not translate exercise-by-key commands with argument with wrong labels" in {
@ -328,7 +328,9 @@ class EngineTest
id,
ValueRecord(
Some(Identifier(basicTestsPkgId, "BasicTests:CallablePayout")),
ImmArray((Some("giver"), ValueParty(clara)), (Some("receiver"), ValueParty(clara)))
ImmArray(
(Some[Ref.Name]("giver"), ValueParty(clara)),
(Some[Ref.Name]("receiver"), ValueParty(clara)))
),
"Transfer",
ValueRecord(None, ImmArray((Some[Name]("newReceiver"), ValueParty(clara))))
@ -337,7 +339,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
@ -356,7 +358,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"not translate create-and-exercise commands argument wrong label in create arguments" in {
@ -366,7 +368,9 @@ class EngineTest
id,
ValueRecord(
Some(Identifier(basicTestsPkgId, "BasicTests:CallablePayout")),
ImmArray((None, ValueParty(clara)), (Some("this_is_not_the_one"), ValueParty(clara)))
ImmArray(
(None, ValueParty(clara)),
(Some[Ref.Name]("this_is_not_the_one"), ValueParty(clara)))
),
"Transfer",
ValueRecord(None, ImmArray((None, ValueParty(clara))))
@ -375,7 +379,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'left
res shouldBe a[Left[_, _]]
}
"not translate create-and-exercise commands argument wrong label in choice arguments" in {
@ -393,7 +397,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'left
res shouldBe a[Left[_, _]]
}
"translate Optional values" in {
@ -435,7 +439,7 @@ class EngineTest
TTyConApp(id, ImmArray.empty),
wrongRecord
)
.consume(lookupContract, lookupPackage, lookupKey) shouldBe 'left
.consume(lookupContract, lookupPackage, lookupKey) shouldBe a[Left[_, _]]
}
}
@ -448,13 +452,13 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
val interpretResult = engine
.submit(Set(party), Commands(ImmArray(command), let, "test"), participant, submissionSeed)
.consume(lookupContract, lookupPackage, lookupKey)
"be translated" in {
interpretResult shouldBe 'right
interpretResult shouldBe a[Right[_, _]]
}
"reinterpret to the same result" in {
@ -528,7 +532,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(cmd))
.consume(lookupContract, lookupPackage, lookupKey)
withClue("Preprocessing result: ")(res shouldBe 'right)
withClue("Preprocessing result: ")(res shouldBe a[Right[_, _]])
engine
.submit(actAs, Commands(ImmArray(cmd), let, "test"), participant, submissionSeed)
@ -538,7 +542,7 @@ class EngineTest
"be translated" in {
forAll(cases) {
case (templateId, signatories, submitters) =>
interpretResult(templateId, signatories, submitters) shouldBe 'right
interpretResult(templateId, signatories, submitters) shouldBe a[Right[_, _]]
}
}
@ -628,7 +632,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
val interpretResult =
res
.flatMap {
@ -707,7 +711,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
"fail at submission" in {
val submitResult = engine
@ -732,7 +736,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
val result =
res
.flatMap {
@ -797,7 +801,7 @@ class EngineTest
case (id, _: Node.NodeExercises[_, _]) => id
}
val actualNodes = byKeyNodes(tx)
actualNodes shouldBe 'nonEmpty
actualNodes shouldBe Symbol("nonEmpty")
actualNodes shouldBe expectedNodes.toSet
}
}
@ -805,7 +809,7 @@ class EngineTest
"exercise-by-key" should {
val seed = hash("exercise-by-key")
val now = Time.Timestamp.now
val now = Time.Timestamp.now()
"crash if use a contract key with an empty set of maintainers" in {
val templateId =
@ -843,7 +847,7 @@ class EngineTest
"fecth-by-key" should {
val seed = hash("fetch-by-key")
val now = Time.Timestamp.now
val now = Time.Timestamp.now()
"crash if use a contract key with an empty set of maintainers" in {
val templateId =
@ -926,7 +930,7 @@ class EngineTest
val res = preprocessor
.preprocessCommands(ImmArray(command))
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
val interpretResult =
res
.flatMap {
@ -1019,7 +1023,8 @@ class EngineTest
TTyConApp(TypeConName(basicTestsPkgId, "BasicTests:Nesting0"), ImmArray.empty),
nested)
.consume(lookupContract, lookupPackage, lookupKey)
.left
.swap
.toOption
.get
.msg should include("Provided value exceeds maximum nesting level")
}
@ -1048,7 +1053,7 @@ class EngineTest
TTyConApp(Identifier(basicTestsPkgId, "BasicTests:MyNestedRec"), ImmArray.empty),
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"work with fields with type parameters" in {
@ -1067,7 +1072,7 @@ class EngineTest
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"work with fields with labels, in the wrong order" in {
@ -1086,7 +1091,7 @@ class EngineTest
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"fail with fields with labels, with repetitions" in {
@ -1103,7 +1108,7 @@ class EngineTest
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'left
res shouldBe a[Left[_, _]]
}
"work with fields without labels, in right order" in {
@ -1120,7 +1125,7 @@ class EngineTest
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'right
res shouldBe a[Right[_, _]]
}
"fail with fields without labels, in the wrong order" in {
@ -1137,7 +1142,7 @@ class EngineTest
rec)
.consume(lookupContract, lookupPackage, lookupKey)
res shouldBe 'left
res shouldBe a[Left[_, _]]
}
}
@ -1490,7 +1495,7 @@ class EngineTest
.reinterpret(Set(alice), fetchNode, None, let, let)
.consume(lookupContract, lookupPackage, lookupKey)
reinterpreted shouldBe 'right
reinterpreted shouldBe a[Right[_, _]]
}
}
@ -1550,7 +1555,7 @@ class EngineTest
case (id, _: Node.NodeLookupByKey[_]) => id
}
val actualByKeyNodes = byKeyNodes(tx)
actualByKeyNodes shouldBe 'nonEmpty
actualByKeyNodes shouldBe Symbol("nonEmpty")
actualByKeyNodes shouldBe expectedByKeyNodes.toSet
}
@ -1824,7 +1829,7 @@ class EngineTest
txMeta,
let,
lookupPackage,
) shouldBe 'right
) shouldBe a[Right[_, _]]
}
}
@ -1864,7 +1869,7 @@ class EngineTest
globalCids = globalCids,
)
.consume(_ => None, lookupPackage, lookupKey)
result shouldBe 'right
result shouldBe a[Right[_, _]]
}
"be evaluated after ensure clause" in {
@ -1891,7 +1896,7 @@ class EngineTest
globalCids = globalCids,
)
.consume(_ => None, lookupPackage, lookupKey)
result shouldBe 'left
result shouldBe a[Left[_, _]]
val Left(err) = result
err.msg should not include ("Boom")
err.msg should include("precondition violation")

View File

@ -11,7 +11,16 @@ da_scala_binary(
srcs = glob(["src/main/**/*.scala"]),
main_class = "com.daml.lf.speedy.testing.Main",
max_heap_size = "8g",
scala_deps = [
"@maven//:org_typelevel_paiges_core",
],
tags = ["maven_coordinates=com.daml:daml-lf-repl:__VERSION__"],
versioned_scala_deps = {
"2.12": [
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
},
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_archive_reader",
@ -25,7 +34,5 @@ da_scala_binary(
"//daml-lf/validation",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_jline_jline",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_typelevel_paiges_core_2_12",
],
)

View File

@ -28,8 +28,8 @@ import org.jline.reader.impl.completer.{AggregateCompleter, ArgumentCompleter, S
import org.jline.reader.impl.history.DefaultHistory
import scala.collection.immutable.ListMap
import scala.collection.JavaConverters._
import scala.concurrent.duration.Duration
import scala.jdk.CollectionConverters._
object Main extends App {
// idempotent; force stdout to output in UTF-8 -- in theory it should pick it up from
@ -112,7 +112,7 @@ object Repl {
state = dispatch(state, line)
}
} catch {
case _: org.jline.reader.EndOfFileException => Unit
case _: org.jline.reader.EndOfFileException => ()
}
state.history.save
}
@ -431,7 +431,8 @@ object Repl {
state.scenarioRunner.compilerConfig))
defs.get(idToRef(state, args(0))) match {
case None =>
println("Error: definition '" + args(0) + "' not found. Try :list."); usage
println("Error: definition '" + args(0) + "' not found. Try :list.")
usage()
case Some(defn) =>
println(Pretty.SExpr.prettySExpr(0)(defn.body).render(80))
}
@ -458,14 +459,14 @@ object Repl {
lookup(state, id) match {
case None =>
println("Error: definition '" + id + "' not found. Try :list.")
usage
usage()
case Some(DValue(_, _, body, _)) =>
val expr = argExprs.foldLeft(body)((e, arg) => EApp(e, arg))
val compiledPackages = PureCompiledPackages(state.packages).right.get
val compiledPackages = PureCompiledPackages(state.packages).toOption.get
val machine = Speedy.Machine.fromPureExpr(compiledPackages, expr)
val startTime = System.nanoTime()
val valueOpt = machine.run match {
val valueOpt = machine.run() match {
case SResultError(err) =>
println(prettyError(err).render(128))
None

View File

@ -35,6 +35,9 @@ da_scala_test_suite(
name = "scenario-interpreter_tests",
size = "small",
srcs = glob(["src/test/**/*.scala"]),
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts,
deps = [
":scenario-interpreter",
@ -42,7 +45,6 @@ da_scala_test_suite(
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/transaction",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)
@ -59,6 +61,9 @@ da_scala_benchmark_jmh(
":CollectAuthority.dar",
":CollectAuthority.dar.pp",
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
],
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
@ -69,7 +74,6 @@ da_scala_benchmark_jmh(
"//daml-lf/language",
"//daml-lf/transaction",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)

View File

@ -15,7 +15,7 @@ class ScenarioRunnerTest extends AsyncWordSpec with Matchers with ScalaFutures {
"ScenarioRunner" can {
"mangle party names correctly" in {
val compiledPackages = PureCompiledPackages(Map.empty).right.get
val compiledPackages = PureCompiledPackages(Map.empty).toOption.get
val e = Ast.EScenario(Ast.ScenarioGetParty(Ast.EPrimLit(Ast.PLText("foo-bar"))))
val txSeed = crypto.Hash.hashPrivateKey("ScenarioRunnerTest")
val m = Speedy.Machine.fromScenarioExpr(