Commit Graph

270 Commits

Author SHA1 Message Date
Moritz Kiefer
5a3b5f498a Fix SDK versions in trigger and daml-script dars (#3706)
* Fix SDK versions in trigger and daml-script dars

* Fix SDK versions in tests
2019-12-03 07:28:49 +00:00
nickchapman-da
d3d6891021
Rename daml lf tuples (#3658)
* Rename DAML-LF tuples as structs (structural records)
2019-11-28 07:58:30 +00:00
Robin Krom
a2aacaa79b language: better error message for the script runner (#3637) 2019-11-26 21:27:35 +00:00
Moritz Kiefer
afe25febbf
Remove debug printf from daml script (#3640) 2019-11-26 20:45:33 +01:00
Moritz Kiefer
27051160eb
Support multi-participant DAML script (#3605)
* Support multi-participant DAML script

fixes #3555

CHANGELOG_BEGIN

- [DAML Script - Experimental] DAML script can now run be used in distributed topologies.

CHANGELOG_END

* Fix ports in multiparticipants tests
2019-11-25 12:43:47 +01:00
Moritz Kiefer
964bd3fd76 Support exerciseByKey in DAML script (#3580)
CHANGELOG_BEGIN
- [DAML Script - Experimental] Expose the Ledger API exerciseByKey command
CHANGELOG_END
2019-11-21 16:54:01 +00:00
Moritz Kiefer
ec5d832c48
Generate API docs for DAML script and include them in the SDK docs (#3568)
* Generate API docs for DAML script and include them in the SDK docs

* Update daml-script/daml/Daml/Script.daml

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-11-21 12:59:09 +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
Moritz Kiefer
7deca903bb Add documentation for DAML script and bundle it in the SDK (#3527) 2019-11-19 17:19:57 +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
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
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
Moritz Kiefer
0b784bba39
Newtype free applicatives/monads in DAML script (#3479)
This should hopefully prevent the horrifying implementation details
from leaking to users.
2019-11-15 09:32:45 +01:00
Moritz Kiefer
f746b9f6c0 Support wallclock time in DAML script (#3472)
fixes #3469
2019-11-14 16:25:15 +00:00
Moritz Kiefer
d1ce57398a
Cleanup conversions in DAML script and fix value translation (#3467)
This cleans up the remaining conversions in DAML script and fixes the
bug fixed in #3458 for DAML triggers by switching to the
ValueTranslator.
2019-11-14 15:30:46 +01:00
Moritz Kiefer
f469f1e8f1
Cleanup conversions in DAML script submit (#3455)
* Cleanup conversions in DAML script submit

I’ll leave the other commands such as Query for a separate PR.
Part of this code can be shared with the DAML trigger runner but I’ll
also leave that for a separate PR

* Address review comments
2019-11-13 20:56:06 +01:00
Moritz Kiefer
4b2fa958b8 Fix typo in description of free applicatives (#3438) 2019-11-12 18:26:32 +00:00
Moritz Kiefer
b3ae6560d7
Add an initial version of DAML script (#3428)
The code still needs a fair amount of cleanup but it seems to work and
there is a test so I’d like to do the cleanup in-tree after merging
the current state
2019-11-12 18:02:14 +01:00