Commit Graph

2392 Commits

Author SHA1 Message Date
Moritz Kiefer
c501866608 Trim exports from Upgrade module (#3551)
None of those functions are actually used outside the module and I
prefer seeing the actual external API.
2019-11-20 14:54:27 +00:00
Andreas Herrmann
6c2f4ebe8f Fix pip and pipenv (#3366)
* Fix pip and pipenv

Since the latest nixpkgs update pip is no longer contained in the python
derivation but instead in its own `python37Packages.pip` derivation.

Additionally the pipenv version in nixpkgs is incompatible with the pip
version, as pipenv expects a module to be present which is only
available in later versions. This change overrides pip with a version
update to fix this issue.

Upstream nixpkgs has already updated pip accordingly

* Update nixpkgs

The versions of `pipenv` and `pip` contained in `nixpkgs` where
previously incompatible. They are compatible in the new `nixpkgs`
revision.

Just overriding the pip version caused too many uncached rebuilds and
timed out on CI.

* Update nixpkgs further

To incorporate
efce3c1367

* Try to build fewer GHCs

* nix: drop sass override

nixpkgs-unstable is on the same page.

* nix: use upstream chromedriver

* nix: remove pex override

* nix: drop pypi2nix override

* Fix bazel-watcher

* try upgrading rules go

* Remove overrides for ibazel

* Upgrade rules_go

* Remove references to sass overrides
2019-11-20 15:27:32 +01:00
Miklos
a7ae9c5fba
Improve DAML SDK documentation (#3509)
Improved DAML SDK documentation, focusing on quickstart guide:
- Corrected typos.
- Corrected some broken links.
- Made sample code formatting consistent (variable naming, comments).

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>
2019-11-20 14:57:57 +01:00
mziolekda
a217187b26
add error codes for overloaded and internal error to participant state (#3524)
* add error codes for overloaded and internal error

* change wording in error description strings

* scala formatting

* use string interpolation intead of concatenation

* address issues found in peer review
2019-11-20 14:37:00 +01:00
Moritz Kiefer
f94b832201 Include contract ids in DAML script’s query (#3546) 2019-11-20 11:07:52 +00:00
Moritz Kiefer
6d2ed90f29 Remove target flags in DAML triggers and DAML script (#3545)
1.7 is now the default so we no longer need those.
2019-11-20 10:54:16 +00:00
Moritz Kiefer
1bc4bb76a4 Make AnyChoice and AnyContractKey take template type into account (#3541)
* Make AnyChoice and AnyContractKey take template type into account

fixes #3540

* Update template desugaring

* Switch to proper ghc-lib release
2019-11-20 10:40:14 +00:00
Oliver Seeliger
917c43a048
Ledger api tool transaction test fixes: (#3542)
- moved comparableTransaction[tree]s helpers to companion object
  as suggested in https://github.com/digital-asset/daml/pull/3475#pullrequestreview-317474464
- applied helpers to two additional tests
- strip offset in addition to command-ids as offsets drift apart over time
  depending on differing heartbeats and different sets of hosted party and thus different
  party-relevant events
- modified two tests to be single-node as look-up by transaction/eventid assumes the events
  are available locally
2019-11-20 10:42:47 +01:00
nickchapman-da
e2a8cc29e5
Choice instances for cross sdk (#3477)
* generate choice instances for cross sdk dependencies

* add line to test cross-sdk exercise of choice

* revert to naming choice in GenerateSimpleDalf as "NotChoice"

* remove filter/special-handlimg for "Archive" choice

* dont assume a tycon with the same name as a choice; instead use type from chcArgBinder

* error if cant find the template datatype def

* naming

* avoid intercalate followed by re-split on "." in module name

* GenerateSimpleDalf: have two choices: one of record type, one of variant type

* Update Upgrade.hs

* added some linebreaks, spaces for readability

* address cosmetic comments

* use Sdk. prefix as necessary so tests work

* mollify hlint

* fix: daml-assistant/integration-tests
2019-11-20 07:29:56 +00:00
Rohan Jacob-Rao
fa8be840a8 Change title of release notes tab (#3535)
* Change title of release notes tab

This suggests that a new release is available, but not necessarily
installed. We do this for the case that the extension is updated
(which triggers the tab to open) but the actual SDK is not.

* Keep 'New'

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-11-19 22:00:53 +00:00
Leonid Shlyapnikov
a849bb86e4 JSON API: quit immediately after creating schema (#3534)
* quitting after create schema

* better error codes

* quitting after create schema

* better error codes

* explicitly creating schema during integration testing

* Updating release notes and CLI help

* Updating release notes

* minor update

* Fixing formatting

* update
2019-11-19 21:39:18 +00:00
Stephen Compall
1b6e4523ed replace JSON witnessParties column with a text[] column (#3461)
* replace JSON witnessParties column with a PG text[] column

* notes about the concurrent behavior of updateOffset

* include witness party in selectContracts query

* fmt

* fix witness_parties fetching in http-json tests

* release note

* typo in prior release note

* move new release note to bottom
2019-11-19 19:53:43 +00:00
Moritz Kiefer
8615266230 Switch the default DAML-LF version to 1.7 (#3530) 2019-11-19 19:18:07 +00:00
Samir Talwar
fbd6d77e62 ledger-api-test-tool-on-canton: Download Canton from canton.io. (#3533)
So we don't interfere with Canton download metrics.
2019-11-19 17:40:08 +00:00
Moritz Kiefer
7deca903bb Add documentation for DAML script and bundle it in the SDK (#3527) 2019-11-19 17:19:57 +00:00
Jussi Mäki
ff03ed5f3f
Add party to participant mappings as submission inputs (#3456)
* Add InsertOrdSet

A set with deterministic ordering.

* Add party to participant mappings as inputs to kvutils submissions

* Add InsertOrdSetTest, remove fromSet. Sort packages and parties.

* Apply suggestions from code review

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Add AbstractSet and SetLike traits to InsertOrdSet. Remove (Non)EmptyInsertOrdSet.
2019-11-19 18:03:58 +01:00
Brian Healey
fc70ec6412 indentation to show continuation (#3517) 2019-11-19 16:43:12 +00:00
Martin Huschenbett
e82630d864
Move the docs for the visualization to the experimental section (#3531) 2019-11-19 17:40:50 +01:00
Stefano Baghino
c51ecd3c58
Extractor with authentication (#3514)
* Make Extractor work against Ledger API servers protected by authentication

* Update changelog

* Address https://github.com/digital-asset/daml/pull/3514#pullrequestreview-318811500

- https://github.com/digital-asset/daml/pull/3514#discussion_r347753205
- https://github.com/digital-asset/daml/pull/3514#discussion_r347753629
- https://github.com/digital-asset/daml/pull/3514#discussion_r347754462

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347755484

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347752424

* Address https://github.com/digital-asset/daml/pull/3514#discussion_r347756328

* Fix docs

* Fix artifacts.yaml
2019-11-19 17:12:25 +01:00
Martin Huschenbett
c33517cf9f MVP for a daml2ts codegen (#3441)
* MVP for a daml2ts codegen

This PR adds an MVP for a codegen for TypeScript.

Given a DAR, daml2ts replicates the structure of the serializable type
definitions in it as TypeScript type definitions following our JSON
representation of DAML-LF types. It also adds decoders for all these types,
which can be used to check where an arbitray JSON value has the given type.
Finally, daml2ts also produces one JavaScript object for each template, which
reflects the type information of that template.

All produces objects implement some interfaces defined in a TypeScript
library currently called `@digitalasset/daml-json-types`. This libary is not
yet uploaded to NPM but rather included in the `tests/ts/daml-json-types`
directory. This libary also contains the JSON decoders for all of DAML-LF's
builtin types.

There are quite a few limitations right now. Most notably, variant and enum
types are not properly typed right now but rather gradually "typed" as
`unknown`. We also don't support nested `Optional`s, the `Numeric` type or
sum-of-product types in DAML. These issues are tracked in #3518.

There is currently one test. It takes a very simple DAML model, generates
the TypeScript for it and checks that it compiles and contains no linter
warnings/errors. Proper integration tests against the JSON API will follow.

* Address @cocreature's comments

* Make test work on Windows
2019-11-19 15:51:17 +00:00
Moritz Kiefer
e4632f5fb2 Include "daml trigger" in "daml --help" (#3528) 2019-11-19 16:19:17 +01:00
Martin Huschenbett
24d22012a8 Upgrade to nodejs-10.16.3 on Windows (#3529)
This matches the version we use on Linux.
2019-11-19 15:08:39 +00:00
Oliver Seeliger
f50901347f
Release lf scalacheck test jars to maven central (#3519)
as they are dependencies used downstream
2019-11-19 13:10:28 +01:00
Bernhard Elsner
db55881e81 Fix missing header margin in certain screen widths (#3520) 2019-11-19 10:07:42 +00:00
Moritz Kiefer
14e502b8b9 Fix protobuf zlib reference (#3521)
Apparently the other URL is broken on CI atm.
2019-11-19 09:23:41 +00:00
Remy
027d63a787 java representation for value GenMap (#3515) 2019-11-19 08:53:15 +00:00
Robin Krom
3d960c708f language: make only needed packages visible for cross sdk imports (#3503)
* language: make only needed packages visible for cross sdk imports

This gives us more control over what packages are visible in the package
database during cross sdk imports and makes sure we're not accidentally
picking up the wrong one.

* Update compiler/damlc/lib/DA/Cli/Damlc/Packaging.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* deal with evil dalf imports
2019-11-18 21:08:33 +00:00
Leonid Shlyapnikov
e1cbd38f48 CLI configuration to enable serving static content as part of the JSON API daemon (#3460)
* StaticContentEndpoint

* cleanup

* release notes

* Add test

* SDK doc update

* Copying the directory content explicitly

to avoid creating a symlink, I believe that is the cause of the Windows issue

* creating a static content dir from the test

* fixing release notes

* creating a tmp dir

* fixing release notes

* Using Gen.Identifier to generate random strings
2019-11-18 19:31:33 +00:00
Moritz Kiefer
6b536805bc Expose conversion from Ast.Type to iface.Type (#3511)
* Expose conversion from Ast.Type to iface.Type

This allows me to get rid of the duplicated conversion logic for DAML
script. The reason for why I can’t use the higher level APIs provided
by the interface reader is that the type of the script identifier can
be a function which is not serializable and therefore does not show up
in the interface. However, I only want to translate the type of the
argument of that function which is serializable.

* Update daml-lf/interface/src/main/scala/com/digitalasset/daml/lf/iface/reader/InterfaceReader.scala

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
2019-11-18 18:22:50 +00:00
Brian Healey
c0c132df4e
wrap examples for easier display (#3512)
* wrap examples for easier display

* Add slash continuation

* update to valid targets

Update examples to valid ledger/sandbox targets in daml repo
2019-11-18 13:15:47 -05:00
Remy
fedc49dd12 leger-api: add GenMap support (#3506)
* leger-api: add GenMap support

* cosmetic

* Address Gerolf's  comment

* add a point in the release notes

* Address Fran's comments
2019-11-18 18:13:25 +00:00
Robert Autenrieth
388b204e92 Fix Navigator crashing on ledgers with no packages (#3400) 2019-11-18 16:15:57 +00:00
Moritz Kiefer
d776489820
Add submitMustFail to DAML script (#3510)
This is useful for testing purposes and matches the function provided
in scenarios. We probably want to expose a variant of submitMustFail
that only succeeds if the SubmitFailure matches a specific condition
but I need to think a bit more about which API I want for that.
2019-11-18 17:05:55 +01:00
Moritz Kiefer
5458053ea9 Add pending set to DAML triggers (#3502)
fixes #3360
2019-11-18 14:25:40 +00:00
associahedron
d654d7591b Improve Numeric type inference and safety by adding a scale constraint. (#3505)
* Add NumericScale typeclass

* Add release note
2019-11-18 13:53:17 +00:00
Moritz Kiefer
6a09ea7755
Support starting a DAML script from a JSON input value (#3490)
This uses the format for LF values that we already use elsewhere.

There is one annoying part in this PR where I had to duplicate the
logic for converting to the types used in the interface reader since
it is not exposed but hopefully we can get rid of this soon in a
separate PR.

fixes #3470
2019-11-18 14:42:14 +01:00
Gerolf Seitz
5f8bf411bd
Upload proto and deploy jars to maven (#3507)
* Add helper to produce an empty zip files.

This is used to generate empty sources and javadoc jars for
deploy jars later on.

* Create empty auxilliary jars.

da_java_binary:
  - empty javadoc jar
  - empty sources jar

da_java_proto_library:
  - empty javadoc jar
  - the sources jar is automatically generated by java_proto_library as a side effect

da_scala_binary:
  - empty javadoc jar
  - empty sources jar

* Support maven upload for jar-deploy and jar-proto

For jar-deploy targets we don't check for internal dependencies,
because these should already be contained in the (fat-)jar itself.

Additionally, the release program now uploads javadocs and sources
for jar-proto and jar-deploy as well to comply with maven central.

* Upload ledger-api-test-tool and kvutils + dependencies to maven central.

This is the diff running the output of the release without and with these changes.
A few artifacts now also get their javadoc and sources uploaded (mostly to bintray,
but now they are ready for a maven central upload).

ledger-api-test-tool has the scala version removed from the artifact as it is a
deploy jar and nobody should care which specific scala version is used.

Only in release/com/daml/ledger/participant-state-kvutils-java-proto/100.13.35: participant-state-kvutils-java-proto-100.13.35-javadoc.jar
Only in release/com/daml/ledger/participant-state-kvutils-java-proto/100.13.35: participant-state-kvutils-java-proto-100.13.35-sources.jar
Only in release/com/daml/ledger/testtool: ledger-api-test-tool
Only in release-before/com/daml/ledger/testtool: ledger-api-test-tool_2.12
Only in release/com/digitalasset/daml/lf/engine/trigger/runner_2.12/100.13.35: runner_2.12-100.13.35-javadoc.jar
Only in release/com/digitalasset/daml/lf/engine/trigger/runner_2.12/100.13.35: runner_2.12-100.13.35-sources.jar
Only in release/com/digitalasset/daml-lf-blindinginfo-java-proto/100.13.35: daml-lf-blindinginfo-java-proto-100.13.35-javadoc.jar
Only in release/com/digitalasset/daml-lf-blindinginfo-java-proto/100.13.35: daml-lf-blindinginfo-java-proto-100.13.35-sources.jar
Only in release/com/digitalasset/daml-lf-transaction-java-proto/100.13.35: daml-lf-transaction-java-proto-100.13.35-javadoc.jar
Only in release/com/digitalasset/daml-lf-transaction-java-proto/100.13.35: daml-lf-transaction-java-proto-100.13.35-sources.jar
Only in release/com/digitalasset/daml-lf-value-java-proto/100.13.35: daml-lf-value-java-proto-100.13.35-javadoc.jar
Only in release/com/digitalasset/daml-lf-value-java-proto/100.13.35: daml-lf-value-java-proto-100.13.35-sources.jar
Only in release/com/digitalasset/damlc/100.13.35: damlc-100.13.35-javadoc.jar
Only in release/com/digitalasset/damlc/100.13.35: damlc-100.13.35-sources.jar
Only in release/com/digitalasset/extractor/100.13.35: extractor-100.13.35-javadoc.jar
Only in release/com/digitalasset/extractor/100.13.35: extractor-100.13.35-sources.jar
Only in release/com/digitalasset/ledger-service/http-json-deploy/100.13.35: http-json-deploy-100.13.35-javadoc.jar
Only in release/com/digitalasset/ledger-service/http-json-deploy/100.13.35: http-json-deploy-100.13.35-sources.jar
Only in release/com/digitalasset/navigator/100.13.35: navigator-100.13.35-javadoc.jar
Only in release/com/digitalasset/navigator/100.13.35: navigator-100.13.35-sources.jar
2019-11-18 14:40:15 +01:00
Andreas Herrmann
712bc456ba Map CommandIds in MTransaction (#3501)
* Regression test for #3485

* Respect CommandId mapping for transactions

* triggers: Fix ExerciseByKey

Make choice nonconsuming, so that no second `T` is created later.
Only execute `dedupExerciseByKey` if `T_` doesn't exist, yet.

* Update list-triggers test

* triggers: Empty commandId on foreign TransactionM

95ccc59b45 (r347287514)
2019-11-18 14:34:48 +01:00
Moritz Kiefer
1370ef3083 Upgrade ghcide and haskell-lsp (#3499) 2019-11-18 10:56:19 +00:00
Remy
43eb69cbbd DAML-LF: add GenMap tests for LF encoder (#3491)
* daml-lf: fix decoder

* daml-lf: extend testing dar for encoder

* add EOF to .lf files

* change 1.dev to 1.7 for java codegen encoding test

* formatting

* fixes
2019-11-18 10:07:13 +00:00
Martin Huschenbett
f1df336df0 Fix typo in docs for JSON API query language (#3497) 2019-11-18 08:15:05 +00:00
Martin Huschenbett
ab07b05fcb Clean up rules_daml (the bazel rules for DAML) (#3495)
There are rules that are used nowhere and seem like old cruft.
2019-11-18 08:12:47 +00:00
Brian Healey
92975551d7 individual scalatest in bazel md (#3494)
* individual scalatest in bazel md

Include instructions to run specific test in bazel

* second test_arg needed

* fix typo

* rewording and formatting
2019-11-18 02:34:40 +00:00
Martin Huschenbett
3f2f69224c Fix comment about Party type in DAML-LF Engine (#3496) 2019-11-17 12:20:42 +00:00
Remy
4bd98b6cbc DAML-LF: add GenMap in iface reader (#3487)
* daml-lf: add GenMap in iface reader

* remove useless code

* Update language-support/scala/codegen/src/main/scala/com/digitalasset/codegen/lf/LFUtil.scala

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

* please restart CI
2019-11-17 08:12:10 +00:00
Gary Verhaegen
e9e3f1bf5d add check for Standard-Change label (#3493) 2019-11-15 16:46:42 +00:00
Samir Talwar
c89d1b654e ledger-api-test-tool-on-canton: Disable tests unless run explicitly. (#3492) 2019-11-15 16:29:12 +00:00
Gary Verhaegen
8a024c549f release instructions: add label to PR (#3489) 2019-11-15 15:55:36 +00:00
Stefano Baghino
c0e4a50f1e Break up Ledger API Test Tool target to reduce average build time (#3486)
* Break up Ledger API Test Tool target to reduce average build time

* Address https://github.com/digital-asset/daml/pull/3486#discussion_r346836085

* Address https://github.com/digital-asset/daml/pull/3486#discussion_r346861509
2019-11-15 15:28:39 +00:00
Moritz Kiefer
e2cd2c1fc9 Move packaging tests to a separate test suite (#3484)
* Move packaging tests to a separate test suite

Originally, we had these as part of the integration test suite since
`bazel run damlc build` couldn’t locate `ghc-pkg` but that has been
fixed for a while.

Moving it to a separate test suite speeds things up as the integration
tests are rerun very often and also makes development much more
convenient since the new test suite supports `-p` properly to filter
to specific tests.

For now, I’ve left the upgrading tests as part of the integration
tests. I expect that we probably want to factor those out to another
test suite as well.

* fix warnings
2019-11-15 12:45:37 +00:00