Commit Graph

23 Commits

Author SHA1 Message Date
Moritz Kiefer
87427ba334
Fix a race condition in the DAML trigger tests (#3199)
Previously, it could happen that the command flow used in the test was
started before the trigger queried the ACS on startup.

Now we wait for the ACS to be queried before starting the commands
flow which fixes this issue.
2019-10-16 16:51:06 +02:00
Moritz Kiefer
155302a247 [daml-triggers] Support wallclock time and make TTL configurable (#3186)
* [daml-triggers] Support wallclock time and make TTL configurable

fixes #3184

* Remove duplicate wall clock option
2019-10-15 15:43:55 +00:00
Moritz Kiefer
dbddead461
Add a first draft of documentation for DAML triggers (#3181)
* Add a first draft of documentation for DAML triggers

The API will still change in a bunch of ways but I’d rather get some
docs in place now and update them as we change things than not have
any docs at all.

* Fix path to daml.yaml

* s/bot/trigger/

* fix source code markers

* Fix tests

* Update docs/source/triggers/index.rst

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2019-10-15 16:50:43 +02:00
Remy
e45b585307 daml-lf: repackage daml-lf archive proto (daml_lf -> daml_lf_dev) (#3169) 2019-10-15 09:36:11 +00:00
Remy
d64df4b5f7 daml-lf: clean achive bazel build (#3175)
* clean the mess in daml-lf achive bazel build

* add release note

* Address Moritz's comments

* more release notes
2019-10-15 08:36:46 +00:00
Remy
fc1a000090 daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader (#3168)
* daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader

* fix release
2019-10-14 14:53:50 +00:00
Moritz Kiefer
1da742ec60 Use UUIDs for command ids emitted from DAML triggers (#3170)
fixes #3130
2019-10-14 14:49:01 +00:00
Moritz Kiefer
d500d9967a
Allow emitting commands on trigger initialization (#3132)
fixes #3128

Also includes a small bug fix to reenable some tests that I
accidentally disabled in #3127 and fixes deserialization of command
ids in completions which I accidentaly broke when making fromCommandId
return an Optional since that’s what we need for transactions.
2019-10-09 09:24:34 +02:00
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
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
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
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
Moritz Kiefer
a7fbad153c
Expose completions in daml triggers (#3077) 2019-10-01 15:28:59 +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
Moritz Kiefer
7a2e12d6d2
[daml-triggers] Expose template data in CreateEvents (#2973)
Now that we have AnyTemplate, we can actually make the template data accessible.
2019-09-23 12:49:01 +02:00
Andreas Herrmann
df7262e853 Infer templateId and choiceName in daml trigger commands (#2945)
* Infer templateId from createCmd argument

* Infer templateId and choiceName in exerciseCmd

* Use exerciseCmd in ACS test

Add a layer of indirection to test `exerciseCmd` in the ACS test.

The trigger first creates a `AssetMirrorProposal`, only when the
proposal has been created, will it exercise the `Accept` choice to
create the actual `AssetMirror` contract.

* Remove toTemplateId

* getTemplateId --> toTemplateId

* Tuple2 --> AnyContractId

* Run Scala formatter

* Export AnyContractId

* extractTemplateId|ChoiceName
2019-09-18 10:06:53 +00:00
Moritz Kiefer
01eccf2c64 Mark DAML trigger tests as flaky while we investigate (#2882) 2019-09-11 13:32:54 +00:00
Moritz Kiefer
77225af6da
Support Exercise and Create commands in DAML triggers (#2864)
* Support Exercise and Create commands in DAML triggers

This is a bit rough but I want something to experiment with before we
settle on a design and start making the LF changes required to make it
nicer.

It does already allow you to use the original template and choice types.

* Update triggers/runner/src/main/scala/com/daml/trigger/Runner.scala

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-09-10 17:31:36 +02:00
Moritz Kiefer
9de5e3cfa4
Initialize DAML triggers with ACS (#2798) 2019-09-09 15:47:11 +02:00
Moritz Kiefer
f1a9afdf17 Clean before running daml build (#2816)
This should hopefully fix some of the flakiness we’ve been seeing on
Windows. Not entirely sure what’s going wrong without the clean but
since this only happens the lack of sandboxing seems like the most
likely difference.
2019-09-08 17:49:00 +00:00
Moritz Kiefer
5e962a2b61
DAML Triggers V0 (#2762)
This is a first step towards DAML triggers. At the moment, triggers
can consume (very simplified) create and archive events via the Ledger
API, update a state based on that and emit log mesages at each update.

All of this is likely to change significantly in the future, so I
would prefer to not focus too much on minor details for now.

As a test, I added a simple trigger that tracks active contract ids.
2019-09-05 12:56:41 +02:00