Commit Graph

695 Commits

Author SHA1 Message Date
Shayne Fletcher
de03006470
Use sandbox '--port-file' (#5284)
* increase timeout to eternal

changelog_begin
changelog_end

* Switch to using --port-file for sandbox

changelog_begin
changelog_end
2020-03-30 15:24:42 -04:00
Shayne Fletcher
2722e7ce95
Move 'withEnv', call it from daml2ts tests (#5276)
* Move 'withEnv', call it from daml2ts tests

changelog_begin
changelog_end

* Fix withEnv call to ensure that TASTY_NUM_THREADs is set

withEnv replaces the whole environment so we need to set everything we
care about.

* withEnv replaces the whole environment so we need to set everything we
care about.

* Apparently applying the same fix has destabilized Windows

* Try even harder to get daml assistant tests passing on Windows again

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-30 17:20:47 +00:00
Martin Huschenbett
72e0cb6374
@daml/react: Remove unused dependencies (#5283)
The `package.json` lists some dependencies which used to be
dependencies in the past but aren't anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 16:53:23 +00:00
Martin Huschenbett
e11fced8c9
daml2ts: Update the TypeScript version (#5269)
Update the TypeScript version we're using in `daml2ts` and its support
libraries. Also update the versions of ESLint and its TypeScript
plugin we're using for linting the generated code. (And remove more
occurrences of `HashMap Text Text` at the same time.)

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 11:27:40 +00:00
Robert Autenrieth
f8cd628c2f
Remove old time model from ledger config (#5216)
* Remove old time model from ledger config

CHANGELOG_BEGIN
- [Ledger API] Fields related to the old ledger time
  model have been removed from the configuration
  management service and the ledger configuration service.
CHANGELOG_END

* Update ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/tests/LedgerConfigurationService.scala

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

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-30 08:46:22 +02:00
Robert Autenrieth
d57f78c9ef
Remove useless timeProvider in quickstart (#5247)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-28 13:25:29 +01:00
Remy
1b37f6c482
DAML-LF: redesign absolute contract ids (#5207)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 19:07:42 +01:00
Martin Huschenbett
454bd127a0
daml2ts: Don't use HashMap Text Text anywhere (#5252)
As I said previously, all instances of the dreaded `HashMap Text Text`
can go away if write our code more direct. Here we go.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 15:51:42 +00:00
Martin Huschenbett
b398272fee
daml2ts: Don't reinvent assertInfixOf in tests (#5245)
Instead use the version from `DA.Test.Util`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 11:58:53 +00:00
Martin Huschenbett
98f37dbe48
daml2ts: Make tests more concise (#5243)
We do not need to have templates in the `.daml` files we generate
during these templates, any serializable type is good enough. Thus,
let's make the tests shorter by using a simple serializable type
instead of templates.

Also make the tests easier to debug when expected failures of `daml2ts`
do not happen in the anticipated way.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 11:06:41 +00:00
Martin Huschenbett
d48698e43b
daml2ts: Fix the A:X vs A.B bug (#5226)
* daml2ts: Fix the A:X vs A.B bug

Currently, the TypeScript generated by `daml2ts` does not compile when
there are a modules `A` and `A.B` which both contain serializable types.
(Note: there can't be a type called `B` in `A` due to the name collision
check.)

Since fixing this within the current layout using TypeScript
namespaces would be very challenging since we would need to inject
subnamespaces into existing namespaces. Thus, we switch the code
generation to use ES2015 modules. Since TypeScript namespaces are
considered (somewhat) deprecated, this is a good move anyway.

As a result of this change to ES2015 we need to write `index.ts` files
at each node of the module hierarchy. These `index.ts` files reexport
the module at the current node (if present) and all child modules.

At the same time we also remove the default export of the top-level
`index.ts` file. It is not clear if they are actually useful and to
add them to the new scheme requires a technique that feels like a hack.

To give an example, assume we have modules `A` and `A.B.C`. We now write
the following directory structure:
```
src/
+- index.ts             <- reexports A
+- A/
   +- index.ts          <- reexports module.ts and B
   +- module.ts
   +- B/
      +- index.ts       <- reexport C
      +- C/
         +- index.ts    <- reexports module.ts
         +- module.ts
```
If you import the package like
```typescript
import * as foo from '@daml.js/foo-1.0.0';
```
you can acces the `A` and `A.B.C` modules as `foo.A` and `foo.A.B.C`.

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt build-and-lint-test

CHANGELOG_BEGIN
CHANGELOG_END

* Add new test

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 10:27:18 +01:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Shayne Fletcher
8bb9f4b5c7
Don't write .eslintrc.json files (#5218)
* Factor out daml2ts utilities

changelog_begin
changelog_end

* Stop writing .eslintrc.json files into daml2ts packages

changelog_begin
changelog_end
2020-03-26 14:42:59 -04:00
Shayne Fletcher
180838eb12
Follow up on earlier PR (#5206)
changelog_begin
changelog_end
2020-03-26 16:57:01 +01:00
Martin Huschenbett
d82d47a275
daml2ts: Write module A.B.C into file src/A/B/C/module.ts (#5209)
Instead of writing the TypeScript for DAML module `A.B.C` into the file
`src/A/B/C.ts` we now write it into `src/A/B/C/module.ts`. This is in
preparation for also writing a file `src/A/B/C/index.ts`, which
re-exports `src/A/B/C/module` but also `src/A/B/C/D` for each `D`.

We also make sure to use the correct path separator on Windows.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-26 16:38:12 +01:00
Shayne Fletcher
24cbeddd35
Follow up to earlier PR (#5201)
changelog_begin
changelog_end
2020-03-26 05:16:16 -04:00
Martin Huschenbett
c9e2f7929b
daml2ts: Import external dependencies via their index module (#5203)
Instead of reaching into to the internals of external dependencies,
we no import these package via their root `index.ts` file. This gives
us the possibility of the changing the internal structure without
having to think about this kind of import as long as we keep the
interface the same. This is exactly what I plan to do in the next PR
which will fix the `A` vs `A.B` bug.

More precisely, instead of writing two imports like
```typescript
import * as pkgXYZ_A_B from '@daml.js/foo-0.0.1/lib/A/B';
import * as pkgXYZ_C from '@daml.js/foo-0.0.1/lib/C';
```
we only write one import
```typescript
import pkgXYZ from '@daml.js/foo-0.0.1';
```
and replace use sites of `pkgXYZ_A_B` and `pkgXYZ_C` with `pkgXYZ.A.B`
and `pkgXYZ.C`, resp.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-25 22:52:43 +00:00
Martin Huschenbett
95f5d6822b
daml2ts: Emphasize differences between internal and external imports (#5197)
This prepares a followup change in which I want to import external
dependecies entirely through their `index.ts` file. This will become easier
once the differences between internal and external imports are more
apparent.

Importing external dependencies through their `index.ts` files is part
of a restructuring the file layout in order to solve the bug where we
cannot have modules `A` and `A.B` at the same time.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-25 21:11:15 +00:00
Martin Huschenbett
5460379d37
daml2ts: Write package id directly into index.ts (#5195)
There's no more reason to have the package id in a separate file
`packageId.ts`. This was different before we had an `index.ts`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-25 19:24:43 +00:00
Martin Huschenbett
b1913e6d38
TS libs: Remove deprecated methods/hooks (#5168)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-25 20:05:27 +01:00
Shayne Fletcher
9351b7a7b9
Build js packages at code-generation time (#5171)
changelog_begin
changelog_end
2020-03-25 14:13:37 -04:00
Robert Autenrieth
a3ddde3a9d
Remove MRT and LET (#5172)
Contributes to #4194.
Closes #4231.
Closes #5022.
CHANGELOG_BEGIN
- [Ledger API] The protobuf fields ledger_effective_time and maximum_record_time have been removed from
  command submission. These fields were previously deprecated following the introduction
  of a new ledger time model. See issue `#4194 <https://github.com/digital-asset/daml/issues/4194>`__.
[Java Bindings] removed the usage of ledgerEffectiveTime and
maximumRecordTime, and instead added minLedgerTimeAbsolute and
minLedgerTimeRelative in CommandSubmissionClient and CommandClient
CHANGELOG_END
2020-03-25 16:50:27 +01:00
Samir Talwar
bfe27d23db
sandbox: Capture timing metrics for API server calls. (#5145)
* sandbox: Capture timing metrics for API server calls.

`timer` is a superset of `meter`, so this doesn't lose any existing
behavior; just adds new behavior.

CHANGELOG_BEGIN
- [Ledger API Server] Added timing metrics for all GRPC endpoints.
CHANGELOG_END

* sandbox: Rename SandboxClientResource to GrpcClientResource.

* sample-service: Clean up warnings.

* sandbox: Add tests for MetricsInterceptor.

* sandbox: Split the API metrics interceptor from the naming.

* sandbox: Use `MetricRegistry.name` instead of string interpolation.

* rs-grpc-akka: Restrict the test library to the DAML workspace.

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-03-25 09:56:37 +00:00
Robert Autenrieth
3f597aae16
New ledger time (#5100)
* Tighten result type

Command execution can't result in a sequencer error

* New helper method for extracting used contracts

* New error clause

* Add a DAO query for the maximum time of contracts

* Implement algorithm for finding ledger time

CHANGELOG_BEGIN
CHANGELOG_END

* fixup ledgerTimeHelper

* Use new ledger time algorithm

* Mark LET/MRT as deprecated

CHANGELOG_BEGIN
- [Ledger API] DAML ledgers have switched to a new ledger time model.
  The ledger_effective_time and maximum_record_time fields of command submission are deprecated,
  the ledger time of transactions is instead set automatically by the ledger API server.
  Ledger time is no longer strictly monotonically increasing, but only follows causal monotonicity:
  ledger time of transactions is greater than or equal to the ledger time of any used contract.
  See `#4345 <https://github.com/digital-asset/daml/issues/4345>`__.
CHANGELOG_END

* Add ledger time skew check

* Remove command updater

LET/MRT are now deprecated, this class is now useless

* Remove old time model validator

* Switch to new time model check: kvutils

* Switch to new time model check: in-memory ledger

* Switch to new time model check: SqlLedger

* Use initial ledger config

* Ignore user provided LET

* Use TimeProvider in submission services

* Use deduplication_time in daml-script runner

- Also remove unnecessary command completion output of CommandTracker.
- Remove usage of maximum record time in CommandTracker.

* Use arbitrary default value for deduplication time

* Use built-in Instant ordering

* Remove obsolete test

* Remove obsolete test: CommandStaticTimeIT

* Refactor test: TransactionMRTCompliance

* Disable test: CommandTrackerFlow timeout

* thread maxDeduplicationTime through to CommandTracker

* Improve test

* Refactor command client configuration

* Deduplication time should always use UTC

* Add missing method in TimedIndexService after rebase

* Put more details into the deduplication error response.

* Use system time for command dedup submittedAt.

* Use explicit UTC time source in command validator

* Revert CommandTracker[Flow] to previous completion-recovering-behavior

* Adapt scala client command config to new config params

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-25 09:28:56 +01:00
Martin Huschenbett
f8e383daf6
daml2ts: Consolidate ESLint exception in generated code (#5167)
Currently, we write exceptions for using namespaces and all exceptions in
`index.ts` at the place where they occur. This is pretty noisy.

After this PR, we write all exceptions at the beginning of the file.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 22:19:00 +00:00
Stefano Baghino
181df8f3ab
Act on Option2Iterable wart (#5154)
Some Option2Iterable ignore annotations are not needed, others were needed for unused methods.

In a few occasions we were ignoring the warning for the very purpose for which is was there,
i.e. avoiding an implicit conversion. I'm all for not verifying this rule if we agree we
don't need it.

For ProcessFailedException it was a bit gratuitous, I changed the way in which the exception
message is built.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-24 11:25:05 +00:00
Moritz Kiefer
2b47f6994d
Switch default DAML-LF target to 1.8 (#5127)
changelog_begin

- [DAML Compiler] The default output DAML-LF target version is now
  1.8. You can target 1.7 by specifying ``--target=1.7`` in the
  ``build-options`` field in your ``daml.yaml``.

changelog_end

Fix daml2ts tests
2020-03-24 11:02:13 +01:00
Shayne Fletcher
a5faa1cdbc
Use local paths in package dependencies (#5137)
changelog_begin
changelog_end
2020-03-23 13:54:56 -04:00
Shayne Fletcher
bf22d8db59
Fix package name (#5120)
changelog_begin
changelog_end
2020-03-22 12:01:56 -04:00
Robin Krom
7a9648c714
language: react: tests for useReload. (#5095)
This adds tests to see that the `useReload` hook of @daml/react works.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 22:25:28 +01:00
Shayne Fletcher
78d34dd9ca
Experiment with 'eitherDecode' (#5098)
changelog_begin
changelog_end
2020-03-19 20:07:19 +00:00
Martin Huschenbett
8bd2172569
daml2ts: Remove "itself" from progress output (#5088)
I've received some feedback that the "itself" in
```
Generating <some hash> as itself
```
is confusing. Also, the first noun in each line said what is being
_processed_ not what is being _generated_. I've fixed that too.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 18:05:54 +01:00
Robin Krom
b7f36d5e10
streamQuery tests (#5059)
* language:daml-react: tests for useStreamQuery/useStreamFetchByKey

This adds tests for `useStreamQuery` and `useStreamFetchByKey` of the
`@daml/react` library.

CHANGELOG_BEGIN
CHANGELOG_END

* renamed hooks.test.ts -> index.test.ts
2020-03-19 16:42:34 +01:00
Robert Autenrieth
60a845ec72
Add new protobuf fields for new ledger time model (#5036)
* Add new protobuf fields for new ledger time model

Fixes #4344.

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt haskell bindings
2020-03-19 13:53:49 +01:00
Martin Huschenbett
d9f2eed632
daml2ts: Simplify generated build config (#5085)
We don't use TypeScript's project references. Hence there's no point in
passing `--build` to `tsc`. Let's stop doing that hence.

By default, the TypeScript compiler type checks the `.d.ts` of all
dependencies of a project. This is painfully slow. For the packages
generated by `daml2ts` it also doesn't make a lot of sense since we control
all dependencies except for `@mojotech/json-type-validation`, which is
written in TypeScript itself and hence has very sane typings anyway.

This default behaviour can be disabled by setting `skipLibCheck` to `true`.
Doing that decreases the compilation time of _every_ single package generated
by `daml2ts` for the DAVL project from ~10s to ~2s. Let's get that time back!

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 12:21:05 +00:00
Shayne Fletcher
9fbd3da302
Use type application for 'decode' (#5081)
changelog_begin
changelog_end
2020-03-19 06:53:04 -04:00
Remy
c097266edc
java-binding: fix protobuf testing generator (#5082)
* exclude com.daml.ledger.javaapi.data.ValueSpec test

* Revert "exclude com.daml.ledger.javaapi.data.ValueSpec test"

This reverts commit 9b737bc452.

* java-binding: fix testing Generators

* revert minor change

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-19 09:59:36 +00:00
nickchapman-da
d81caa9568
rework daml_compile bazel rule (#5070)
Avoiding `damlc compile/package` commands (which we would like to deprecate), and replace with plain `damlc build` together with a post dar->dalf extraction step in the couple of places where we actually want the .dalf for testing.

changelog_begin
changelog_end
2020-03-18 23:06:55 +00:00
Samir Talwar
cbeeb5aafc
sandbox: Fail to start if a time mode is not explicitly specified. (#5033)
* sandbox: Fail to start if a time mode is not explicitly specified.

CHANGELOG_BEGIN
- [Sandbox] Sandbox is switching from Static Time mode to Wall Clock
  Time mode as the default. To ensure that our users know about this,
  for one version, there will be no default time mode. Instead, users
  will have to explicitly select their preferred time mode by means of
  the `--static-time` or `--wall-clock-time` switches. In the next
  release, Wall Clock Time will become the default, and users who are
  happy with the defaults will no longer need to specify the time mode.
CHANGELOG_END

* daml-script|triggers: Specify time mode when testing against Sandbox.

* daml-assistant: Default the Sandbox to wall clock time.

CHANGELOG_BEGIN
- [DAML Assistant] Initializing a new DAML project adds a switch to
  ``daml.yaml`` to ensure Sandbox can continue to start with ``daml
  start``::

      sandbox-options:
        - --wall-clock-time
CHANGELOG_END

* docs: Update the DAML Script and Triggers docs to use Wall Clock time.

It's now what Sandbox will use by default when using `daml init`.

* docs: Change the Quickstart to run Sandbox in wall clock time.

This explains why the contract IDs may vary.

It also updates the manual release testing script to match.
2020-03-18 08:25:03 +00:00
Gerolf Seitz
cf032a02cf
Introduce Stable Offsets (#4953)
A "stable offset" in the context of the Participant Server is the offset
that was provided by the ledger backend (be it kvutils, corda, daml on sql).

The Participant Server does not keep a participant-local offset anymore.
In a single domain/kvutil setup, this makes offsets stable across participants,
since all participants will see the same offset for the same transaction.

The following changes were needed to achieve this:
- The participant server always uses the offset provided by the backend
  AS IS (no more +1 magic).
- Offsets provided to the Ledger API in requests must be treated as
  startExclusive and endInclusive (previously beginInclusive and
  endExclusive).

CHANGELOG_BEGIN
[Ledger API]: Offsets have been redefined. Instead of being represented
by a number or a structured string, an offset is now an opaque string
that can be compared lexicographically.
[DAML Integration Kit]: The bounds for ``Dispatcher`` are now
startExclusive and endInclusive.
CHANGELOG_END

---------
ledger api:
ledger_offset.proto
  Changed definition of offsets, since they can now be compared
  lexicographically.

---------
participant-state-api:
Offset:
  Changed from Array[Long] to ByteString. Ledgers need to make sure that the
  offsets produced are strictly monotonically increasing according to
  lexicographical order.

---------
akka-streams:
Dispatcher, DispatcherImpl, SubSource:
  Changed interval handling to exclusive/inclusive.

---------
ledger-on-memory:
InMemoryLedgerReaderWriter, InMemoryState:
  Changed interval handling to exclusive/inclusive.

---------
ledger-on-sql:
CommonQueries, SqlLedgerReaderWriter:
  Change interval in query and boundary handling.

---------
kvutils:
KeyValueParticipantStateReader, KVOffset:
  Convenience functions for kvutils to add or remove sub-indexes for
  offsets.
  KV ledger implementations can use KVOffset to construct a structured offset.

---------
Participant Server:
JdbcLedgerDao:
  Use Offset instead of Long.
  Fetch offsets directly as Offset from the database with proper anorm
  integration.
  Change interval handling to exclusive/inclusive.

CommandCompletionsReader, CommandCompletionsTable:
  Change interval handling to exclusive/inclusive.

BaseLedger:
  Use Offset instead of Long.
  Change interval handling to exclusive/inclusive.

Conversions:
  Anorm integration for using Offset in queries and result parsers.

JdbcIndexer:
  Remove references to "extenalLedgerEnd" and participant-local Long
  offset (headRef).

---------
sandbox:
In general:
  Use the Offset type everywhere instead of Long.

SQL migrations:
  Change all offset columns to bytea or BINARY.

LedgerBackedIndexService:
  Proper bounds checking has been pushed down to Dispatcher, which
  allowed simplifying the acceptedTransactions implementation.

InMemoryLedger, LedgerEntries:
  Change interval handling to exclusive/inclusive.
  Transaction lookup by ID is now O(n) because transaction IDs are not
  necessarily the same as the offset.

SqlLedger:
  Remove external offset references.
2020-03-18 08:43:41 +01:00
Shayne Fletcher
e71cba698e
daml2ts : Simplify docs, use mapped types for enums. (#5044)
* Simplify docs, use mapped types for enums.

changelog_begin
changelog_end

* remove serializale check

* add 'keys' property to enums

* Simplify docs just a little bit more
2020-03-17 16:27:46 +00:00
Robin Krom
e537b496ee
Deprecate useExercise (#4972)
* language:daml-react: deprecate useExercise

We replace 'useExercise', 'useExerciseByKey' with 'useLedger' and expect
a user to call the ledger methods instead.

CHANGELOG_BEGIN
CHANGELOG_END

* addressing martin's comments
2020-03-16 14:55:59 +01:00
Stefano Baghino
1f0534ea4f
Spin-off BuildInfo into its own (micro-)library (#5004)
* Spin-off BuildInfo into its own (micro-)library

CHANGELOG_BEGIN
CHANGELOG_END

* Fix dependencies

* Remove unused dependency
2020-03-16 09:04:00 +01:00
Shayne Fletcher
8f4404b945
Avoid explicit test for package.json exists (#5005)
changelog_begin
changelog_end
2020-03-14 18:00:37 -04:00
Robin Krom
990be40168
docs: typedoc comments for daml-types (#5000)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 22:18:54 +01:00
Shayne Fletcher
17d85afbf6
The -p flag to daml2ts is mandatory; create package.json if not there (#5001)
changelog_begin
changelog_end
2020-03-13 17:15:53 -04:00
Robin Krom
b3f20dda8d
docs: Nicer typedocs for daml-ledger (#4993)
This polishes the generated docs for daml-ledger.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 22:04:10 +01:00
Gary Verhaegen
364262a7f6
saner scalafmt target (#4985)
The current behaviour of our scalafmt checks compares for changes with
origin/master, which means it is dependent on the state of the local git
repository. This makes it non-reproducible.

Added to the fact that the master branch is not currently green as per
our scalafmt rules, this makes it impossible to rebuild older commits,
which in turn could interfere with our release process.

This PR does two things:

1. Fix our codebase to agree with our formatting rules.
2. Add a flag to `fmt.sh` to enable scalafmt's diff behaviour, and
   change the default to a full scan.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 17:37:13 +01:00
Shayne Fletcher
0db2273a53
Make it so you can run in a known location (#4989)
changelog_begin
changelog_end
2020-03-13 12:12:22 -04:00
Moritz Kiefer
4e99f18613
Introduce a DA.Test.Sandbox module for managing sandbox in tasty (#4986)
We previously had 3 slightly different but consistently shitty logic
for handling this in the tests for daml-helper daml repl and the
Haskell ledger bindings. This PR introduces a module that is flexible
enough to capture all their needs and hopefully is somewhat less
shitty.

changelog_begin
changelog_end
2020-03-13 15:35:03 +01:00
Shayne Fletcher
33e384869a
Change code generation scheme for DAML enums (#4975)
changelog_begin
changelog_end
2020-03-13 09:30:52 -04:00
Robin Krom
b748f88fa2
language: docs: use typedoc comments for daml-react (#4977)
Using the correct typedoc comment form gives nice generated
documentation.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 21:54:33 +01:00
Robin Krom
f6936a6d6e
docs: fix: include html assets for generated docs (#4974)
The tar command in the bazel rule would not dereference links in the
documentation folder which let to missing assets. This is fixed with the
additional command line flag `-h` to tar.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 19:37:17 +01:00
Shayne Fletcher
cdc31ebe81
rename package 'build-and-lint' to 'build-and-lint-test' (#4957)
changelog_begin
changelog_end
2020-03-11 17:38:56 -04:00
Robin Krom
254ee50b7c
docs: better readme's for ts libraries (#4954)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 21:35:42 +01:00
Leonid Shlyapnikov
19f5b86c79
Websocket stream to emit last seen offset instead of heartbeat message (#4886)
* Capture lastSeenOffset in the @volatile var

CHANGELOG_BEGIN
[JSON API - Experimental] Websocket stream now emits last seen offset instead of the heartbeat message.
``{"heartbeat": "ping"}`` is replaced by ``{"events":[],"offset":"<last seen offset>"}``. See #4510.
CHANGELOG_END

* updating docs

* moving the last seen offset into the stream, WIP

* adding in-stream state

* minor docs

* cleanup the heartbeat logic

* minot cleanup

* Change live and heartbeat msg handling + some debug logging (to be removed)

* fixing ts tests, cleaning up

* Adding todo with the reference to the follow-up ticket

* Adding todo with the reference to the follow-up ticket
2020-03-11 19:53:05 +00:00
Shayne Fletcher
901b28777e
Reduce repetition by reuse of 'modPath' (#4951)
* Reduce repetition by reuse of 'modPath'

changelog_begin
changelog_end

* Use intercalate not joinPath; import </> from FilePath.Posix

These two changes should remove any ambiguity about whether paths are
treated any differently on Windows vs 'nix.
2020-03-11 15:21:01 -04:00
Shayne Fletcher
793609fd04
client module import ideal syntax (#4946)
changelog_begin
changelog_end
2020-03-11 13:33:16 -04:00
Moritz Kiefer
ed5886051d
Support TLS in daml-helper (#4943)
This PR adds TLS support to DAML helper both via client certs and
without (although the latter is not tested so far since atm this is
not supported by sandbox). The CLI options follow the scheme used by
navigator/extractor/… with the addition that you can just pass `--tls`
which will turn on TLS without custom root certs or client certs.

changelog_begin

- [DAML Assistant] You can now connect to ledger via TLS for ``daml
  deploy`` and ``daml ledger`` commands. See
  https://docs.daml.com/deploy/generic_ledger.html for more information.

changelog_end
2020-03-11 17:58:05 +01:00
Shayne Fletcher
7634b7cfad
Do not require the user type '@' (#4939)
changelog_begin
changelog_end
2020-03-11 11:27:15 -04:00
Leonid Shlyapnikov
953d55f338
Replace AsyncWordSpec with WordSpec, thanks @rautenrieth-da, see #4938 (#4941)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 14:58:38 +00:00
Robert Autenrieth
42adfb1887
Fix tests not running with bazel test (#4938)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 15:15:02 +01:00
Shayne Fletcher
2e8f8e5192
make generated packages easier to use (#4926)
changelog_begin
changelog_end
2020-03-11 09:03:13 -04:00
Robin Krom
8fe497ea5d
lanugage:docs: include generated docs on docs.daml.com (#4924)
This includes the generated docs for the typescipt libraries daml-react,
daml-ledger and daml-types in the documentation presented on
docs.daml.com. Next step is to create better readmes in this libraries.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-10 18:46:54 +01:00
Shayne Fletcher
9cdb01773b
Make scope an (optional) CLI arg (#4908)
changelog_begin
changelog_end
2020-03-10 11:48:37 -04:00
Robin Krom
7520e9f48e
docs: build rules for typescript docs (#4907)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-10 13:33:39 +01:00
Moritz Kiefer
048b3fa679
Fix warnings on mismatch between record type and constructor name (#4919)
changelog_begin
changelog_end
2020-03-10 13:01:16 +01:00
Shayne Fletcher
d2c819b4cd
Daml2ts config constants (#4887)
* Config constants

changelog_begin
changelog_end

* Lift constants to top of file for easy maintenance

changelog_begin
changelog_end
2020-03-09 09:36:04 -04:00
Gerolf Seitz
2b76d1962c
Deprecate ledger initialization with scenarios (#4864)
* Deprecate ledger initialization with scenarios

CHANGELOG_BEGIN
[Sandbox] Initializing the sandbox with scenarios is now deprecated in
favor of using DAML Script. The scenario parameter will be removed in
the near future. A warning is logged on startup.

The DAML SDK templates and quickstart guide are using DAML Script.

See the DAML Script migration guide for more information:
https://docs.daml.com/daml-script/index.html#using-daml-script-for-ledger-initialization
CHANGELOG_END
2020-03-09 09:30:18 +01:00
Shayne Fletcher
60fa929336
Eliminate duplication of package name calculation (#4874)
changelog_begin
changelog_end
2020-03-06 07:24:50 -05:00
Shayne Fletcher
9858a38d6b
version -> sdkVersionOrErr (#4861)
changelog_begin
changelog_end
2020-03-06 10:33:52 +01:00
Shayne Fletcher
7fe94be065
Drop special casing 'daml-types' (#4859)
changelog_begin
changelog_end
2020-03-05 18:02:49 -05:00
Shayne Fletcher
5171ed5313
Shift comment and metadata write calls around (#4858)
* Shift comment and metadata write calls around

Also remove licence line from package.json files

changelog_begin
changelog_end

* Broken Windows cache. Unbreak it. NOT FOR MERGING TO MASTER.

* Restore Windows cache; safe now to merge.
2020-03-05 17:47:23 -05:00
Shayne Fletcher
e1a164ef8b
Introduce a parameter pack for function 'daml2ts' (#4852)
changelog_begin
changelog_end
2020-03-05 13:54:39 -05:00
Shayne Fletcher
ed75b64fef
'writeRootPackageJson' -> 'setupWorkspace' (#4847)
Rename this function in empathy with
https://github.com/digital-asset/daml/pull/4829 and compute dependency
pairs not triples as per https://github.com/digital-asset/daml/pull/4799#discussion_r387883681

changelog_begin
changelog_end
2020-03-05 11:00:53 -05:00
mergify[bot]
35ee0b3057
daml2ts: Always use SDK version for @daml/types (#4829)
Currently, the version of `@daml/types` used by the generated TS is
configurable. This is not very helpful since `daml2ts` and `@daml/types`
are developed in lock step and still moving quite fast.

This PR changes `daml2ts` to always use the SDK version for as the
version of `@daml/types`. This also requires us to fix the test
for DAVL which used a hard coded version of `@daml/types` so far.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-05 15:12:06 +00:00
Shayne Fletcher
d33b507344
Replace over-enthusiastic uses of 'maybe' with case expressions (#4837)
changelog_begin
changelog_end
2020-03-05 09:43:13 -05:00
mergify[bot]
1842015a46
daml2ts: Factor out assertFileExists in tests (#4830)
* daml2ts: Factor out assertFileExists in tests

The pattern `assertBool "..." =<< doesFileExist ...` appears so many
times that it definitely deserves its own function.

CHANGELOG_BEGIN
CHANGELOG_END

* Remove assertions for existence of DAR files

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-05 13:55:30 +00:00
Shayne Fletcher
3b6bd630cc
Rearrange to avoid 'stripPrefix'; cut down on 'T.pack'/'T.unpack' (#4818)
* Rearrange to avoid 'stripPrefix'; cut down on 'T.pack'/'T.unpack'

changelog_begin
changelog_end

* Remove ticks as suggested in https://github.com/digital-asset/daml/pull/4799#discussion_r387886292

* Fix indentation (as per https://github.com/digital-asset/daml/pull/4799#discussion_r387892680)
2020-03-05 07:28:47 -05:00
mergify[bot]
9bb80e552c
daml2ts: Keep workspace package.json intact (#4820)
Keep all fields in the workspace `package.json` given to `daml2ts`
instead of only `private` and `workspaces`.

This also allows for removing the `sed` hack in the `build-and-lint`
test and use the `resolution` field of the workspace `package.json`
to point to our local versions of `@daml/types` and `@daml/ledger`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-05 00:45:11 +00:00
Shayne Fletcher
0a0786d596
Set test size to large (#4817)
changelog_begin
changelog_end
2020-03-04 15:59:23 -05:00
Shayne Fletcher
48595f774d
daml2ts : Generate a package of each DALF (#4799)
* daml2ts : generate one package per dalf
2020-03-04 14:51:40 -05:00
Robert Autenrieth
98095cf80d
Clean up command deduplication (#4801)
* Always return error on duplicate submissions

* Remove unnecessary submission information

Now that duplicate submissions always return an error,
we don't need to store the original submission result.

CHANGELOG_BEGIN
CHANGELOG_END

* Rename ttl to deduplicationTime/deduplicateUntil

* Store absolute deduplicateUntil in domain commands

* Fix my own initials

* Remove CommandDeduplicationEntry

Instead, use CommandDeduplicationResult everywhere,
removing the extra layer.
2020-03-04 14:08:08 +01:00
Samir Talwar
a99156252d
libs-scala/ports: Wrap socket ports in a type, Port. (#4784)
* libs-scala/ports: Wrap socket ports in a type, `Port`.

* sandbox: Use `Port` for the API server port, and propagate.

CHANGELOG_BEGIN
CHANGELOG_END

* extractor: Use `Port` for the server port.

* ports: Make Port a compile-time class only.

* ports: Allow port 0; it can be specified by a user.

* ports: Publish to Maven Central.
2020-03-03 08:59:15 +00:00
Moritz Kiefer
d68d3eb74a
Freeze DAML-LF 1.8 (#4770)
* Freeze DAML-LF 1.8

Two minor points that I did not mention in the previous PR:

We also include the renaming of structural records to `struct` and the
renaming of `Map` to `TextMap`.

There are some minor changes around the LF encoder tests which need to
be able to emit package metadata properly so I’ve added it to the
parser. Sorry for not splitting that out.

Following the process used for the DAML-LF 1.7 release, this does not
yet include the frozen proto file.

changelog_begin

- [DAML-LF] Release DAML-LF 1.8:

  * Rename structural records to ``Struct``. Note that
    structural records are not exposed in DAML.
  * Rename ``Map`` to ``TextMap``.
  * Add type synonyms. Note that type synonyms are not serializable.
  * Add package metadata, i.e., package names and versions.

  Note that the default output of ``damlc`` is stil DAML-LF 1.7. You
  can produce DAML-LF 1.8 by passing ``--target=1.8``.

changelog_end

* Update encoder

* Update java codegen tests

* Update comment in scala codegen

* Handle TSynApp in interface reader

* Bump lf_stable_version to 1.7

* Fix kvutils tests
2020-03-02 18:29:26 +01:00
Shayne Fletcher
08fea79833
Fix uninitiated string literal (#4759)
changelog_begin
changelog_end
2020-02-28 09:48:38 -05:00
Tim McGilchrist
761efbe085
Add missing dependencies to haskell daml bindings. (#4739)
Fixes #4706

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-28 05:39:10 +00:00
Moritz Kiefer
d455267e58
Reduce the number of GHCs in our nix closure (#4729)
This reduces the number of GHCs to 2 on Linux (regular and DWARF) and
1 on macOS. Given that each derivation is > 1 GB this should hopefully
help a bit.

changelog_begin
changelog_end
2020-02-26 20:00:07 +01:00
Shayne Fletcher
66dd112960
Remove pragma 'daml 1.2' (#4702)
changelog_begin
- The pragma 'daml 1.2' is now optional.
changelog_end
2020-02-26 13:17:45 -05:00
Stephen Compall
79c6ee7339
add offset to live events; remove liveness marker (#4593)
* move BeginBookmark to util

* adding offsets to steps

* offsetAfter belongs in Txn, not InsertDeleteStep

* make transaction stream a ContractStreamStep.Txn stream

* add several ContractStreamStep append cases

* rewrite 'render' to emit offset in the right places

* make ContractStreamStep#append total again

* check for offset in a few tests

* revert useless whitespace changes

* missed argument

* simpler mapPreservingIds

* rewrite states for new "live" format

* remove invalidated "events" block structure assertions

* make shutdown in withHttpService deterministic, to try to catch race condition

* exhaustiveness checking somehow disabled; fixed fetch flow and all is well

* documentation and changelog

CHANGELOG_BEGIN
- [JSON API - Experimental] Remove ``{"live": true}`` marker from websocket streams;
  instead, live data is indicated by the presence of an "offset".
  See `issue #4593 <https://github.com/digital-asset/daml/pull/4593>`_.
CHANGELOG_END

* be more specific about what liveness marker may be in docs

* fix daml2ts websocket tests

* mention type rules for all cases in offset documentation
2020-02-26 10:17:21 -08:00
Robert Autenrieth
79e7ca0627
Implement new command deduplication (#4467)
* Add TTL field to protobuf

* Add command deduplication to index service

* Wire command deduplication to DAO

* Implement in-memory command deduplication

* Remove Deduplicator

* Implement JDBC command deduplication

* Add TTL field to domain commands

* Deduplicate commands in the submission service

CHANGELOG_BEGIN
- [Sandbox] Implement a new command submission deduplication mechanism
  based on a time-to-live (TTL) for commands.
  See https://github.com/digital-asset/daml/issues/4193
CHANGELOG_END

* Remove unused command service parameter

* fixup protobuf

* Add configuration for TTL

* Fix Haskell bindings

* Rename SQL table

* Add command deduplication test

* Redesign command deduplication queries

* Address review comment

* Address review comment

* Address review comments

* Make command deduplication test optional

* Disable more tests

* Address review comments

* Address review comments

* Refine test

* Address review comments

* scalafmt

* Truncate new table on reset

* Store original command result

* Rename table columns

... to be consistent with other upcoming tables

* Rename migrations to solve conflicts

Fixes #4193.
2020-02-26 12:00:02 +01:00
Martin Huschenbett
c7588da274
@daml/react: Remove loading indication from useExercise hook (#4708)
* @daml/react: Remove loading indication from useExercise hook

The indicator was a stupid idea of mine in the first place. Sharing the
loading indicator between potentially concurrent calls to the function
returned by the hooks does not make any sense.

`useExerciseByKey` has the same problem and it's fixed here as well.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix doc comments

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-26 10:08:46 +00:00
Martin Huschenbett
29ffe57c47
@daml/react: Expose the template id type parameter (#4698)
Right now, the `I` type parameter of `CreateEvent` is omitted in all
the hooks and hence set to its default value `string`. This is very
unfortunate in upgrading settings where you end up with multiple
versions of the same template that are basically only distinguishable
by their template id.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-26 09:09:48 +00:00
Shayne Fletcher
b1a3be5950
copyDirectory, mvDirectory - daml-project-config -> da-hs-base (#4697)
changelog_begin
changelog_end
2020-02-25 14:57:06 -05:00
Gary Verhaegen
5a117dc358
introduce new release process (#4513)
Context
=======

After multiple discussions about our current release schedule and
process, we've come to the conclusion that we need to be able to make a
distinction between technical snapshots and marketing releases. In other
words, we need to be able to create a bundle for early adopters to test
without making it an officially-supported version, and without
necessarily implying everyone should go through the trouble of
upgrading. The underlying goal is to have less frequent but more stable
"official" releases.

This PR is a proposal for a new release process designed under the
following constraints:

- Reuse as much as possible of the existing infrastructure, to minimize
  effort but also chances of disruptions.
- Have the ability to create "snapshot"/"nightly"/... releases that are
  not meant for general public consumption, but can still be used by savvy
  users without jumping through too many extra hoops (ideally just
  swapping in a slightly-weirder version string).
- Have the ability to promote an existing snapshot release to "official"
  release status, with as few changes as possible in-between, so we can be
  confident that the official release is what we tested as a prerelease.
- Have as much of the release pipeline shared between the two types of
  releases, to avoid discovering non-transient problems while trying to
  promote a snapshot to an official release.
- Triggerring a release should still be done through a PR, so we can
  keep the same approval process for SOC2 auditability.

The gist of this proposal is to replace the current `VERSION` file with
a `LATEST` file, which would have the following format:

```
ef5d32b7438e481de0235c5538aedab419682388 0.13.53-alpha.20200214.3025.ef5d32b7
```

This file would be maintained with a script to reduce manual labor in
producing the version string. Other than that, the process will be
largely the same, with releases triggered by changes to this `LATEST`
and the release notes files.

Version numbers
===============

Because one of the goals is to reduce the velocity of our published
version numbers, we need a different version scheme for our snapshot
releases. Fortunately, most version schemes have some support for that;
unfortunately, the SDK sits at the intersection of three different
version schemes that have made incompatible choices. Without going into
too much detail:

- Semantic versioning (which we chose as the version format for the SDK
  version number) allows for "prerelease" version numbers as well as
  "metadata"; an example of a complete version string would be
  `1.2.3-nightly.201+server12.43`. The "main" part of the version string
  always has to have 3 numbers separated by dots; the "prerelease"
  (after the `-` but before the `+`) and the "metadata" (after the `+`)
  parts are optional and, if present, must consist of one or more segments
  separated by dots, where a segment can be either a number or an
  alphanumeric string. In terms of ordering, metadata is irrelevant and
  any version with a prerelease string is before the corresponding "main"
  version string alone. Amongst prereleases, segments are compared in
  order with purely numeric ones compared as numbers and mixed ones
  compared lexicographically. So 1.2.3 is more recent than 1.2.3-1,
  which is itself less recent than 1.2.3-2.
- Maven version strings are any number of segments separated by a `.`, a
  `-`, or a transition between a number and a letter. Version strings
  are compared element-wise, with numeric segments being compared as
  numbers. Alphabetic segments are treated specially if they happen to be
  one of a handful of magic words (such as "alpha", "beta" or "snapshot"
  for example) which count as "qualifiers"; a version string with a
  qualifier is "before" its prefix (`1.2.3` is before `1.2.3-alpha.3`,
  which is the same as `1.2.3-alpha3` or `1.2.3-alpha-3`), and there is a
  special ordering amongst qualifiers. Other alphabetic segments are
  compared alphabetically and count as being "after" their prefix
  (`1.2.3-really-final-this-time` counts as being released after `1.2.3`).
- GHC package numbers are comprised of any number of numeric segments
  separated by `.`, plus an optional (though deprecated) alphanumeric
  "version tag" separated by a `-`. I could not find any official
  documentation on ordering for the version tag; numeric segments are
  compared as numbers.
- npm uses semantic versioning so that is covered already.

After much more investigation than I'd care to admit, I have come up
with the following compromise as the least-bad solution. First,
obviously, the version string for stable/marketing versions is going to
be "standard" semver, i.e. major.minor.patch, all numbers, which works,
and sorts as expected, for all three schemes. For snapshot releases, we
shall use the following (semver) format:

```
0.13.53-alpha.20200214.3025.ef5d32b7
```

where the components are, respectively:

- `0.13.53`: the expected version string of the next "stable" release.
- `alpha`: a marker that hopefully scares people enough.
- `20200214`: the date of the release commit, which _MUST_ be on
  master.
- `3025`: the number of commits in master up to the release commit
  (included). Because we have a linear, append-only master branch, this
  uniquely identifies the commit.
- `ef5d32b7ù : the first 8 characters of the release commit sha. This is
  not strictly speaking necessary, but makes it a lot more convenient to
  identify the commit.

The main downsides of this format are:

1. It is not a valid format for GHC packages. We do not publish GHC
  packages from the SDK (so far we have instead opted to release our
  Haskell code as separate packages entirely), so this should not be an
  issue. However, our SDK version currently leaks to `ghc-pkg` as the
  version string for the stdlib (and prim) packages. This PR addresses
  that by tweaking the compiler to remove the offending bits, so `ghc-pkg`
  would see the above version number as `0.13.53.20200214.3025`, which
  should be enough to uniquely identify it. Note that, as far as I could
  find out, this number would never be exposed to users.
2. It is rather long, which I think is good from a human perspective as
  it makes it more scary. However, I have been told that this may be
  long enough to cause issues on Windows by pushing us past the max path
  size limitation of that "OS". I suggest we try it and see what
  happens.

The upsides are:

- It clearly indicates it is an unstable release (`alpha`).
- It clearly indicates how old it is, by including the date.
- To humans, it is immediately obvious which version is "later" even if
  they have the same date, allowing us to release same-day patches if
  needed. (Note: that is, commits that were made on the same day; the
  release date itself is irrelevant here.)
- It contains the git sha so the commit built for that release is
  immediately obvious.
- It sorts correctly under all schemes (modulo the modification for
  GHC).

Alternatives I considered:

- Pander to GHC: 0.13.53-alpha-20200214-3025-ef5d32b7. This format would
  be accepted by all schemes, but will not sort as expected under semantic
  versioning (though Maven will be fine). I have no idea how it will sort
  under GHC.
- Not having any non-numeric component, e.g. `0.13.53.20200214.3025`.
  This is not valid semantic versioning and is therefore rejected by
  npm.
- Not having detailed info: just go with `0.13.53-snapshot`. This is
  what is generally done in the Java world, but we then lose track of what
  version is actually in use and I'm concerned about bug reports. This
  would also not let us publish to the main Maven repo (at least not more
  than once), as artifacts there are supposed to be immutable.
- No having a qualifier: `0.13.53-3025` would be acceptable to all three
  version formats. However, it would not clearly indicate to humans that
  it is not meant as a stable version, and would sort differently under
  semantic versioning (which counts it as a prerelease, i.e. before
  `0.13.53`) than under maven (which counts it as a patch, so after
  `0.13.53`).
- Just counting releases: `0.13.53-alpha.1`, where we just count the
  number of prereleases in-between `0.13.52` and the next. This is
  currently the fallback plan if Windows path length causes issues. It
  would be less convenient to map releases to commits, but it could still
  be done via querying the history of the `LATEST` file.

Release notes
=============

> Note: We have decided not to have release notes for snapshot releases.

Release notes are a bit tricky. Because we want the ability to make
snapshot releases, then later on promote them to stable releases, it
follows that we want to build commits from the past. However, if we
decide post-hoc that a commit is actually a good candidate for a
release, there is no way that commit can have the appropriate release
notes: it cannot know what version number it's getting, and, moreover,
we now track changes in commit messages. And I do not think anyone wants
to go back to the release notes file being a merge bottleneck.

But release notes need to be published to the releases blog upon
releasing a stable version, and the docs website needs to be updated and
include them.

The only sensible solution here is to pick up the release notes as of
the commit that triggers the release. As the docs cron runs
asynchronously, this means walking down the git history to find the
relevant commit.

> Note: We could probably do away with the asynchronicity at this point.
> It was originally included to cover for the possibility of a release
> failing. If we are releasing commits from the past after they have been
> tested, this should not be an issue anymore. If the docs generation were
> part of the synchronous release step, it would have direct access to the
> correct release notes without having to walk down the git history.
>
> However, I think it is more prudent to keep this change as a future step,
> after we're confident the new release scheme does indeed produce much more
> reliable "stable" releases.

New release process
===================

Just like releases are currently controlled mostly by detecting
changes to the `VERSION` file, the new process will be controlled by
detecting changes to the `LATEST` file. The format of that file will
include both the version string and the corresponding SHA.

Upon detecting a change to the `LATEST` file, CI will run the entire
release process, just like it does now with the VERSION file. The main
differences are:

1. Before running the release step, CI will checkout the commit
  specified in the LATEST file. This requires separating the release
  step from the build step, which in my opinion is cleaner anyway.
2. The `//:VERSION` Bazel target is replaced by a repository rule
  that gets the version to build from an environment variable, with a
  default of `0.0.0` to remain consistent with the current `daml-head`
  behaviour.

Some of the manual steps will need to be skipped for a snapshot release.
See amended `release/RELEASE.md` in this commit for details.

The main caveat of this approach is that the official release will be a
different binary from the corresponding snapshot. It will have been
built from the same source, but with a different version string. This is
somewhat mitigated by Bazel caching, meaning any build step that does
not depend on the version string should use the cache and produce
identical results. I do not think this can be avoided when our artifact
includes its own version number.

I must note, though, that while going through the changes required after
removing the `VERSION` file, I have been quite surprised at the sheer number of
things that actually depend on the SDK version number. I believe we should
look into reducing that over time.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-25 17:01:23 +01:00
Martin Huschenbett
4614602f92
daml2ts: Don't fest @daml/types from npmjs.com in tests (#4688)
* daml2ts: Don't fest @daml/types from npmjs.com in tests

We now copy the compiled version of `@daml/types` into the yarn
workspace instead of getting it from npmjs.com.

I verified that it works if I change the `VERSION` file to contain
0.13.55. Thus, we're definitely not going to npmjs.com.

CHANGELOG_BEGIN
CHANGELOG_END

* Disable tests on windows

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-02-25 13:56:30 +00:00
Samir Talwar
9bdfbb0534
Avoid opening a server to the world when finding a free port. (#4683)
* Avoid opening a server to the world when finding a free port.

This is very annoying on macOS because we get a focus-stealing popup for
a split second, asking for permission to allow the server through the
firewall. The popup pretty much always disappears before it can even be
read, when the server is closed.

This is almost certainly not an attack vector, because:
  - we only do this in tests,
  - the server is open for only a few milliseconds,
  - nothing is served,
  - and finding the port is tricky, because it's effectively random.

Nevertheless, it's very annoying.

CHANGELOG_BEGIN
CHANGELOG_END

* Extract a Bazel package for finding free ports.

We seem to do it in 4 different places, which I think is enough to
remove the duplication.
2020-02-25 13:09:28 +00:00
Shayne Fletcher
825378c880
Add lint steps to tests (#4676)
changelog_begin
changelog_end
2020-02-24 14:52:05 -05:00
Shayne Fletcher
89b09612df
Use PackageName type (#4677)
changelog_begin
changelog_end
2020-02-24 14:28:21 -05:00
Martin Huschenbett
9b40d98f65
@daml/react: Add tests for useFetchByKey hook (#4663)
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-24 15:07:00 +01:00
Martin Huschenbett
c73d90274a
@daml/react: Add rerendering test for useQuery (#4662)
Add a test for `useQuery` that ensure that we don't call the JSON API
if the component calling the hook changes without changing the query.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-24 10:40:51 +00:00
Shayne Fletcher
6bfee0c854
Add yarn steps to tests (#4658)
changelog_begin
changelog_end
2020-02-21 20:21:18 -05:00
Martin Huschenbett
9ff28e51b0
@daml/react: Test that useQuery handles query changes (#4656)
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-21 18:16:05 +01:00
Martin Huschenbett
4a8c5cf24e
@daml/react: Use jest.fn mock functions in test (#4650)
Also mock the constructor of the `Ledger` class and separete out the
test for initializing the `DamlLedger` component.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-21 15:31:13 +01:00
Shayne Fletcher
6d6b632b68
daml2ts : Better multi-dar support (#4641)
* Step (1) Add error detection for different names/same package

changelog_begin
changelog_end

* Step (2) : Generate TS for a package once and only once.
2020-02-21 08:33:40 -05:00
Martin Huschenbett
0284fd04b4
@daml/react: Make the test suite invokable by yarn test (#4646)
Unfortunately, we need to work around some bazel issues which lead to
confliciting versions of react in our tests. This workaround cannot be
used the tests are invoked via `yarn test`. Thus, we only use it when
we the tests from bazel. We use the existence of the environment
variable `TEST_WORKSPACE` as a proxy for whether we run from bazel.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-21 10:38:27 +00:00
Martin Huschenbett
24cfd1ebe5
@daml/react: Add an initial test suite (#4612)
* @daml/react: Add an initial test suite

This only tests that the `useQuery` hook does the right thing once the
call to `Ledger.query` has resolved.

CHANGELOG_BEGIN
CHANGELOG_END

* Workaround for "Invalid hook call."

* Fix lint in BUILD file

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-20 17:50:58 +00:00
Martin Huschenbett
1c5efbfff9
@daml/ledger: Use {live: true} marker from JSON API (#4628)
Currently, we're using the first heartbeat as a guesstimate when we're
switching from the ACS to the live stream. These days, the JSON API has
a marker, namely `{live: true}`, to indicate this switch. This PR,
makes use of that marker.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-20 16:18:49 +00:00
Martin Huschenbett
34b032c80c
TypeScript: Make contract ids more type safe (#4614)
Currently, contract ids are simply presented by strings. Thus, it is very
easy to accidentally mix up contract ids of different templates. This PR
is an attempt to provide more safety in this regard. It prevents contract
ids of template types which are not in a _structural_ subtyping
relationship from being mixed up. This is far from perfect, but clearly
better than what we have now.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-20 09:07:32 +01:00
Shayne Fletcher
fbd8326b1e
Add unit-tests for daml2ts (#4613)
changelog_begin
changelog_end
2020-02-19 18:42:21 -05:00
Moritz Kiefer
ff90ec643e
Remove hardcoded number of packages from Java codegen test (#4604)
This breaks everytime we change the number of packages in damlc which
is rather annoying.

changelog_begin
changelog_end
2020-02-19 15:45:35 +01:00
Moritz Kiefer
e419ae06de
Remove hardcoded number of packages from Haskell ledger binding tests (#4603)
This is one of the tests that keeps breaking every time we change the
number of packages `damlc build` outputs by default which is quite
annoying.

The actual change is trivial, we just read the number of packages from
the manifest. The diff is mostly just propagating this through everything.

changelog_begin
changelog_end
2020-02-19 14:16:43 +00:00
Martin Huschenbett
b6a3606ece
@daml/react: Add useStreamFetchByKey hook (#4602)
This is pretty much a verbatim copy of the `useStreamQuery` hook but it
works against the `/v1/stream/fetch` endpoint of the JSON API.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-19 13:22:19 +00:00
associahedron
5db4ac8b0e
Support type-level strings in DAML. (#4571)
* Add type-level strings in DAML.

This PR adds a `PromotedText` stable package, with `PromotedText` type, which is used to encode type-level strings from DAML into DAML-LF. The reason for this is to preserve the `HasField` instance argument. This PR adds a test that `HasField` is succesfully reconstructed incontexts, during data-dependencies, which wasn't possible before.

changelog_begin
changelog_end

* adresss comments

* fix overly specific tests
2020-02-19 13:10:36 +00:00
Martin Huschenbett
7a7f37f71f
@daml/react: Port version from DAVL (#4599)
By using the streaming endpoint of the JSON API we can get rid of  a
lot of internal state management.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-19 12:13:51 +01:00
Shayne Fletcher
5171c830ea
Multi-dar support; first cut. (#4589)
* Multi-dar support; first cut.

changelog_begin
changelog_end

* Try to overcome broken Windows cache
2020-02-18 17:29:19 -05:00
Samir Talwar
f231ebc1b3
Sandbox-Next: Re-establish static time support. (#4581)
* kvutils: Extract a committer from the uses of `SubmissionValidator`.

This makes the clock injectable too.

* kvutils: Provide logging contexts in the `Runner`.

* sandbox: Remove the `StaticAllowBackwards` time provider type.

It's not used anywhere.

* sandbox: Fix warnings in CliSpec.

* sandbox: Ensure that we cannot specify both static and wall-clock time.

* sandbox-next: Crash if wall clock time is not specified.

* sandbox-next: Document more known issues in the new Sandbox.

* sandbox: Add a Clock (and some tests) to TimeServiceBackend.

* sandbox-next: Support static time.

CHANGELOG_BEGIN
- [Sandbox Next] Re-establish static time mode.
CHANGELOG_END

* ledger-on-(memory|sql): Expect a `() => Instant`, not a `Clock`.
2020-02-18 17:03:15 +00:00
Martin Huschenbett
3ea5ac3f94
@daml/ledger: Consolidate the expectations for arrays in tests (#4578)
There's no point in first testing for the length of the array and then
testing all elements individually. That's what arrays are for. :)

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-18 16:40:04 +01:00
Martin Huschenbett
ad05e2fe7e
@daml/ledger: Factor out code to promisfy streams in test (#4575)
The repeated code contains quite a bit of logic, which started to scare me.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-18 15:17:40 +00:00
Martin Huschenbett
a336e0bcfa
@daml/ledger: Compute accumulated state in Ledger.stream* methods (#4563)
Instead of only streaming the events we now primarily stream the set of
active contracts for the `Ledger.streamQuery` methods and the contract
pointed to by the key for the `Ledger.streamFetchByKey` method. The
events that lead to the latest state change are streamed as the second
argument to the event handler as well.

We also rename the event name from `'events'` to `'change'` since the
former is not longer accurate and also confusing and the latter captures
the generality of the streams we deal with here.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-18 15:03:47 +01:00
Moritz Kiefer
ab74291f0a
Use decodeArchivePackageId where possible (#4550)
Shouldn’t really make a difference due to laziness but at least it
makes it explicit if we need to decode the archive to the AST or just
need to get the package id.

changelog_begin
changelog_end
2020-02-18 09:12:35 +01:00
Stefano Baghino
bd32bd6c8f
Return proper code for invalid authentication (#4485)
* Return proper code for invalid authentication

CHANGELOG_BEGIN
[Sandbox] If authentication is enabled, requests without a valid
authentication are going to be rejected with an ``UNAUTHENTICATED``
return code instead of ``PERMISSION_DENIED``.
CHANGELOG_END

* Reduce logging noise from java-rxbindings tests

* Fix rxjava bindings tests to match new behavior

* Fix extractor tests to match new behavior

* Address https://github.com/digital-asset/daml/pull/4485#discussion_r378507478
2020-02-17 11:09:16 +00:00
Moritz Kiefer
d68d197948
Disable scaladoc on the MacOS CI (#4524)
* Disable scaladoc on the MacOS CI

It is still built by default locally.

fixes #4441

changelog_begin
changelog_end

* Change tag name
2020-02-14 14:08:24 +00:00
Samir Talwar
a589f4af0b
sandbox: Move more resource acquisition into the owner. (#4501)
* sandbox: Move more resource acquisition into the `owner`.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Reimplement SandboxClientResource as a resources.Resource.

* codegen: Use resources in TestUtil.

* sandbox: Manage PostgreSQL in tests with ResourceOwners.
2020-02-14 13:52:45 +00:00
Martin Huschenbett
c958aecf5e
@daml/ledger: Add workaround for websocket proxying issues (#4503)
Unfortunately, the development server of `create-react-app` does not
proxy websockets properly. Thus, we need to connect to the JSON API
directly when using it. This now be done by setting the
`REACT_APP_JSON_API_PORT` environment variable in `.env.development`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-13 16:23:09 +00:00
Martin Huschenbett
b59a871dbd
@daml/ledger: Add Ledger.streamFetchByKey method (#4487)
The `Ledger.streamFetchByKey` method exposes the `/v1/stream/fetch`
endpoint of the JSON API.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-12 11:09:48 +00:00
Martin Huschenbett
9602145e8b
@daml/ledger: Add Ledger.streamQuery method (#4478)
The `Ledger.streamQuery` method exposes the `/v1/stream/query` endpoint
of the JSON API.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-12 11:40:14 +01:00
Moritz Kiefer
36e188cac8
Translate unsupported kinds to a special Erased type (#4474)
* Translate unsupported kinds to a special Erased type

This should simplify `data-dependencies` and avoid issues like #4470
since we can match on the type instead of having to guess which types
can and which cannot be translated back to DAML.

changelog_begin
changelog_end
2020-02-12 09:03:19 +01:00
Shayne Fletcher
a334e210c7
Try to get package name from manifest (if not provided) (#4476)
Also, mark `build-and-lint` "exclusive".

changelog_begin
changelog_end
2020-02-11 16:02:18 -05:00
Gerolf Seitz
85db1033d7
Fix memory leak when using the reset service (#4447)
* sandbox: Don't hold on to old resources when resetting.

Now there's one hell of a memory leak.

CHANGELOG_BEGIN
- [Sandbox] Fixed a memory leak when using the ResetService; not
  everything was cleaned up correctly.
CHANGELOG_END

* sandbox: Split out SandboxClientResource from SandboxServerResource.

Gonna replace SandboxServerResource with a ResourceOwner acquisition.

* sandbox: Don't capture the API server in the SandboxServer resource.

When we reset, this is stored forever, leading to a memory leak.

Tested by rewriting the SandboxServerResource to use
`SandboxServer.owner`.

* sandbox: Revert the test client resource to calling `shutdownNow()`.

* sandbox: Make sure the fixture is recreated properly on each test run.

* sandbox: Make `SandboxState` a non-case class.

The `toString()` was unnecessarily heavy.

* sandbox: Futures, futures everywhere.

Avoid a race condition where the server is stopped before it starts by
storing a `Future[SandboxState]` rather than the `SandboxState` itself.

This doesn't trigger the same memory leak as storing a
`Resource[SandboxState]` because we don't capture the object itself in
the `flatMap` in the same way with `Future`.

* sandbox: Remove an unused parameter left in for debugging.

* sandbox: Replace `@VisibleForTesting` with a comment.

* sandbox: Add more comments to the weird logic in SandboxServer.

* sandbox: Get rid of the `Port` type alias; it was confusing.

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-02-10 16:47:39 +00:00
Rohan Jacob-Rao
cdcd4002f6
Fix laoding typo (#4454)
Not sure why the typechecker didn't catch this one.
I'm assuming this was changing an unused `laoding` field and the real
`loading` field was never used (or inaccurate) for `fetchByKeyResults`.

changelog_begin
changelog_end
2020-02-08 14:12:21 +01:00
Leonid Shlyapnikov
fb6d8afd1f
Rename JSON API endpoints, add version prefix (#4440)
* Rename JSON API endpoints, add version prefix. Combining two breaking changes.

CHANGELOG_BEGIN

[JSON API - Experimental] Rename JSON API endpoints. See #4289 and #3145
    /command/create => /v1/create
    /command/exercise => /v1/exercise
    /contracts/lookup => /v1/fetch
    /contracts/search => /v1/query
    /contracts/searchForever => /v1/stream/query
    /contracts/lookupForever => /v1/stream/fetch
    /parties => /v1/parties

CHANGELOG_END

* minor update

* fix typo in the logging

* experimental disclosure update

* experimental disclosure update

* experimental disclosure update
2020-02-06 16:30:47 -05:00
Stephen Compall
2a2479a3fd
rename "contracts" to "events" in JSON API exercise response (#4436)
* rename "contracts" to "events" in JSON API exercise response

CHANGELOG_BEGIN
- [JSON API - Experimental] Exercise response field "contracts" renamed to "events".
  See `issue #4385 <https://github.com/digital-asset/daml/issues/4385>`_.
CHANGELOG_END

* more events in doc

- pointed out by @leo-da; thanks
2020-02-06 20:13:46 +00:00
Gary Verhaegen
47bd131f15
add copyright headers to yml files (#4407)
We seem to have forgotten about them in the copyright scripts.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-06 12:54:07 +01:00
Andreas Herrmann
18db76bb4e
Add README and metadata to npm packages (#4406)
* Explicitly add readme to packages

* npm packages repository metadata

As specified in https://docs.npmjs.com/files/package.json#repository

CHANGELOG_BEGIN
CHANGELOG_END

* Bazel format

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-05 16:01:36 +00:00
Martin Huschenbett
82ca89ee63
@daml/react: Remove duplicate copyright header from context.ts (#4389)
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-04 19:52:45 +00:00
Andreas Herrmann
2dbd51bf29
language-support/ts generate package in commonjs format (#4380)
* Build commonjs format for npm packaging

CHANGELOG_BEGIN
CHANGELOG_END

* Custom commonjs typescript library rule

The npm packages generated by rules_nodejs' native ts_library rule use
the UMD package format. This breaks webpack which attempts to determine
dependencies by static code analysis and fails on UMD. To avoid this we
call `tsc` directly to ensure generation of commonjs modules.

* Enable module mapping on ts_commonjs_library

* Replace ts_library by da_ts_library

* Add dummy typescript/index.bzl on Windows

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-04 18:50:56 +01:00
Martin Huschenbett
ffa81809af
@daml/react: Remove DAVL specific credentials handling (#4387)
In particular, the `preCheckCredentials` function is very specific to the
bad style of authentication we use in DAVL. Without that function, we can
also drop the `ledgerId` field and reach a point where inlining the
definition of `Credentials` makes sense.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-04 18:46:10 +01:00
Martin Huschenbett
782f7e61d8
@daml/react: Add proper useExerciseByKey hook (#4368)
And remove the old quirky `usePseudoExerciseByKey` hook.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-04 15:23:54 +01:00
Martin Huschenbett
9eae66cab0
@daml/react: Handle contract keys in TemplateStore.addEvents (#4361)
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-03 16:26:21 -05:00
Martin Huschenbett
af669c9dbc
daml2ts: Import modules referenced by key types (#4362)
Currently, we're not tracking references from key types. This becomes a
problem if the key is the only place referencing a module.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-03 21:07:12 +00:00
Martin Huschenbett
cb3946a4e6
@daml/react: Add a comprehensive test suite for the TemplateStore (#4340)
`TemplateStore` and `TemplateStore.addEvents` are at the heart of
`@daml/react`. They definitely warrant such a big test suite.

The removed tests for the `LedgerStore` were test for the `TemplateStore`
in disguise and are covered by the new tests.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-02 21:11:06 +00:00
Martin Huschenbett
d287b03c7a
@daml/ledger: Clean up Ledger.fetch* methods (#4339)
- Replace `Ledger.fetchAll` by `Ledger.query` without `query` argument.
- Rename `Ledger.lookupByKey` to `Ledger.fetchByKey`.
- Add `Ledger.fetch`.
- Add tests and improve documentation.

The first three changes bring us closer to the JSON API, which is about to
rename its functions to the same schema.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-02 19:50:51 +00:00
Martin Huschenbett
7244c993b5
@daml/ledger: Give more useful types to archive and archiveByKey (#4338)
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-02 12:10:52 +00:00
Robin Krom
d3656c5b62
ts libraries: added README's for npm registry (#4322)
* ts libraries: added README's for npm registry

CHANGELOG_BEGIN
CHANGELOG_END

* clearer dependencies

* Update language-support/ts/daml-react/README.md

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/daml-ledger/README.md

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/daml-ledger/README.md

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-01-31 15:57:10 +01:00
Robin Krom
08a784c745
language-support: added tests to daml-react (#4288)
After a lot of pain we finally figured out how to test this under bazel.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-31 08:30:40 +01:00
Martin Huschenbett
af09783524
@daml/react: Stop useQuery from reloading indefinitely (#4315)
Since `{} !== {}` in JavaScript, the `useQuery` hook used to indefinitely
reload all contracts when called without its second and third parameter.
Having a stable name for `{}` fixes the issue. Manual tests on
`create-daml-app` confirm this. An automated test suite for `@daml/react`
is still under develeopment.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-30 22:31:38 +00:00
Shayne Fletcher
22fa5edf7e
First cut at developer docs (#4272)
changelog_begin
changelog_end
2020-01-30 11:42:32 +01:00
Martin Huschenbett
d6f54612c3
daml-react.ts: Don't use JSX (#4273)
We have only one place where we could use it. The linter is struggling
with it, so let's just avoid it.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-29 19:01:00 +00:00
Robin Krom
2e9fe6afb6
language: add daml-react package to ts libraries (#4259)
* language: add daml-react package to ts libraries

This adds the library formerly known as `daml-react-hook` into the
monorepo. We renamed it to `@daml/react`.

The tests sadly don't work with bazel right now because the local
imports aren't resolved correctly. Local testing with `yarn run test`
works as usual.

CHANGELOG_BEGIN
CHANGELOG_END

* address moritz comments

* get rid of DAVL mentions

* fix eslint warnings

* Update language-support/ts/daml-react/tsconfig.json

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-01-29 15:37:47 +01:00
Martin Huschenbett
83d720664d
dam2ts: Make template id accessible at the type level (#4248)
We add a third type parameter `I` to the `Template` interface and use it as
the type of the `templateId` field. We add this parameter to `CreateEvent`,
`ArchiveEvent` and `Event` as well. The reason behind this is to allow for
patterns like
```ts
function handleFooOrBar(event: CreateEvent<Foo, Foo.Key, typeof Foo.templateId>
                             | CreateEvent<Bar, Bar.Key, typeof Bar.templateId>) {
    switch (event.templateId) {
        case Foo.templateId: ...
        case Bar.templateId: ...
    }
}
```
and get exhaustiveness checking. This will become particularly handy when
handling upgrades, where `Foo` and `Bar` would be the old and new version
of a template, resp.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-28 17:49:10 +01:00
Shayne Fletcher
9c0fe75b94
Add daml2ts to the SDK release tarball (#4234)
changelog_begin
- daml2ts now included in the SDK
changelog_end
2020-01-27 13:18:05 -05:00
Martin Huschenbett
68b938d1b4 daml-ledger.ts: Fix build and lint config (#4215)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-27 10:11:16 +00:00
Martin Huschenbett
8b7878fdc6 daml-types.ts: Lint tests as well (#4208)
* daml-types.ts: Lint tests as well

Also simplify file selection a bit.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix build command in test script

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-25 07:38:10 +00:00
Shayne Fletcher
2160ad5035 Fix missing module refs issue (#4211)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-24 21:46:15 +00:00
Leonid Shlyapnikov
135abd1288 Remove obsolete scala codegen-sbt-example. (#4210)
It relies on `damlc.jar` which we are stopping to support/publish.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 18:11:19 +00:00
Robin Krom
020f6945dc
language: nicer descriptions for typescript libraries (#4203)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 14:18:33 +01:00
Martin Huschenbett
183df61805 daml-ledger.ts: Rename create argument to payload (#4198)
This is better in line with the field name of the `CreatedEvent` you'll
receive as a result of calling this.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 12:55:56 +00:00
Martin Huschenbett
3a4d3563cf daml-ledger.ts: Simplify types of *ByKey operations (#4202)
The current type signature adds complexity which is unjustified in my
opinion. Who would expect meaningful results when specifying a template
by key `undefined`?

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 10:40:23 +00:00
Leonid Shlyapnikov
9ab419f96b CHANGELOG_BEGIN (#4192)
[JSON API - Experimental] Rename ``argument`` field to ``payload`` in the ``command/create`` request. See #4189.

CHANGELOG_END
2020-01-24 09:04:03 +01:00
Rohan Jacob-Rao
63660c6d4e Correct rename to "daml-ledger" (#4195)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 09:00:40 +01:00
Shayne Fletcher
3811b6c191 Use template Key in template generic params list (#4186)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-23 20:21:24 +00:00
Robin Krom
811d740df5
upload typescript packages to npm registry (#4185)
* make packages public

This uploads the typescript npm packages of the language support to the
npm registry in the release process.

CHANGELOG_BEGIN
CHANGELOG_END

* address moritz/gary's review

* generate the .npmrc file

* adding debug output

just in case the upload will fail in the next release.

* reverse package order
2020-01-23 18:31:50 +01:00
Robin Krom
a3de2fbf0c
rename typescript language support libs (#4180)
We rename the typescript packages of the language support as follows:
  @digitalasset/daml-json-types -> @daml/types
  @digitalasset/daml-ledger-fetch -> @daml/ledger

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 16:14:25 +01:00
Shayne Fletcher
526801789e Add associated key type for templates (#4172)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-23 09:10:24 +01:00
Andreas Herrmann
032ed82254
language-support/ts yarn install (#4159)
* Remove language-support/ts/packages/yarn.lock

That file is for local development exclusively.

CHANGELOG_BEGIN
CHANGELOG_END

* yarn args --frozen-lockfile

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-22 17:28:14 +01:00
Moritz Kiefer
9b529ad8cb
Cleanup typescript hacks for Windows (#4167)
changelog_begin
changelog_end
2020-01-22 17:19:45 +01:00
Moritz Kiefer
970d9891fd
Disable all the TS stuff on Windows (#4163)
* Disable all the TS stuff on Windows

changelog_begin
changelog_end

* disable jest explicitly

* more disabling

* :sadpanda:

* Replace @language_support_ts_deps on Windows

Provides dummy content so that `load` commands are still valid on
Windows without `yarn_install`.

* disable daml-ledger-fetch on windows

* shut up buildifier

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-22 16:07:20 +01:00
Moritz Kiefer
2653c6f1fe
Disable eslint_test on Windows (#4161)
* Disable eslint_test on Windows

This is currently breaking CI completely so for now let’s disable it.

changelog_begin
changelog_end

* clean expunge
2020-01-22 14:43:15 +01:00
Martin Huschenbett
6abd9f4ca0
Clean the TS vs Bazel stuff a bit (#4149)
* Clean the TS vs Bazel stuff a bit

CHANGELOG_BEGIN
CHANGELOG_END

* Fix build issues

CHANGELOG_BEGIN
CHANGELOG_END

* Add dom library back to daml-json-types

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 11:30:50 +01:00
Robin Krom
81b8897fc8
added a package.json to work with yarn workspaces (#4147)
* added a package.json to work with yarn workspaces

This adds a package.json files on top of our typescript libraries so
that we can develop locally via yarn workspaces. The package.json that
describes the bazel managed dependencies is moved into a subfolder.

CHANGELOG_BEGIN
CHANGELOG_END

* updated bazelignore

* SDK_VERSION -> SDKVERSION
2020-01-21 22:23:51 +01:00
Robin Krom
ad9325275a
language: put sdk versions into package.json (#4122)
* language: put sdk versions into package.json

The typescript library versions of our support libraries are now given
by the sdk version.

CHANGELOG_BEGIN
CHANGELOG_END

* removed local field

* better placeholders

* consistent SDK_VERSION

* sed sdkversion in test script
2020-01-21 15:41:40 +01:00
Martin Huschenbett
3d2131fdbd
Remove pseudo* functions from daml-ledger-fetch (#4130)
Since the JSON API supports `fetchByKey` and `exerciseByKey` now, we don't
need the `pseudo*` versions of these functions anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 15:25:40 +01:00
Andreas Herrmann
e005d4c03b Define and use eslint_test Bazel macro (#4124)
* Define eslint test case

* Define eslint_test macro

* Eslint test for daml-ledger-fetch

* Fix lint issues

* Deduplicate eslint on language-support/ts

* Use eslint --parser-options to define tsconfigRootDiro

Allows to avoid hard-coding the Bazel package path into the package.json
file. Instead derives the package root from the location of the
tsconfig.json file.

* document eslint

* pass kwargs to _eslint_test

* Add copyright header

CHANGELOG_BEGIN
CHANGELOG_END

* Exclude daml-json-types tests from lint

Otherwise eslint complains about mismatching config in `tsconfig.json`.
The test files are excluded from the project in `tsconfig.json`.

* Fix linter warning in daml-json-types

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-21 13:39:54 +00:00
Robin Krom
7494019302
language: added licenses for ts libraries (#4117)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 13:29:20 +01:00
Martin Huschenbett
b0ade660b8 daml2ts: Fix validation of nested optionals (#4128)
Currently, the validator for `Optional (Optional _)` would allow the value
`[null]`, which is not the JSON encoding for any value of this type.

This PR fixes the issue. Since it detects companion objects for the
`Optional` by means of their JavaScript class, we can also drop the
`isOptional` property from the `Serializable` interface.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-20 23:29:08 +00:00
Martin Huschenbett
92a3628cf2
daml2ts: Add tests for daml-json-types (#4120)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-20 22:24:09 +01:00
Robin Krom
704d576ecd Bazelify daml json types (#4110)
* language: bazel rules for daml-json-types/daml-ledger-fetch

This moves the daml-json-types/daml-ledger-fetch libraries out of the
tests directory and builds them with bazel. We'll rename these libraries
in a follow up PR.

CHANGELOG_BEGIN
CHANGELOG_END

* Update deps.bzl

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* updated package.json

* rename nodejs patch

* update yarn.lock

* update @bazel/bazel dependency

* wrong typescript version in toplevel package.json

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2020-01-20 15:02:33 +00:00
Martin Huschenbett
092973e48d
daml2ts: Isolate tests better (#4111)
* daml2ts: Isolate tests better

Currently, the `sh_test` for `daml2ts` copies too many files into the
temporary directory where the test is run. This can cause issues with
stale files from development experiments being copied into the test.

This PR addresses the issue by exluding some directories which only
contain generated files.

CHANGELOG_BEGIN
CHANGELOG_END

* Exclude `node_modules` from buildifier check

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-20 14:48:21 +01:00
Shayne Fletcher
9478a5f60a Support nested optionals (#4106)
* First cut at generalized type

changelog_begin
changelog_end

* Update code gen and test

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-20 10:25:10 +01:00
Leonid Shlyapnikov
c8c55c4408
Exercise by key (#4049)
* Implement exercise by key

ExerciseCommand got a new required element: `reference` of polymorphic type.

* Add test case: exercise Archive by contractKey

* Add test case for ExerciseCommand JSON protocol

* flatten contract reference in ExerciseCommand JSON protocol

* formatting

* Update exercise by key

* Update documentation

CHANGELOG_BEGIN

- [JSON API - Experimental] Support Exercise by Key. See #4009.

CHANGELOG_END

* Address code review comments
2020-01-18 09:06:52 -05:00
Stephen Compall
0520fdfa84
in query argument, rename %templates to templateIds, and nest query under 'query' field (#4082)
* in query argument, rename %templates to templateIds, and nest query under 'query' field

CHANGELOG_BEGIN
- [JSON API - Experimental] In 'search' endpoint arguments, %templates is now templateIds.
  Additionally, all contract query fields must occur under 'query'.
  See `issue #3450 <https://github.com/digital-asset/daml/issues/3450>`__.
CHANGELOG_END

* fix other old query format usages
2020-01-17 14:34:27 -05:00
Shayne Fletcher
6e79687be9
Add 'isOptional' to 'Serializable<>' (#4079)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-17 07:25:00 -05:00
Shayne Fletcher
09dd123c64
Basic numeric type support : first cut (#4059)
* Basic numeric type support : first cut

changelog_begin
changelog_end

* Post-review fixups

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-16 12:53:31 -05:00
Shayne Fletcher
1542e4c29b daml2ts : sum-of-product rewrite (#4047)
* Wip

* Checkpoint

* It works!

* Refactor

changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-14 21:37:21 +00:00
Samir Talwar
5aa33cf7e9 bindings-rxjava: Attempt to fix the flakiness in BotTest. (#3931)
* bindings-rxjava: Fix warnings and tidy up code in BotTest.

* bindings-rxjava: Complete BotTest.TestFlowable properly.

This avoids a stack trace in the logs.

* bindings-rxjava: Use `should have size` in BotTest.

Better error messages when it fails.

* bindings-rxjava: Use `Eventually` to wait, rather than `Thread.sleep`.

This should hopefully fix the flakiness in this test.
2020-01-13 08:46:31 +00:00
Shayne Fletcher
c261fcda62 Test parameteric sum of product (#4018)
```
CHANGELOG_BEGIN
CHANGELOG_END
```
2020-01-10 21:54:32 +00:00
nickchapman-da
006aa9b608
Type checking DAML-LF type synonyms (#3959)
* CHANGELOG_BEGIN
Type-check type synonyms.
CHANGELOG_END

* placate HLint

* comments

* Add an example that requires the check in kindOf

* check types containing syn-apps are well formed even when there is no expression of that type

* show type mismatch error after synonyms are expanded

* typeOf calls expandTypeSynonyms; track vars bound by TForall during expansion

* test interaction of syn-expansion and free-vars; add one bigger testcase

* extend bigger example with pointed typeclass, having functor as a super class

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-01-10 17:51:51 +00:00
Martin Huschenbett
719d1b4b42 daml2ts: Add support for exerciseByKey (#4010)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-10 15:13:29 +00:00
Martin Huschenbett
f7d8f101df
daml2ts: Make the integration tests tighter (#4007)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-10 15:39:27 +01:00
Martin Huschenbett
d2fd744b1f daml2ts: Test that templates in non-top-level modules work (#4006)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-10 10:43:30 +00:00
Leonid Shlyapnikov
93216a0d71
Template ID to JsString JSON serialization (#3991)
* test cases: domain.TemplateId JSON serialization to JsString

* JSON protocol updated

* Fixing json-api test cases

* test cases: domain.TemplateId JSON serialization to JsString

* JSON protocol updated

* Fixing json-api test cases

* Adapt daml2ts and support libraries

* Update documentation

CHANGELOG_BEGIN

[JSON API - Experimental]
- Use JSON string to encode template IDs. Use colon (``:``) to separate parts of the ID.
  The request format, with optional package ID:
  - "<module>:<entity>"
  - "<package ID>:<module>:<entity>"
  The response always contains fully qualified template ID in the format:
  - "<package ID>:<module>:<entity>"
  See #3647.

CHANGELOG_END

* Minor documentation formatting changes.

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-01-09 14:43:41 -05:00
Moritz Kiefer
c5b11aa229 Fix DAML module filename in java codegen tests (#4003)
A mismatch between the module and the filename is already a warning
and will become an error in the future.

changelog_begin
changelog_end
2020-01-09 16:52:11 +00:00
Shayne Fletcher
e0685a327b Implement sums of products (#3992)
```
CHANGELOG_BEGIN
CHANGELOG_END
```
2020-01-09 12:59:32 +00:00
Martin Huschenbett
1d07d82962 daml2ts: Lift type annotation for variant decoders to jtv.oneOf (#3994)
Currently, the generated decoder for, say, `Either` looks like
```ts
() => jtv.oneOf(
  jtv.object<Either<a, b>>(...),
  jtv.object<Either<a, b>>(...),
)
```
After this PR, the generated code will look like
```ts
() => jtv.oneOf<Either<a, b>>(
  jtv.object(...),
  jtv.object(...),
)
```
That saves us a few type annotations but nothing major.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-09 12:22:45 +00:00
Martin Huschenbett
20ad5263d4 daml2ts: Support lookupByKey (#3987)
* daml2ts: Support lookupByKey

We'll add `fetchByKey` and `exerciseByKey` in a separate PR. We'll remove
the `pseudo*` methods in another PR after that one.

CHANGELOG_BEGIN
CHANGELOG_END

* daml2ts: make `lookupByKey` inaccessible for templates without key
2020-01-09 10:51:44 +00:00
Leonid Shlyapnikov
e75b98351c Aligning DB contract table with domain.ActiveContract class (#3989)
* Aligning DB contract table with domain.ActiveContract class

adding key,signatories, observers and agreement_text to DB contract table
removing witnessParties

Reading signatories and observers from contracts table

Updating doc, removing witnessParties

Address code review comments, thanks @S11001001

CHANGELOG_BEGIN

[JSON API - Experimental]
- Align ``contract`` table with ``domain.ActiveContract`` class.
  The database schema has changed, if using ``--query-store-jdbc-config``,
  you must rebuild the database by adding ``,createSchema=true``. See #3754.
- ``witnessParties`` field is removed from all JSON responses.

CHANGELOG_END

* Fix TypeScript domain models

remove witnessParties and workflowId fields. workflowId has be removed
from JSON output a while ago.
2020-01-08 20:39:57 +00:00
Shayne Fletcher
7ed91c1f6d
Daml2ts variant support (#3988)
* Sketch out code generation required for variants

* More testing

* Checkpoint

* Checkpoint.

* Add serialization for variants.

```
CHANGELOG_BEGIN
CHANGELOG_END
```
2020-01-08 13:11:18 -05:00
Martin Huschenbett
1f817ecbe8 daml2ts: Use master version of damlc in watch-damlc.sh (#3979)
So far, we've used the version of damlc installed with the SDK on the
devs machine. This lead to hard to debug version mismatches. This PR
changes `watch-damlc.sh` to use `bazel run //:damlc` instead.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-08 13:08:24 +00:00
Leonid Shlyapnikov
2c154f2299 Rename argument to payload in domain.ActiveContract (#3971)
CHANGELOG_BEGIN

[JSON API - Experimental] Rename ``argument`` in active contract to ``payload``. See #3826.

CHANGELOG_END
2020-01-08 13:59:27 +01:00
Shayne Fletcher
9c30a7096b Revert "Better handling of recursive return types (#3968)" (#3972)
This reverts commit 17a5abf25a.
```
CHANGELOG_BEGIN
CHANGELOG_END
```
2020-01-08 11:48:48 +01:00
Shayne Fletcher
17a5abf25a
Better handling of recursive return types (#3968)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-07 13:58:51 -05:00
Moritz Kiefer
a8b4a84b08
Move most of the remaining serializable types to stable LF packages (#3964)
* Move most of the remaining serializable types to stable LF packages

The only serializable types left in DAML stdlib after this PR are the
following:

- DA.Upgrade:MetaEquiv
- DA.Random:Minstd
- DA.Next.Set:Set
- DA.Next.Map:Map
- DA.Generics:MetaSel0
- DA.Generics:MetaData0
- DA.Generics:DecidedStrictness
- DA.Generics:SourceStrictness
- DA.Generics:SourceUnpackedness
- DA.Generics:Associativity
- DA.Generics:Infix0
- DA.Generics:Fixity
- DA.Generics:K1
- DA.Generics:Par1
- DA.Generics:U1
- DA.Internal.Prelude:Optional

Ignoring the Generics stuff which isn’t very urgent imho and the
Upgrade stuff which is probably going to change significantly anyway,
this leaves us with the weird Random module, the wrappers around
TextMap which will go away anyway and DA.Internal.Prelude:Optional
which shouldn’t exist in the first place (I’ll address that in a
separate PR).

CHANGELOG_BEGIN

- [DAML Compiler] Move more types from daml-stdlib to standalone LF
packages. The module names for the types have also changed
slightly. This only matters over the Ledger API when you specify the
module name explicitly. In DAML you should continue to use the
existing module names.

  - The types from ``DA.Semigroup` are now in a separate package under
  ``DA.Semigroup.Types``
  - The types from ``DA.Monoid` are now in a separate package under
  ``DA.Monoid.Types``
  - The types from ``DA.Time` are now in a separate package under
  ``DA.Time.Types``
  - The types from ``DA.Validation` are now in a separate package
  under ``DA.Validation.Types``
  - The types from ``DA.Logic` are now in a separate package under
  ``DA.Logic.Types``
  - The types from `DA.Date` are now in a separate package under
  `DA.Date.Types`.
  - The `Down` type from `DA.Internal.Prelude` is now in a separate
  package under `DA.Internal.Down`.

CHANGELOG_end

* Fix serializability of RelTime

* fix daml-docs

* Fix tests
2020-01-07 18:25:23 +01:00
Martin Huschenbett
8cb70df0fa
daml2ts: Enforce that template types are records at the type level (#3960)
The DAML-LF spec says that templates types must be records. Let's enforce
this property in the generated TypeScript on the type level as well.
2020-01-07 14:32:49 +01:00
Martin Huschenbett
f09433e8da daml2ts: Slightly prettify output (#3957) 2020-01-07 10:22:32 +00:00
Andreas Herrmann
f33e79c787
Remove unused dependencies to da_scala_library (#3938)
* Inline all scala_library dependencies

* Run //:buildifier-fix

* TMP scala_library_suite --> scala_library

* da_scala_library: Enable unused dependency checker

* scala_library: Enable unused dependency checker

* //daml-lf/data:data

* //daml-lf/engine:engine

* //ledger-api/rs-grpc-akka:rs-grpc-akka

* //ledger/participant-state:participant-state

* //ledger/ledger-api-client:ledger-api-client

* //scala-protoc-plugins/scala-logging:scala-logging-lib

* //ledger/ledger-api-scala-logging:ledger-api-scala-logging

* //ledger/ledger-api-common:ledger-api-common

* //ledger-service/utils:utils

* //ledger-service/jwt:jwt

* //ledger/ledger-api-auth:ledger-api-auth

* //extractor:extractor

* //daml-assistant/scala-daml-project-config:scala-daml-project-config

* //language-support/codegen-common:codegen-common

* //language-support/scala/codegen:codegen

* //language-support/codegen-main:codegen-main-lib

* //ledger-service/db-backend:db-backend

* //ledger-service/http-json:http-json

* //daml-lf/scenario-interpreter:scenario-interpreter

* //ledger/sandbox:sandbox

* //navigator/backend:navigator-library

* //daml-assistant/daml-sdk:sdk-lib

* //daml-lf/data-scalacheck:data-scalacheck

* //daml-script/test:test-lib

* //ledger/ledger-api-common:ledger-api-common-scala-tests-lib

* //ledger/test-common:test-common

* //ledger/sandbox:sandbox-scala-tests-lib

* //extractor:extractor-scala-tests-lib

* //language-support/java/bindings:bindings-java-tests-lib

* //language-support/java/bindings-rxjava:bindings-java-tests-lib

* //language-support/scala/bindings-akka-testing:bindings-akka-testing

* //language-support/scala/codegen-testing:codegen-testing

* //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app

* //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app-testing

* //language-support/scala/codegen-testing:codegen-testing-testing

* //ledger-api/sample-service:sample-service

* //ledger-api/rs-grpc-akka:rs-grpc-akka-tests-lib

* //ledger/ledger-api-test-tool:ledger-api-test-tool-lib

* //ledger/ledger-api-test-tool:ledger-api-test-tool-tests

* //ledger/participant-state/kvutils:kvutils

* //ledger/sandbox:ledger-api-server

* //ledger/sandbox-perf:sandbox-perf-lib

* //navigator/backend:navigator-tests-library

* UNDO scala_library_suite --> scala_library

This reverts commit ab3eb1ae23139e2ec431ab4551fbb0371e0354e1.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 18:14:21 +01:00
Andreas Herrmann
43bbfeaee6
Remove unused dependencies to da_scala_binary (#3937)
* Inline all scala_binary dependencies

* Run //:buildifier-fix

* da_scala_binary: Enable unused dependency checker

* //compiler/scenario-service/server:scenario-service-raw

* //language-support/scala/codegen:codegen-main

* //daml-lf/encoder:encoder_binary

* //daml-lf/repl:repl

* //language-support/codegen-main:codegen-main

* //language-support/scala/examples:quickstart-scala-bin

* //ledger-api/rs-grpc-akka:rs-grpc-akka-perf

* //ledger-service/jwt:jwt-bin

* //ledger/api-server-damlonx/reference-v2:reference-v2

* //ledger/api-server-damlonx/reference-v2:ephemeral-postgres-reference-server

* //ledger/ledger-api-auth:ledger-api-auth-bin

* //ledger/ledger-api-test-tool:ledger-api-test-tool

* //ledger/participant-state/kvutils/tools:integrity-check

* //navigator/integration-test:navigatortest-jar

* Run //:buildifier-fix

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 13:58:56 +01:00
Moritz Kiefer
42c586f8d4
Bump ghcide (#3943)
* Bump ghcide

* Fix ghcide build

* Include bugfix for Windows
2020-01-04 07:51:51 +01:00
Gary Verhaegen
878429e3bf
update copyright notices to 2020 (#3939)
copyright update 2020

* update template
* run script: `dade-copyright-headers update .`
* update script
* manual adjustments
* exclude frozen proto files from further header checks (by adding NO_AUTO_COPYRIGHT files)
2020-01-02 21:21:13 +01:00
Andreas Herrmann
9fbb787062 Remove unused dependencies to da_scala_test(_suite) (#3925)
* Remove unused scala.bzl imports

* override_targets org.scalatest.scalatest_2.12

Otherwise, rules_scala implicitly adds a different version to scala_test
than other packages transitively depending on scalatest. This causes
unused dependency checker to raise an error.

* Handle rules_scala scalatest in pom_file.bzl

* Inline all scala_test dependencies

So that `unused_dependency_checker = "error"` can be applied to them.

* Run //:buildifier-fix

* TMP scala_test_suite --> scala_test

* da_scala_test: Enable unused dependency checker

* //navigator/backend:navigator-scala-tests

* //ledger/sandbox:sandbox-scala-tests

* //ledger/participant-state/kvutils:kvutils-tests

* //ledger/participant-state:participant-state-tests

* //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test

* //ledger/ledger-api-common:ledger-api-common-scala-tests

* //ledger/ledger-api-client:ledger-api-client-tests

* //ledger/ledger-api-auth:ledger-api-auth-scala-tests

* //ledger-service/lf-value-json:tests

* //ledger-service/jwt:tests

* //ledger-service/http-json:tests

* //ledger-api/rs-grpc-akka:rs-grpc-akka-tests

* //language-support/scala/codegen-sample-app:tests

* //language-support/scala/codegen-sample-app:ScalaCodeGenIT

* //language-support/scala/codegen:tests

* //language-support/scala/bindings-akka:tests

* //language-support/java/codegen:test

* //language-support/java/codegen:ledger-tests

* //language-support/java/bindings-rxjava:bindings-java-tests

* //language-support/codegen-common:test

* //extractor:extractor-scala-tests

* //daml-lf/scenario-interpreter:scenario-interpreter_tests

* //daml-lf/language:language-test

* //daml-lf/interface:tests

* //daml-lf/engine:tests

* //daml-lf/encoder:tests

* //daml-lf/archive:daml_lf_archive_reader_tests

* //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests

* UNDO scala_test_suite --> scala_test

This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 13:49:59 +00:00
Rohan Jacob-Rao
6c480cf9ae
Fix typos in daml2ts readme (#3927) 2019-12-27 11:10:32 -05:00
Leonid Shlyapnikov
f22d52a2ff Change variant JSON encoding, so it is easier to pattern match on it in TypeScript (#3882)
* Change variant json encoding,

adding integration test

* Add DamlLfTypeLookup dependencies

* Add MetadataReader

* Add test WIP

* Add serialize test cases

* Add serialize test cases, WIP

* Test for variant encoding decoding

* Solving merge conflicts

* Updating roundtrip test

* Minor cleanup

* Addressing code review comments

Add JsonVariant custom matcher

* Update specification

* Update link

* Add test case, WIP

* Add proper template key resolution

* Got rid of choice record ID resolution, resolving choice type and key type

* Fixing logging

* Add Contract Key decoding tests

* cleanup

* cleanup

* Update JSON variant encoding tests

* Add more contract key JSON decoding tests

* Fix variant JSON encoding

* Change value predicate to support new variant encoding

* Change value predicate to support new variant encoding

* Add lookup by contract key test case

where contract key contains variant and record

Add `requiredResource` to bazel utils

CHANGELOG_BEGIN

- [JSON API - Experimental] Change variant JSON encoding. The new format is ``{ tag: data-constructor, value: argument }``.
  For example, if we have: ``data Foo = Bar Int | Baz``, these are all valid JSON encodings for values of type Foo:
  - ``{"tag": "Bar", "value": 42}``
  - ``{"tag": "Baz", "value": {}}``
  See #3622

- [JSON API - Experimental] Fix ``/contracts/lookup` find by contract key.

- [JSON API - Experimental] Fix ``/command/exercise`` to support any LF type as a choice argument.
  See #3390

CHANGELOG_END

* minor cleanup

* Fix copy/paste

* Renaming

* Got rid of DAML LF identifier resolution

resolving DAML LF Type based on command type

* Address code review comments, thanks @S11001001

* Address code review comments, thanks @S11001001

Do not include any error handling here; this partial function should
only match the successful case, JsonVariant.

* Address code review comments, thanks @S11001001

comment

* Address code review comments, thanks @S11001001

using `JsonVariant` for variant encoding/decoding

* Address code review comments, thanks @S11001001

replace `find` and `map` chain with collectFirst

* Update docs/source/json-api/lf-value-specification.rst

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

Co-authored-by: Stephen Compall <scompall@nocandysw.com>
2019-12-24 20:55:44 +00:00
Samir Talwar
1794d8a2fd Sandbox: Manage resources and close them properly on failure. (#3871)
* sandbox: Create a monadic `ResourceOwner` to manage resources.

* sandbox: Rewrite `ResourceOwner` to be async.

* sandbox: Make sure failed resources are closed immediately.

* sandbox: Better naming in `Open`.

* sandbox: Rename `Open` to `Resource`, and open/close to acquire/release.

* sandbox: Convert `() => AutoCloseable` into `ResourceOwner`.

* sandbox: Refactor the LedgerApiServer in terms of resources.

* sandbox: Explicitly convert `() => AutoCloseable` to `ResourceOwner`.

Explicit > Implicit, right?

* sandbox: Create helpers for converting things to ResourceOwners.

Because I tried to start using them and there was so much code being
written at once.

* sandbox: Simplify construction of JdbcLedgerDao.

* sandbox: Releasing resources should be idempotent.

In that we should only do it once.

* sandbox: Fix the ResetService by closing the API services _first_.

They need to be shut down before the gRPC server.

* sandbox: Don't try and shut down PostgreSQL twice in tests.

* sandbox: Actually run the assertions in ResourceOwnerSpec.

Facepalm.

* sandbox: Test `Resource.sequence` more rigorously.

* sandbox: Move the helpers around `Resource` into `Resource.apply`.

* sandbox: Convert LedgerApiServer resource owners to classes.

* sandbox: Make `ResourceOwner` a monad too, delegating to `Resource`.

* sandbox: Turn `LedgerApiServer` into a ResourceOwner.

* sandbox: Simplify the public signature of `Resource.apply`.

* sandbox: Use ResourceOwners to simplify DB resource management.

This is one hell of a change. Sorry.

* sandbox: Try not to nest `Await.result` calls.

Causes issues when running in a `DirectExecutionContext`.

* sandbox: Turn index subscriptions into resources.

* sandbox: Fix warnings in RecoveringIndexerSpec.

* sandbox: Always release before recovering the indexer.

* sandbox: Add `flatten` and `transformWith` to `Resource`.

* sandbox: If releasing twice in parallel, the second should wait.

* sandbox: If the indexer recovers, clean up the old subscription.

* sandbox: Convert StandaloneIndexerServer into a resource owner.

* sandbox: Convert StandaloneApiServer into a resource owner.

* reference-v2: Rewrite ReferenceServer in terms of resources.

CHANGELOG_BEGIN

- [Reference v2] On an exception, shut down everything and crash.
  Previously, the server would stay in a half-running state.

CHANGELOG_END

* sandbox: Rewrite SandboxServer in terms of resources.

* sandbox: Write the port file in a Future.

* sandbox: JdbcIndexer no longer needs to manage the actorSystem.

* sandbox: Shut down the LedgerApiServer when closing the Sandbox.

* sandbox: Rename `Resource.pure` to `Resource.successful`.

* sandbox: Rename `Resource.sequence_` to `sequenceIgnoringValues`.

* sandbox: Delete `CloseableResource`.

It's only used in once place. Just inline it.

* sandbox: `LedgerDao` no longer needs to be closeable.

* sandbox: Delete implicit materializers where they're not used.

* http-json: Wait for the Sandbox to start in tests.

* sandbox: Convert `scheduleHeartbeats` into a ResourceOwner.

* reference-v2: Explain why we steal ownership of the actor system.

* sandbox: Document why we only release resources once.

* sandbox: Add clues to ResourceOwnerSpec.

* http-json: Fix HttpServiceTestFixture to pass auth service through.

* codegen-sample-app: In ScalaCodeGenIT, wait for the server to  start.
2019-12-22 15:05:55 +00:00
Martin Huschenbett
f725137795 daml2ts: Do some maintenance tasks in daml-ledger-fetch (#3922)
Fix a few todos. Remove a few useless lambdas. Use newer syntax.
2019-12-20 18:44:17 +00:00
Martin Huschenbett
02d72e3a55 daml2ts: Clean up yarn.lock for support libraries (#3921) 2019-12-20 17:08:56 +00:00
Shayne Fletcher
11681c6aa3
Add 'R' to 'Choice<T,C,R>' defn (#3895)
* 'Choice<T,C,R>' defn

* Speculative. Account for the absence of tuples

* Finalize the exercise decoding and add a test

* Shorter version of bazel bootstrap (recommended by AH)

* argDecoder => argumentDecoder

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/generated/src/__tests__/test.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/generated/src/__tests__/test.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Remove spurious return

* argDecoder => argumentDecoder

* Note to self : don't accept suggestions, implement them yourself

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-12-20 08:48:23 -05:00
Brian Healey
9f13a2fb10 Upgrade to Akka 2.6.1, akka-http 10.1.11 and Scala 2.12.10 (#3903)
* Upgrade to Akka 2.6.1, akka-http 10.1.11 and Scala 2.12.10

Akka 2.6.1 Upgrade Changes
- Materializer in place of ActorMaterializer
- Source.future instead of Source.fromFuture
- The Scheduler.schedule method has been deprecated in favor of selecting scheduleWithFixedDelay or scheduleAtFixedRate
- onDownstreamFinish(cause: Throwable)
- ActorAttributes.supervisionStrategy(...) in place of ActorMaterializerSettings.withSupervisionStrategy

See https://doc.akka.io/docs/akka/current/project/migration-guide-2.5.x-2.6.x.html

* Akka 2.6.1 Upgrade Changes
- onDownstreamFinish(cause: Throwable)

See https://doc.akka.io/docs/akka/current/project/migration-guide-2.5.x-2.6.x.html

* code review: remove unnecessary supervision strategy
2019-12-19 18:00:59 +00:00
Moritz Kiefer
c48b0ee289 Move Any wrappers and Archive to stable packages (#3890)
* Move Any wrappers and Archive to stable packages

There are no actual API or functionality changes in this PR but the
logic for locating the stable packages has slightly changed since the
Any wrappers package only makes sense for LF 1.7. To address this, we
simply filter out stable packages for newer LF versions since it
doesn’t make sense to depend on those anyway.

CHANGELOG_BEGIN

- [DAML Compiler] Move ``Archive`` type to a separate DALF.

CHANGELOG_END

* More comments

* Fix java codegen tests

* fix more tests

* Force cache reset on Windows

* Revert "Force cache reset on Windows"

This reverts commit 9f2b7d70b2.
2019-12-19 01:26:38 +00:00
Martin Huschenbett
00f23ef7d5
Rename Contract type to CreateEvent and move it to daml-ledger-fetch (#3869)
What was called `Contract` until now is actually a create event. Hence the
renaming. We'll most likely get a `Contract` type in DAML as well and this
renaming will avoid a name conflict. Also, create events are not part of
DAML-LF values and hence not generated by `daml2ts`. Thus, there's not need
to have them in `daml-json-types`. Instead, they should be in a future
`daml-json-api-types` package which captures the types used by the JSON API.
2019-12-17 15:05:32 +01:00
Martin Huschenbett
6d83a7bf47
Move daml-json-types to TypeScript 3.7.3 (#3856)
This should have happened in a previous PR, but I missed it.
2019-12-17 08:47:41 +01:00
Robin Krom
bbb6e27d04
language: daml2ds: Removal of accidentally slipped in dependencies (#3862)
These seem to have slipped in when running yarn locally.
2019-12-16 15:40:49 +01:00
Robin Krom
881d36eab4
language: daml2ts: support for enum types (#3852)
* language: daml2ts: support for enum types

This adds support for enum types to daml2ts. daml-lf enums are converted
to typescript enums and a decoder defined in the same namespace.

* static serializable check for enums and better tests
2019-12-16 13:57:25 +01:00
nickchapman-da
1369351f70
separate type-synonyms from type-constructors (#3829)
* separate type-synonyms from type-constructors in DAML-LF .proto and Haskell AST

* comments
2019-12-16 11:52:28 +00:00
Samir Talwar
71e8c20127 Sandbox: Fix warnings in SandboxServer. (#3853)
* sandbox: Move SandboxServer's helper classes to the companion object.

And make them `private`, `final`, and non-`case`.

* sandbox: Drop SandboxServer.apply and just call the constructor.

* sandbox: Move the SandboxServer#SandboxState class into the object.

Leave the `resetAndRestartServer` method behind, though.
2019-12-14 20:52:03 +00:00
Martin Huschenbett
44005348a3
daml2ts: Upgrade to TypeScript 3.7 (#3854)
Also upgrade ESLint to the newest version and its plugins to the newest
version.
2019-12-13 23:01:05 +01:00
Martin Huschenbett
05860d1df4
daml2ts: Tie the knot between templates and their choices without hacks (#3839)
In the code generated by `daml2ts`, every template companion object lists
all its choices and every choice has a pointer back to the companion object
of its template. Thus, there's a knot to tie.

So far, we initialized the choices as `undefined` and later mutated them to
point to the template companion object. This feels kind of hacky,
particularly since we end up with cyclic values.

This PR pushes the pointer from the choice back to the template companion
object behind a lambda. This makes the hack unnecessary and removes the
cyclic values.
2019-12-13 12:03:51 +01:00
Jussi Mäki
ce70ad4a2f
Async package management (#3806)
* Add package_entries table

* Change PublicPackageUpload event to cover list of packages.

Add PublicPackageUploadRejected.

* Produce new package update events in KeyValueConsumption

* Update signature of uploadPackages

* Cleanup InMemoryKVParticipantState. Add submissionId to uploadPackages.

* Fix up InMemoryKVParticipantStateIT

* Initial ledger dao changes for package entries

Drop the participant_id as we never expect to see
entries of other participants. This should be done
for party_entries as well.

* Drop UploadPackagesResult

* Implement getPackageEntries and refactor callers

* Add maxRecordTime to uploadPackages

* First cut at updating ApiPackageManagementService

* Update tests, wire through the packageEntries

* Don't extend IndexPackagesService in InMemoryPackageStore

It does not implement the full interface and it isn't used
directly as one anyway.

* Drop maximum_record_time from package_management_service

Adding maximum record times touches the whole stack. Leaving
this change to another PR.

* Wire through the removal of maximum_record_time.

And remove dead code from InMemoryKVParticipantState

* Remove checking for duplicate package uploads

This aligns with the behaviour of WriteService.

* Reformat

* Fix PackageManagementService after adding of submission_id to the service
2019-12-13 09:56:47 +01:00
Martin Huschenbett
3722f32429
daml2ts: Add more tests (#3832) 2019-12-12 18:42:27 +01:00
Gary Verhaegen
2b3693bf4d
restore 0.13.38 logging defaults for daml jars (#3819)
CHANGELOG_BEGIN
- [Sandbox] Restore 0.13.38 logging behaviour.
- [Navigator] Restore 0.13.38 logging behaviour.
- [Extractor] Restore 0.13.38 logging behaviour.
- [Internals] As of 0.13.39, we merged a number of internal JAR files in
  the SDK tarball to reduce its size. These jars used to be standalone
  JARs you could invoke as e.g. ``java -jar sandbox.jar <args>``. As a
  result of merging the jars, they lost their individual ``logback.xml``
  configuration file. Although running the jars directly was (and is
  still) not supported, note that you can now achieve the same behaviour
  with e.g. ``java -Dlogback.configurationFile=sandbox-logback.xml -jar
  daml-sdk.jar sandbox <args>``.
CHANGELOG_END
2019-12-12 14:02:23 +01:00
Leonid Shlyapnikov
0b172da49a Add ExceptionOps to extract exception details safely (#3822)
* Add ExceptionOps to extract exception details safely

`Throwable.getMessage` can return `null` which caused unexpected NPE
in JSON API error handling

* Fix formatting

* Remove show instance

* Addressing code review comments,

thanks Stefano!
2019-12-11 18:38:44 +00:00
associahedron
08ee42fb30 Implement missing genmap fns (#3807) 2019-12-11 11:16:25 +00:00
Remy
94aea562d6 scala codegen: add GenMap support (#3522)
* scala codegen: add GenMap support

* scala-codegen: use InsertOrdMap as underlying of Generic Map binding

* Address Stephen's comments

* make TextMap a strict subtype of immutable.Map to avoid overlap with GenMap

Otherwise, attempted GenMap encodings like
`Value.encode(InsertOrdMap("foo" -> "bar"))` (and any contract
containing such a structure) are either ambiguous or, worse, yield the
wrong result.

* ensure better return types for InsertOrdMap and similar wrappers' operations

* if is an expression

* adapt various primitive encodings to newtype TextMap

* easy cleanups of the TextMapApi

* proper alias for deprecated Map

* update deprecation releases

* Revert "proper alias for deprecated Map"

This reverts commit e85aa85b960c4bf5c4f9624896183ec6e2182bba.

* remove useless invisible deprecated notice

* add generic map tests for scala codegen

* please restart CI
2019-12-11 09:22:38 +00:00
Leonid Shlyapnikov
dcc7dc913f
Add choice result to the exercise response (#3757)
* Adding choice result to the exercise response, WIP

* Adding choice result to the exercise response, WIP

* Refactoring towards #3390,

ExerciseCommand argument does not always have to be a Record, changing
typearg: JsObject -> JsValue

* Cleanup

* exercise-with-result endpoint

* todo

* Switching /commands/exercise to use SubmitAndWaitForTransactionTree,

populating archived and created from TransactionTree

* removing debug println

* Fixing tests

* Removing `/command/exercise-with-result` endpoint

this one returns only exercise result, `/command/exercise` now returns
exercise result and events

* Updating docs

* Updating docs

CHANGELOG_BEGIN

- [JSON API - Experimental] Expose exercise result. Changed the output
of the ``/command/exercise``. Note ``exerciseResult`` and ``contracts``
in ``{"status":200,"result":{"exerciseResult": ...,"contracts":[...]}``.
See #3314

CHANGELOG_END
2019-12-10 10:09:24 -05:00
Martin Huschenbett
0b63fa432b
daml2ts: Add instructions on how to develop (#3799) 2019-12-10 12:52:03 +01:00
Moritz Kiefer
e769264ddf Move all datatypes out of daml-prim (#3791)
* Move all datatypes out of daml-prim

This moves the remaining two modules DA.Types and GHC.Tuple to
separate LF packages with stable identifiers.

The only data types remaining are the ones for typeclasses which will
disappear once we move this to type synonyms.

CHANGELOG_BEGIN

- [DAML Compiler] The modules DA.Types and GHC.Tuple from daml-prim
have been moved to separate packages.

CHANGELOG_END

* Fix codegen tests

* Fix DarReader test

* Fix kvutils tests

* Fix jdbcdao tests

* Fix hs ledger bindings tests
2019-12-10 09:19:16 +01:00
Stefano Baghino
6e17cdba90
Fix typo in JavaDoc (#3793) 2019-12-09 17:58:33 +01:00
Robert Autenrieth
bf2098f038
Check ledger and participant ID in claims (#3781)
* Add ledger and participant ID to claims

CHANGELOG_BEGIN
- [Ledger] AuthService implementations can now restrict the validity of access tokens to a single ledger or participant.
- [Sandbox] The sandbox JWT authentication now respects the ledgerId and participantId fields of the token payload.

CHANGELOG_END

* Add tests for ledger and participant in claims

* Address review comment

* Address review comment

* Fix tests

* Fix tests
2019-12-09 17:55:17 +01:00
Stefano Baghino
18824016c1 Ensure the access token is initialized when constructing a client (#3788)
* Ensure the access token is initialized when constructing a client

CHANGELOG_BEGIN
- [Java Client] Ensure the access token is initialized when using a
deprecated constructor.
CHANGELOG_END

* Improve phrasing and grammar
2019-12-09 14:14:45 +00:00
Martin Huschenbett
0211e1337d Move the bazel aliases for yarn and java to the root BUILD file (#3786)
Replicating the yarn alias in multiple places doesn't make sense.
2019-12-09 13:22:21 +00:00
Martin Huschenbett
19d2a22b0b
daml2ts: Add E2E tests (#3776)
* daml2ts: Add E2E tests

* Attempt to fix failing test

* Don't try to delete the temp directory

* Cleanup block can't be empty

* Leave TMP_DIR before removing it
2019-12-07 18:34:40 +01:00
Gerolf Seitz
9d926d81b0 RxJava Bindings: Allow bot to run on a scheduler (#3404)
* RxJava Bindings: Allow bot to run on a scheduler

It seems that having many bots results in a some sort of deadlock
or blocking of data flow within the flowable network.

Adding some async boundaries to allow for concurrent processing
seems to help.

Fixes #2356

CHANGELOG_BEGIN
- [RxJava Bindings] Added a method to the ``Bot`` class allowing users to specify a ``Scheduler`` to use for running the bot. See `issue #2356 <https://github.com/digital-asset/daml/issues/2356>`__.
CHANGELOG_END

* Go easy, test!
2019-12-06 16:30:25 +00:00
Gerolf Seitz
658365e5eb Java codegen fixes (#3762)
* Fix compiler warnings in generated enums

* Fix warnings in generated equals method for parameterized types.

* Remove warning in equals for records without fields.

CHANGELOG_BEGIN
- [Java Bindings] Removed warnings in code emitted by the Java Codegen.
CHANGELOG_END

* fix compilation error in tests
2019-12-06 15:10:38 +00:00
Stefano Baghino
da9306414b Add authentication support to DamlLedgerClient (#3743)
Add documentation

CHANGELOG_BEGIN
- [Java Bindings] Added authentication support. See `issue #3626 <https://github.com/digital-asset/daml/issues/3626>`__.
CHANGELOG_END
2019-12-05 10:57:51 +00:00
Stefano Baghino
94aafd8121 Add authentication support to Java transaction client (#3733)
* Add authentication support to Java transaction client

* Address https://github.com/digital-asset/daml/pull/3733#discussion_r354182366
2019-12-05 10:17:30 +00:00
nickchapman-da
1684b2290a daml assistant: expect auth token in Bearer format (#3736)
* daml assistant expected auth token in Bearer format

* Daml assistant does no validation of the auth token before passing in on to the ledger.

* clarify code with newtype Token
2019-12-05 09:19:02 +00:00
Robin Krom
ed4397b2eb language: add registerTemplate for daml2ts (#3737) 2019-12-05 09:07:16 +01:00
Moritz Kiefer
ba30e86911
Split wired-in modules into separate LF packages (#3696)
This is a first step towards making sure that the package ids for
types defined in daml-prim and daml-stdlib don’t change. This PR
mostly adds all the necessary infrastructure for that and moves
GHC.Types and GHC.Prim to make sure it works.

Until data-dependencies are really solid and we have verified that we
no longer have performance issues with an increasing number of Haskell
packages, we still include the source files in daml-prim and then just
rewrite the references.

We will also need to add tests that these packages really have stable
ids but I’ll leave that for separate PRs since this doesn’t make that
much sense anyway until all of the types have moved to stable
packages.

CHANGELOG_BEGIN

- [DAML Compiler] The modules GHC.Prim and GHC.Types from daml-prim
have been moved to separate packages.

CHANGELOG_END
2019-12-04 16:42:48 +01:00
Martin Huschenbett
5c02b1a1c3 Make the daml2ts tests fail on generated unused imports/definitions (#3714)
* Make the daml2ts tests fail on generated unused imports/definitions

* Shut up buildifier
2019-12-04 14:08:50 +00:00
Robert Autenrieth
a827040e4c
Add authentication docs (#3661)
* Add authentication docs

* Use anonymous references

* Update obsolete info on authentication

* Improve authentication intro
2019-12-04 14:51:19 +01:00
Stefano Baghino
50d689d011 Optimize imports in //language-support/java/bindings-rxjava (#3728) 2019-12-04 11:08:13 +00:00