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

daml script runner fails sooner if provided ledger host lacks a protocol when using the JSON API #19175

Merged
merged 6 commits into from
May 10, 2024
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import java.io.File
import com.daml.lf.data.Ref
import com.daml.ledger.api.tls.{TlsConfiguration, TlsConfigurationCli}

import org.apache.pekko.http.scaladsl.model.Uri

case class RunnerMainConfig(
darPath: File,
runMode: RunnerMainConfig.RunMode,
Expand Down Expand Up @@ -307,6 +309,10 @@ private[script] object RunnerMainConfigIntermediate {
)
} else if (c.isIdeLedger && c.jsonApi) {
failure("Cannot specify --json-api with --ide-ledger, as ide-ledger is run locally.")
} else if (c.jsonApi && c.ledgerHost.exists(host => Uri(host).scheme == "")) {
failure(
"The argument of --ledger-host must include the protocol (e.g. \"http://\" or \"https://\") because --json-api was specified."
)
} else {
success
}
Expand Down
Loading