Commit Graph

2625 Commits

Author SHA1 Message Date
Stefano Baghino
36da75e1d6
Add authentication support to Java command completion client (#3713)
* Add authentication support to Java command completion client

* Address https://github.com/digital-asset/daml/pull/3713#discussion_r353629606
2019-12-04 11:31:21 +01:00
Stefano Baghino
8d5b4af0f2
Add support for authentication to Java time client (#3721) 2019-12-04 11:00:30 +01:00
Stefano Baghino
8eb5956f31
Add support for authentication to Java package client (#3720) 2019-12-04 10:42:48 +01:00
Moritz Kiefer
808e44d48d
Avoid running navigator from a temporary directory in daml ledger navigator (#3718)
This makes sure that navigator picks up things such as
`frontend-config.js` which is needed for custom tabs.

To get there, this PR does two things:

1. Change navigator such that it prefers a config file specified
explicitly via -c over the SDK config file.
2. Change daml-helper to pass in the config file via -c instead of
changing the directory

CHANGELOG_BEGIN

- [DAML Assistant] ``daml ledger navigator`` now loads
``frontend-config.js`` properly.

- [Navigator] Explicit config files passed via ``-c`` are preferred
over ``daml.yaml``.

CHANGELOG_END
2019-12-04 10:36:31 +01:00
Oliver Seeliger
ca47e815f1
Upgrade Canton to 0.5.0 with flaky test fix (#3724)
This release contains a canton flakiness fix to prevent the
occurrence of `Disputed: Failed to select first domain: The
following parti(es) are not available on any connected domain`
during SemanticTest runs.
2019-12-04 10:17:14 +01:00
Stefano Baghino
de0c3db1a1
Restore optional endpoints but adds check (#3722)
* Revert "ledger-api-test-tool: The endpoints are mandatory. (#3611)"

This reverts commit 603ee9367b.

* Restore LedgerTestContext requirement

* Exit early if there are no participants to test
2019-12-04 10:14:59 +01:00
nickchapman-da
d15b0c7538
Add support for type-synonyms in DAML-LF .proto and Haskell AST (#3703)
* Add support for type-synonyms in DAML-LF .proto and Haskell AST

* address review comments
2019-12-03 14:51:02 +00:00
Martin Huschenbett
054fcd22f2 Remove component version from damlc output (#3709)
The component version is a relic from before we went to a mono repo.
It's completely useless now.
2019-12-03 14:06:49 +00:00
Moritz Kiefer
22dc87b7f0
Support CreateAndExercise in DAML script (#3712)
CHANGELOG_BEGIN

- [DAML Script - Experimental] Add createAndExerciseCmd matching the
Ledger API command of the same name.

CHANGELOG_END
2019-12-03 14:46:45 +01:00
Moritz Kiefer
e4cfc3f8f7 Fix RST in DAML script docs (#3711)
RST doesn’t like having a word character after an inline code block.
2019-12-03 10:27:32 +00:00
associahedron
b275a5f40a Use surface names for type variables, instead of uniques. (#3702)
* Use surface names instead of unique names

* Reviewer comments
2019-12-03 09:40:04 +00:00
Moritz Kiefer
5a3b5f498a Fix SDK versions in trigger and daml-script dars (#3706)
* Fix SDK versions in trigger and daml-script dars

* Fix SDK versions in tests
2019-12-03 07:28:49 +00:00
Leonid Shlyapnikov
8124569cc6 Error handling improvements (#3705)
* Error handling improvements,

partitioning the Soruce[Error \/ JsValue], folding all errors and
producing the final status and errors element based on the above fold

* Test case + fixes,

for some reason GeneratorDrivenPropertyChecks does not like AsyncFreeSpec

* changing the order of elements in the response,

would be better if we were checking the JSON objects not JSON strings.
2019-12-03 01:26:37 +00:00
Leonid Shlyapnikov
e6ff9a6766
Fixing the GET contracts/search endpoint, (#3700)
* Fixing the GET contracts/search endpoint,

Returning all active contracts for all known templates, skipping the
query store persistence.

* minor cleanup
2019-12-02 12:56:06 -05:00
Martin Huschenbett
7d1068b69d
daml2ts: Avoid 'unused definition' warning for modules without templates (#3698)
We only use the `templateId` function in a module only when the module
contains at least one template definition. Thus, we don't generate it if
there are no modules. That's the only functional change. The other changes
are due to the fact that we want better readability of the code.
2019-12-02 18:21:22 +01:00
Moritz Kiefer
5a46777855
Fix pattern matching example (#3697) 2019-12-02 17:20:25 +01:00
Oliver Seeliger
c1319451bf Fix submissionId typo in JdbcLedgerDao logging parameter (#3679) 2019-12-02 15:55:30 +00:00
associahedron
608a820c26
Remove generic template support from damldocs (#3693) 2019-12-02 15:08:06 +00:00
associahedron
e696c34fc0
Let damlc docs see build-options. (#3695)
CHANGELOG_BEGIN

- [DAML SDK] ``damlc docs`` now takes into account the project's ``build-options`` from ``daml.yaml``.

CHANGELOG_END
2019-12-02 15:07:15 +00:00
Martin Huschenbett
6e6614ae56 daml2ts: Use monoTraverse to collect modules refs in types (#3690)
This was suggested by @corcreature on a previous PR.
2019-12-02 14:56:22 +00:00
Moritz Kiefer
f5605247b3
Include type synonyms in LF abstract syntax (#3694)
* Include type synonyms in LF abstract syntax

* Use T instead of S for synonyms

Following a suggestion from @remyhaemmerle-da, we avoid having to
adapt all rules to synonyms by simply reusing the definition of type
constructors.
2019-12-02 15:20:38 +01:00
Martin Huschenbett
712231c963 daml2ts: Don't produce unused imports (#3689)
Instead of importing _all_ other modules referenced from a module, only
import those that are actually referenced from the generated code. First,
this produces less noise within each generated file. Second and probably
more important, this allows for not generating files without any actual
definition at all.

https://github.com/digital-asset/davl/pull/81 demonstrates the effect of
this change on DAVL.
2019-12-01 11:38:56 +00:00
Moritz Kiefer
4a5d07fccb Expose keys and values function from DA.Map (#3684)
fixes #2759
2019-12-01 11:49:23 +01:00
Moritz Kiefer
de28191e54 Remove unused fields from LF conversion env (#3683)
These fields were used for generic templates so they are no longer
needed.
2019-12-01 11:34:01 +01:00
Moritz Kiefer
3205e05d42 Update docs for coerceContractId (#3686)
I’ve gone through references to generic templates in our codebase to
see what else we can drop. In this case, we are still using
coerceContractId so I’ve updated the comment to explain the current
usecase.
2019-12-01 09:19:45 +01:00
Remy
f0fdac7260 DAML-LF: fix generation of archive proto tarball (#3685) 2019-11-30 12:46:41 +00:00
Moritz Kiefer
4eceda8364 Remove special treatment of generic template type synonyms (#3681) 2019-11-29 16:09:23 +00:00
Moritz Kiefer
e4c61ae8b9 Remove check for generic templates (#3680)
We now reject these in the parser so there is no point in keeping this
in the preprocessor.
2019-11-29 15:58:27 +00:00
Martin Huschenbett
ea89dbb122 Don't make UndecidableSuperClasses a default extension for DAML (#3673)
We needed this for our generic template hacks. Since they are gone now,
I'm very much in favour of removing this extension since "undecidable"
always sounds a bit scary, even if it is only at compile time.

CHANGELOG_BEGIN

- [DAML Compiler] Don't make `UndecidableSuperClasses` a default language
  extension for DAML anymore. If you really need this feature for a module,
  you can reenable it using a `LANGUAGE` pragma at the top.

CHANGELOG_END
2019-11-29 15:51:40 +00:00
Moritz Kiefer
75c9b1bf91
Simplify template desugaring (#3670)
* Introduce a simpler template desugaring without support for generic templates

This adapts the LF conversion to the new template desugaring
introduced in our GHC fork. The guiding principle is that we use the
typeclasses directly to avoid generating, typechecking and converting
redundant code caused by indirections. I updated the template
desugaring documentation so that is probably a good starting point for
reviewing this.

* Address review comments

* Fix daml doc tests

* Fix data dependency tests

* Switch to new ghc-lib release
2019-11-29 16:13:15 +01:00
Samir Talwar
5dd38d54e8 sandbox: PostgreSQL health checks. (#3655)
* ledger-api-test-tool: Increase the duration when watching health.

This should hopefully stop CI from flaking out.

* reference-v2/sandbox: Avoid unnecessary companion object constructors.

I like indirection… when it does something.

* ledger: Propagate empty health checks throughout the services.

* reference: Remove duplication from the ReferenceServer object.

* ledger-api-common: Actually query a "reporter" in the health service.

* ledger-api-common: Report health per-component when required.

* ledger-api-health: Use a Map to represent components for health checks.

* sandbox: Fix warnings in SqlLedgerSpec.

* ledger-api-common: Throw GrpcHealthService errors inside the Future.

* ledger: Implement health checks against the PostgreSQL connection.

Without proper testing, because I am not great at this.

* sandbox: Remove duplication and fix warnings in PostgresAround.

* sandbox: Test the SQL Ledger's health reporting on failure.

* sandbox: Don't report as unhealthy until 3 connections fail.

* ledger-api-health: Remove unused parts of the API.

Bit of premature design there.

* sandbox: Rename the "ledger" health check to "write".

* participant-state: Add the ReportsHealth trait to ReadService.

* ledger-api-common: `Future.fromTry(Try(…))` -> `Future(…)`.

* ledger-api-common: Make it clearer that StubReporter closes over health.

* ledger-api-common: Explain the HealthService watch tests with comments.

* sandbox: Clean up SqlLedger a bit.

* sandbox: Don't try and stop PostgreSQL twice in PostgresAround.

* bazel_tools: Windows rlocation lookups need to be with forward slashes.

* release: Fix case of "true".

* ledger-api-common: Make `GrpcHealthService::matchResponse` return a Try.

* ledger-api-common: Make `GrpcHealthServiceSpec` async.

* sandbox: Make a couple of DB classes final.

* sandbox: Avoid importing `X._` in PostgresAround.

* sandbox: Add clues to the SqlLedgerSpec's multiple assertions.

* sandbox: If PostgreSQL doesn't come back up, keep retrying.

* sandbox: Remove duplication in SqlLedgerSpec.

* sandbox: In SqlLedgerSpec, actually wait for the health to change.

* sandbox: In PostgresAround, make stopping PostgreSQL idempotent.

* sandbox: Simplify the SqlLedgerSpec to make it work on CI.

It's worth a shot.

* ledger-api-common: Simplify the GrpcHealthServiceSpec a little.

And add a changelog.

CHANGELOG_BEGIN

- [Ledger API Server] Add a health check endpoint conforming to the
  `GRPC Health Checking Protocol <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`_.
- [Ledger API Server] Add health checks for index database connectivity.
- [Participant State API] Add a mandatory ``currentHealth()`` method to
  ``IndexService``, ``ReadService`` and ``WriteService``.

CHANGELOG_END

* sandbox: Improve the Javadoc layout for DbDispatcher.

* sandbox: Capitalize constants in SqlExecutor.

* ledger-api-health: Convert HealthStatus to an abstract class.
2019-11-29 15:07:43 +00:00
associahedron
2713d6978d
Reduce SDK tarball size by 70% by deduplicating Scala dependencies. (#3678)
* Start moving all the jars into a single jar.

* Fold navigator into daml-sdk jar

* include sandbox

* Remove unnecessary compileDeps.

CHANGELOG_BEGIN

- [DAML SDK] Reduced the size of the DAML SDK by about
60% uncompressed, 70% compressed, by deduplicating Scala
dependencies.

CHANGELOG_END

* update copyright header

* buildifier fix
2019-11-29 13:26:47 +00:00
Martin Huschenbett
9f18a83570
Fix error message for missing --ledger-party in daml trigger (#3677)
Who is "Ledger Pary"?
2019-11-29 12:31:19 +01:00
Martin Huschenbett
952184298e Release DAML SDK 0.13.38 (#3676) 2019-11-29 12:16:20 +01:00
Oliver Seeliger
ef08936c05 Ledger api CommandService conformance test fixes (#3675)
Adding missing synchronize to two tests
2019-11-29 09:57:14 +00:00
Oliver Seeliger
f11a3ce9a7
Release triggers to maven central (#3674) 2019-11-29 10:25:02 +01:00
Martin Huschenbett
0e8c2bbc6f Improve the error message for polymorphic numeric literals (#3672)
Display the actual number the user tried to use instead of 1.2345.

The logic to display the number is not perfect but definitely better than
we have now. If somebody knows a _simple_ way to do this better, please
tell me about it.
2019-11-29 08:51:32 +00:00
associahedron
aafa107a80
Update DataDependencies.hs for GenMap (#3671) 2019-11-29 08:29:48 +00:00
Martin Huschenbett
bf5310060c Don't break long party names in scenario view weirdly (#3669)
Until now, we broke long party names in the table view in the scenario at
spaces. This looked quite ugly.

Now, we don't break them at spaces. At the same time we also moved the CSS
into a file rather than having it in the code to make changes like this one
easier in the future.

This fixes #3642.
2019-11-29 08:10:44 +00:00
Stefano Baghino
0123c659f2 Add authentication support to CommandClient (#3666) 2019-11-29 07:20:39 +00:00
associahedron
405ae5a8d8 Implement DAML constraint tuples as LF structs. (#3667)
* Constraint tuples

* LF Tuples -> Structs

* A couple that got away

* Dead code elim

* Better documentation for constraint tuple projection functions

* strict -> struct

* readability on constraint tuple projection conversion

* Add mkIndexedField
2019-11-28 17:18:55 +00:00
Remy
5e63db7a40 speedy: Rename SMap to STextMap (#3664)
+ rename MAP to TEXTMAP in decoder/encoder
2019-11-28 17:05:26 +00:00
Samir Talwar
326f427e8f scala-protoc-plugins: Don't use two versions of scalapb. (#3665)
This really confuses IntelliJ, because it's importing two versions of
scala-library-*.jar.

Turns out it's not being used anyway.
2019-11-28 16:26:59 +00:00
Remy
54d98fd186 navigator: add GenMap support (#3525)
* navigator: add GenMap support

* fix after rebase

* change missing 'map' to 'textmap'

* more fixes

* navigator: fix query for TextMap and GenMap
2019-11-28 16:13:36 +00:00
Moritz Kiefer
8b289eb080
Document how to iterate on changes to template desugaring (#3663) 2019-11-28 16:33:24 +01:00
Stefano Baghino
9e9eb68e38 Make ActiveContractsClient work against auth ledgers (#3653)
* Make ActiveContractsClient work against auth ledgers

* Address review comments

- Address https://github.com/digital-asset/daml/pull/3653#discussion_r351667485
- Address https://github.com/digital-asset/daml/pull/3653#discussion_r351667588
2019-11-28 12:36:50 +00:00
Remy
d465787dde Extractor: Add support for GenMap (#3614)
* Ledger-service: fix json encoding for genMap

* Extractor: Add support for GenMap

* Address Leo's comments
2019-11-28 12:31:28 +00:00
nickchapman-da
885bbefdf3 rename structural records: tuple -> struct (#3660)
* rename structural records: tuple -> struct

* add missing renames (tuple -> struct) in comments, var-names and error messages

* exposition: structural vs nominal; change history note

* remove accidentilly checked-in file
2019-11-28 10:00:24 +00:00
Stefano Baghino
7c3542fc1d Use scalafmt's diff mode (#3654)
Limits the set of files scalafmt will run on to those in the
git diff with master. This should greatly speed up language
agnostic checks, especially for developers to test them before
the contribution hits CI.

Worth mentioning: we use scalafmt 1.5.x, scalafmt latest release
is 2.2.x and the option is deprecated in favor of .
2019-11-28 09:33:13 +00:00
Stefano Baghino
c199c20730 Document HTTP JSON API authentication (#3657)
* Document HTTP JSON API authentication

* Update docs/source/json-api/index.rst

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Update docs/source/json-api/index.rst

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address review https://github.com/digital-asset/daml/pull/3657#pullrequestreview-323840183

* Update docs/source/json-api/index.rst

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* Update docs/source/json-api/index.rst

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
2019-11-28 09:25:22 +00:00