Commit Graph

2080 Commits

Author SHA1 Message Date
Moritz Kiefer
bf04fe1be9
First draft of a high-level API for DAML triggers (#3127)
This PR adds a first draft of a high-level API for DAML
triggers. There is definitely more work to be done and the design is
absolutely not final. However it already allows expressing the copy
bot fairly cleanly so I would like to merge this in its current
state (or at least without bikeshedding the design too much) and then
iterate upon it.
2019-10-08 15:34:14 +02:00
Robert Autenrieth
9a1b10ef82
Add a mock AuthService (#3125)
A simple AuthService implementation useful for tests
2019-10-08 12:46:43 +02:00
Gerolf Seitz
5592092cc7
Remove DAML-on-X IndexServer and Reference Server (#3108)
It is not needed anymore and can therefore be deleted.
2019-10-08 11:47:21 +02:00
associahedron
3e86680f3b Mark daml json-api as experimental (#3123) 2019-10-08 09:07:25 +00:00
Oliver Seeliger
52302e2a1f
Ledger api index server starts only after indexer initializes db #2974 (#3087) 2019-10-08 10:57:50 +02:00
Robert Autenrieth
284a6d8197
Introduce ledger API authorization (#3051)
... by introducing an AuthService and checking authorization claims in all ledger API services
2019-10-07 22:29:46 +02:00
Remy
fbad37d560 Engine: update daml-lf value proto (#3001)
* engine: create persisted value for numeric

* engine: update info test

* Apply suggestions from code review

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

* engine: weaken scale constraints when transalting value

* Address Stephen's comments

* Address one of Stefano's comments

* daml-lf: fix transaction test
2019-10-07 19:27:23 +00:00
Shaul Kfir
fd912af946 Typo fix on release-notes.rst (#3119) 2019-10-07 15:58:15 +00:00
Richard Kapolnai
4c280a5f1b Add helper to Java Bindings to prepare transformer for Bot.wire. (#3098)
* Add helper to Java Bindings to prepare transformator for Bot.wire. Fixes #3097

* Java bindings: rename to contractTransformer

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

* Rename to transformer

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

* Keep error info for invalid class

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

* Add generic info to declaration

* Add test for contract tranformer

* Add license header

* Improve contractTransformer by storing reflection results

* Rename folder scala to java

* Add maven coordinates tag

* rename bazel goal back to bindings-java-tests

* integrate contract transformation test with codegen

* manual merge on unreleased.rst

* add daml model for integration testing
2019-10-07 17:38:26 +02:00
Andreas Herrmann
5266b042b2 Implement ToTextTemplateId in proto (#3118) 2019-10-07 14:56:52 +00:00
Andreas Herrmann
0ba7f9f8f2 Implement ToTextTemplateId primitive on Scala side (#3115)
* Implement TyCon primitive on Scala side

* tyCon --> toTextTemplateId

https://github.com/digital-asset/daml/pull/3115#discussion_r331901925
https://github.com/digital-asset/daml/pull/3115#discussion_r331903274
2019-10-07 13:09:14 +00:00
Moritz Kiefer
aef44abe4f
Release 0.13.29 (#3111) 2019-10-04 16:39:46 +02:00
Remy
449500bad8 Revert "Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)" (#3114)
This reverts commit 68e4453324.
2019-10-04 16:13:27 +02:00
Gary Verhaegen
156edf7432 fix release check (#3112) 2019-10-04 13:57:49 +00:00
Jussi Mäki
09e93a6cdc
Fix handling of transient contract keys in kvutils (#3110)
* Add failing test case for transient contract keys

* Add kvutils tests for transient contracts and keys

* Fix handling of transient contracts and keys in kvutils
2019-10-04 14:00:54 +02:00
Martin Huschenbett
68e4453324 Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)
* Intern all strings and dotted names in the DAML-LF protobuf encoding

On one of our huge DAML code bases this has brought down the size of the
DALF by 60% and cut the memory usage during decoding by 50%.

The `@QUERY-LF` tests in the damlc integration tests check that the
interning actually works.

* Add scala decoder support for interned strings

* Memoize versionisOlderThan. Speeds up decoding by 6x.

* Properly fix the performance problem with version ordering

LanguageVersion.ordering was a `def` and not `val` causing us to
recreate the ordering tables every time.

* Clean up //daml-lf/archive:decode-test

* Use int32 for interning indices

* Adapt QUERY-LF tests

* Strip a few useless field_ prefixes

* Add test for uniqueness in interning tables

* Drop field_ prefix from jq queries

* Fix Scala encoder

* Fix bond-trading tests

* Rename decode-test to decode-tester

* Address @cocreature's comments

* daml-lf: proper versioning for reading internedStrings

* daml-lf repl: revert change
2019-10-04 11:26:31 +00:00
Moritz Kiefer
a0984b606a Release 0.13.28 (#3109) 2019-10-04 10:03:09 +00:00
Oliver Seeliger
7dd482861b
Ledger api server fixes to persist divulged, otherwise unknown contracts #2946 (#3101) 2019-10-04 11:25:50 +02:00
Moritz Kiefer
506da16650 Fix module names in quickstart example (#3107)
* Fix module names in quickstart example

* Update references to test files
2019-10-04 09:18:27 +00:00
Moritz Kiefer
e51e27fe27
Make the DAML trigger tests more generic (#3096)
This is a first step towards making our tests more generic so we can
add more easily tests different triggers.
2019-10-04 10:59:02 +02:00
Moritz Kiefer
a25c2e9de3
Avoid normalizing include dirs (#3103)
* Avoid normalizing include dirs

Fixes #3099

See https://github.com/digital-asset/ghcide/pull/152 for the
corresponding PR in ghcide

* bump to proper ghcide rev

* bump haskell-lsp rev
2019-10-04 10:41:44 +02:00
Martin Huschenbett
6b1f65f006
Add a tool to generate simple DALF for plain DALF import test (#3102)
We're working on a feature to import plain DALFs without any attached
source or interface files into a DAML project. This PR provides a tool to
generate a simple DALF file for testing this feature.
2019-10-04 09:55:25 +02:00
Oliver Seeliger
cd915b64d7
Ledger api server indexer closes akka system on shutdown #2624 (#3089) 2019-10-03 18:57:14 +02:00
Oliver Seeliger
c9658c7813
Multi participant node named logging (#2647) (#3080)
* Upgrade scala-logging and slf4j

* Named logging for multi-participant tests (#2647)
2019-10-03 18:20:57 +02:00
Jussi Mäki
0c72eeaf32
kvutils metrics (#3065)
* Add initial metrics to kvutils

* Improve metrics. Use InsertOrdMap by default in kvutils.

* Add VarGauge
2019-10-03 14:34:12 +02:00
Gary Verhaegen
5e0f664473
fix haskell export script (#3076) 2019-10-03 08:36:14 +02:00
Moritz Kiefer
a7eec73f38
Split trigger runner into multiple files (#3088)
Having everything in a single file has gotten a bit unwieldly so this
PR splits it up. There is no change in the actual code, this is just a reshuffling.
2019-10-02 18:26:13 +02:00
associahedron
e4956ce4da
Forbid polymorphic Numeric literals. (#3085)
* Remove polymorphic literals from library

* Add BECastNumeric and BEShiftNumeric in DAML-LF AST.

* Update rest

* Copyright header

* Remove polymorphic literals from LF conversion.

* Update tests

* Add test for forbidden polymorphic literals

* Add newline in DA.Numeric

* use MulNumeric instead of CastNumeric in DA.Internal.Prelude
2019-10-02 16:01:13 +01:00
Moritz Kiefer
8743dbbda7
Use newtypes for id types in DAML triggers (#3082)
This makes the API a bit safer and nicer to use. Since this is a
low-level API the constructors are exposed, for the high-level API we
probably want to hide them.
2019-10-02 16:57:20 +02:00
Moritz Kiefer
a96f219f47 Share akka logic between DAML trigger main and tests (#3084) 2019-10-02 13:29:33 +00:00
Moritz Kiefer
2f79ea3221 Bump ghcide (#3083)
* Bump ghcide

* Fix ghcide test output
2019-10-02 13:08:07 +00:00
Martin Huschenbett
a5ff470929
Prepare @QUERY-LF tests for string interning (#3081)
After string interning we won't have direct access to string anymore but
rather need to go through the interning tables. This PR implements the
required infrastructure for that endeavour.
2019-10-01 20:31:30 +02:00
Moritz Kiefer
7e7f35216f
Remove flaky=True from trigger tests (#3079)
I’ve run them a 100 times locally and haven’t been able to get them to
fail so it looks like the issue has been fixed since.

fixes #2881
2019-10-01 17:21:16 +02:00
Martin Huschenbett
1128d83492
Write JSON files in damlc integration test (#3075)
* Write JSON files in damlc integration test

There were quite a few occurences where I needed to look at the JSON
representation of the generated DALF in the past. Particularly, when
trying to come up with the `@QUERY-LF` pragmas for new tests.

This PR writes the JSON files to disk next to the (pretty printed)
DALF files.

* Remove useless rewriting of numbers into strings
2019-10-01 17:04:55 +02:00
Moritz Kiefer
254b65e457
Improve docs on uniqueness constraint for command_ids (#3078)
fixes #3068
2019-10-01 16:14:11 +02:00
Moritz Kiefer
a7fbad153c
Expose completions in daml triggers (#3077) 2019-10-01 15:28:59 +02:00
Martin Huschenbett
4623467c40
Update docs for type synonyms generated by generic template instances (#3071) 2019-09-30 14:47:55 +02:00
associahedron
125317cff0
Update rest of standard library for Numeric (#3063)
* Update rest of standard library for Numeric

* Fix position of CPP pragma
2019-09-30 11:03:16 +01:00
Moritz Kiefer
78c2ec2f25
Bundle trigger runner in SDK (#3069)
There is deliberately no description and release notes entry to hide
it from `daml --help` and to make it a bit more accessible but
shipping it should make it a bit easier to experiment with.
2019-09-30 11:52:20 +02:00
Andreas Herrmann
98bb580aa2 Bundle packages with SDK releases (#3056)
* Enable SDK daml-lib package dependencies

* integration-test: SDK daml-libs dependency

* trigger --> daml-trigger

Rename the trigger library package to match other builtin packages.

* Bundle daml-trigger.dar in SDK release tarball

* Describe SDK bundled packages in changelog

* Push case match inside expand

Addressing review comment
8208277747 (r329428240)
2019-09-30 09:15:11 +00:00
Moritz Kiefer
11c686b255
Support emitting multiple transations from DAML triggers (#3049)
fixes #3047
2019-09-30 08:46:08 +02:00
Leonid Shlyapnikov
3efe846a3a Renaming "active" -> "created" (#3064)
* Renaming "active" -> "created"

* Renaming "active" -> "created"
2019-09-27 19:07:24 +00:00
Rohan Jacob-Rao
32e3099ddf Template instance type synonym polish (#3054)
* Release note

* Desugaring is hard to type

* Upgrade hlint version to new ghc lib

* Use template instance type synonym in some tests

* Rm space
2019-09-27 18:07:39 +00:00
Gary Verhaegen
13e6f581e3
fix hoogle; revert cache buckets ACL changes (#3062) 2019-09-27 15:42:31 +01:00
Anup Kalburgi
3686162c02
Adding visual -web command (#3009)
adding the visual-web command to damlc
2019-09-27 10:26:20 -04:00
Martin Huschenbett
3b42a447f3 Refactor DAML-LF encoder/decoder in prep for string interning (#3060)
* Refactor DAML-LF encoder/decoder in prep for string interning

Refactor the encoder/decoder such that all the functions concerned with
interning live next to each other and code will break once the types of
the protobuf messages change.

This PR is a pure refactoring and does not change any functionality.

* Fix typos
2019-09-27 12:40:05 +00:00
Stefano Baghino
2955c49828
Remove contract keys tests from semantic suite, make contract keys tests multi-node aware (#3058) 2019-09-27 13:51:51 +02:00
Stefano Baghino
717bd38ec0
Read the TTL from the configuration service (#3052)
* Read the TTL from the configuration service

* Address https://github.com/digital-asset/daml/pull/3052#discussion_r328698432

* Fix docs
2019-09-27 12:02:47 +02:00
Leonid Shlyapnikov
1fa170366d
Return archived events from /command/exercise (#3036)
* Adding `domain.ArchivedContract`

* Adding `domain.Contract`

* Returning archived and active contracts from `/command/exercise`

Improving integration tests, asserting values in the response JSON

* Updating documentation

* Do not populate workflowId if it is not provided

set it to empty string (default), it is optional in the Ledger API
2019-09-26 16:06:18 -04:00
Martin Huschenbett
bb309794db Simplify the Haskell implementation of the DAML-LF decoder (#3053)
Right now, some functions are polymorphic in the monad we use. This is
absolutely unnecessary.

This PR fixes one monad and uses it all over the place. This is a pure
refactoring which doesn't change any functionality.
2019-09-26 18:29:46 +00:00