Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved com.daml.platform.sandbox to com.daml.ledger.sandbox in SoX #12675

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ledger/daml-on-sql/src/main/scala/on/sql/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
package com.daml.on.sql

import java.util.concurrent.Executors
import com.daml.ledger.resources.ResourceContext
import com.daml.cliopts.GlobalLogLevel
import com.daml.ledger.resources.ResourceContext
import com.daml.ledger.sandbox.SandboxServer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest putting these imports in their alphabetic place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I usually let IJ do its magic. Looking forward to us implementing a automagic tool part of the fmt process

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @mziolekda

import com.daml.platform.sandbox.config.{PostgresStartupMode, SandboxConfig}
import com.daml.platform.sandbox.SandboxServer
import com.daml.resources.ProgramResource

import scala.concurrent.ExecutionContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import scala.annotation.nowarn
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ExecutionContext, Future}

private[platform] class FlywayMigrations(
private[daml] class FlywayMigrations(
jdbcUrl: String,
additionalMigrationPaths: Seq[String] = Seq.empty,
)(implicit resourceContext: ResourceContext, loggingContext: LoggingContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package com.daml.sandbox

import com.daml.cliopts.GlobalLogLevel
import com.daml.ledger.resources.ResourceContext
import com.daml.platform.sandbox.SandboxServer
import com.daml.ledger.sandbox.SandboxServer
import com.daml.platform.sandbox.config.LedgerName
import com.daml.resources.ProgramResource

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml.platform.sandbox
package com.daml.ledger.sandbox

import com.daml.caching
import com.daml.ledger.participant.state.kvutils.app._
import com.daml.ledger.sandbox.{BridgeConfig, BridgeConfigProvider}
import com.daml.lf.language.LanguageVersion
import com.daml.platform.common.LedgerIdMode
import com.daml.platform.sandbox.config.SandboxConfig.EngineMode
Expand All @@ -16,7 +15,7 @@ import scala.jdk.DurationConverters._
object ConfigConverter {
private val DefaultH2SandboxJdbcUrl = "jdbc:h2:mem:sandbox;db_close_delay=-1"

def toSandboxOnXConfig(
private[sandbox] def toSandboxOnXConfig(
sandboxConfig: SandboxConfig,
maybeLedgerId: Option[String],
ledgerName: LedgerName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml.platform.sandbox
package com.daml.ledger.sandbox

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml.platform.sandbox
package com.daml.ledger.sandbox

import akka.actor.ActorSystem
import akka.stream.Materializer
Expand All @@ -11,16 +11,16 @@ import com.daml.ledger.participant.state.kvutils.app.Config
import com.daml.ledger.participant.state.v2.WriteService
import com.daml.ledger.resources
import com.daml.ledger.resources.{Resource, ResourceContext, ResourceOwner}
import com.daml.ledger.sandbox.{BridgeConfig, SandboxOnXRunner}
import com.daml.ledger.sandbox.SandboxServer._
import com.daml.lf.archive.DarParser
import com.daml.lf.data.Ref
import com.daml.logging.LoggingContext.{newLoggingContext, newLoggingContextWith}
import com.daml.logging.{ContextualizedLogger, LoggingContext}
import com.daml.metrics.{Metrics, MetricsReporting}
import com.daml.platform.apiserver.ApiServer
import com.daml.platform.sandbox.SandboxServer._
import com.daml.platform.sandbox.banner.Banner
import com.daml.platform.sandbox.config.{LedgerName, SandboxConfig}
import com.daml.platform.sandbox.logging
import com.daml.platform.server.api.validation.ErrorFactories
import com.daml.platform.store.{FlywayMigrations, IndexMetadata}
import com.daml.ports.Port
Expand Down Expand Up @@ -55,7 +55,7 @@ final class SandboxServer(
)

// Only used in testing; hopefully we can get rid of it soon.
private[sandbox] val port =
val port =
Await.result(apiServerResource.asFuture.map(_.port)(ExecutionContext.parasitic), AsyncTolerance)

override def close(): Unit = Await.result(apiServerResource.release(), AsyncTolerance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.daml.ledger.api.v1.command_service.SubmitAndWaitRequest
import com.daml.ledger.api.v1.commands.{Command, Commands, CreateCommand}
import com.daml.ledger.api.v1.value.{Identifier, Record, RecordField, Value}
import com.daml.ledger.resources.TestResourceContext
import com.daml.ledger.sandbox.SandboxServer
import com.daml.lf.language.LanguageVersion
import com.daml.platform.apiserver.SeedService.Seeding
import com.daml.platform.apiserver.services.GrpcClientResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ package com.daml.platform.sandbox.fixture

import com.daml.ledger.api.testing.utils.{OwnedResource, Resource, SuiteResource}
import com.daml.ledger.resources.{ResourceContext, ResourceOwner}
import com.daml.ledger.sandbox.SandboxServer
import com.daml.platform.apiserver.services.GrpcClientResource
import com.daml.platform.sandbox.config.SandboxConfig
import com.daml.platform.sandbox.{AbstractSandboxFixture, SandboxServer}
import com.daml.platform.sandbox.AbstractSandboxFixture
import com.daml.ports.Port
import io.grpc.Channel
import org.scalatest.Suite
import scala.concurrent.duration._

import scala.concurrent.duration._
import java.time.Duration

trait SandboxFixture extends AbstractSandboxFixture with SuiteResource[(SandboxServer, Channel)] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import java.util.concurrent.Executors
import com.daml.ledger.api.domain.LedgerId
import com.daml.ledger.api.testing.utils.{OwnedResource, Resource}
import com.daml.ledger.resources.{ResourceContext, ResourceOwner}
import com.daml.ledger.sandbox.SandboxServer
import com.daml.lf.archive.UniversalArchiveReader
import com.daml.lf.data.Ref
import com.daml.platform.apiserver.services.GrpcClientResource
import com.daml.platform.common.LedgerIdMode
import com.daml.platform.sandbox.SandboxServer
import com.daml.platform.sandbox.config.SandboxConfig
import com.daml.platform.services.time.TimeProviderType.Static
import com.daml.ports.Port
Expand Down