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.
* 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
* 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
* 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
* 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
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.
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.
* 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
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.
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.
* 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
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.
* 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
* 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
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.