Commit Graph

9 Commits

Author SHA1 Message Date
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