diff --git a/ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala b/ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala index 389580453f..ec0975f316 100644 --- a/ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala +++ b/ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala @@ -366,14 +366,13 @@ sealed abstract class Queries(tablePrefix: String, tpIdCacheMaxEntries: Long)(im }, fr" OR ", ) - // we effectively shadow Mark because Scala 2.12 doesn't quite get - // that it should use the GADT type equality otherwise - def goQuery[Mark0: Read]( + @nowarn("cat=unused&msg=MarkR in method goQuery.*is never used") // false negative + def goQuery( tpid: Fragment - ): Query0[DBContract[Mark0, JsValue, JsValue, Vector[String]]] = { + )(implicit MarkR: Read[Mark]): Query0[DBContract[Mark, JsValue, JsValue, Vector[String]]] = { val q = query(tpid, queriesCondition) q.query[ - (String, Mark0, Key, Option[String], JsValue, SigsObs, SigsObs, Agreement) + (String, Mark, Key, Option[String], JsValue, SigsObs, SigsObs, Agreement) ].map { case (cid, tpid, rawKey, keyHash, payload, signatories, observers, rawAgreement) => DBContract( contractId = cid, @@ -391,9 +390,9 @@ sealed abstract class Queries(tablePrefix: String, tpIdCacheMaxEntries: Long)(im trackMatchIndices match { case MatchedQueryMarker.ByInt => val tpid = projectedIndex(queries.zipWithIndex, tpidSelector = tpidSelector) - goQuery[MatchedQueries](tpid) + goQuery(tpid) case MatchedQueryMarker.Unused => - goQuery[SurrogateTpId](tpidSelector) + goQuery(tpidSelector) } } diff --git a/ledger-service/http-json-testing/src/main/scala/com/daml/http/util/TestUtil.scala b/ledger-service/http-json-testing/src/main/scala/com/daml/http/util/TestUtil.scala index 984df8ab97..adc8a530ec 100644 --- a/ledger-service/http-json-testing/src/main/scala/com/daml/http/util/TestUtil.scala +++ b/ledger-service/http-json-testing/src/main/scala/com/daml/http/util/TestUtil.scala @@ -11,7 +11,6 @@ import akka.util.ByteString import com.typesafe.scalalogging.LazyLogging import scala.concurrent.{ExecutionContext, Future} -import scala.io.Source import scala.util.{Failure, Success, Try, Using} object TestUtil extends LazyLogging { @@ -29,20 +28,6 @@ object TestUtil extends LazyLogging { file } - def readFile(resourcePath: String): String = - Try { - val source = Source.fromResource(resourcePath) - val content = source.getLines().mkString - source.close - content - } match { - case Success(value) => value - // only needed for Scala 2.12; 2.13 does this itself - case Failure(_: NullPointerException) => - throw new java.io.FileNotFoundException(s"resource '$resourcePath' not found in classpath") - case Failure(ex) => throw ex - } - def getResponseDataBytes(resp: HttpResponse, debug: Boolean = false)(implicit mat: Materializer, ec: ExecutionContext,