* Remove unused `name` field from `InterfaceTreeBuilder`, inline builder construction
* Remove unused `Traverse` instance for `TypeDeclOrTemplateWrapper`
* Remove unneccessary type parameter from `TypeDeclOrTemplateWrapper`
* Remove some unnecessary copies `.toList`
* Remove `TypeDeclOrTemplateWrapper`, use `Either` directly as a wrapper
* Use `bimap` instead of explicitly wrapping and unwrapping the `Either`
* Remove unnecessary type `Mode`
* Remove unnecessary type parameter from `WriteParams`
* Remove unnecessary binding
* Pull `OrderedDependencies` out of `Graph`
* Move computation of relevant packages to `codegen-common`
* Move `templateCount` from `LFUtil` into `CodeGen`
* Comment the purpose of `TransitiveClosure`
* Pull the variance cache out of `LFUtil`
`LFUtil`'s purpose is that of limiting passing around certain
values. While the purpose is questionable, the variance cache did
not need to access any of those values and it's quite easy to
move to a separate class where the purpose and the scope are clearer.
* Make `DependencyGraph` work directly on type declarations
* Add constructor for a collection of interfaces to `EnvironmentInterfaces`
* Factor the error message from `cyclicDependencies` out of `DependencyGraph`
changelog_begin
changelog_end
* WIP
* First working version of java codegen daml interface support
* Update language-support/java/codegen/BUILD.bazel
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Fix compile errors
* Simplify code massivly, enjoy less duplication
changelog_begin
- The Java codegen now has basic support for daml interface definitions. Converting a contract id of a template implementing an interface to a contract id of the interface is possible and both executing interface choices is possible on the contract id of the interface and implementing template.
changelog_end
* Rename the test file to reflect it is a test file & enhance the inner test name & extend it further
* Fix test
* Refactor parts of TemplateClass.scala into multiple files
* Format that files!
* Minimize duplication further
* Remove unused comment
* Simplify code
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Further refactoring and renaming of the TemplateClassSpec to ContractIdClassBuilderSpec
* Fix formatting
* Add interface docs
* Remove unnecessary code generation of the Contract class for interface types
* Use less bool flags and more good function names :)
* Fix build
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* ifaces: more evaluation order tests
This adds more evaluation order tests for the execution of daml-lf
during exercise_interface.
Part of #12697.
CHANGELOG_BEGIN
CHANGELOG_END
* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>
* ifaces: Add exercise interface semantics to spec
This is based on the semantics of 'exercise'.
Closes#11349 (for now). Also fixes a small bug in the semantics of 'exercise'.
changelog_begin
changelog_end
* Uniformize exercise syntax
This add a first test for evaluation order of exercise_interface and
fetch_interface. More tests will come in the following PR's.
This is part of #12697.
CHANGELOG_BEGIN
CHANGELOG_END
We add tests to check that by_interface fields are set for interface
transactions. We also extend the scenario service to show the
by_interface fields in the pretty printed transactions.
Fixes#13333
CHANGELOG_BEGIN
CHANGELOG_END
* explore less bouncing; convert every: Bounce -> yesBounce/noBounce
changelog_begin
changelog_end
* remove noBounce; yesBounce -> Bounce (with curly braces)
* multi args list for better layout
* use shadow variable naming more consistently
* reduce unnecessary polymorphism
* reinstate 2x Bounce in atomizeExps which are necessary
* avoid 2x linear args.size
* avoid pointless conversion to/from Array
* move definition of Res to correct place
* remove 2x comments to type param A which has been removed
* inline 2x unnecessary val defs
* enable Anf stack-safety tests for EUpdate cases
* fix stack-safety for closures in Anf transform
* fix stack-safety for try-catch handling in Anf transform
* add missing testcases for scope-exercise/prevernt-catch ANF stack-safety, and fix the overflow
changelog_begin
changelog_end
* interfaces: tests for requires typing
We add tests for the correct typing of the interface requires field.
CHANGELOG_BEGIN
CHANGELOG_END
* security evidence
This adds the presence of interface names, as well as lists of choices
and their argument/return types for each interface.
It also changes the semantics of DefTemplate and EnvironmentInterface:
each may contain "unresolved choices", which are the choices inherited
from interfaces for each implementing template;
EnvironmentInterface#resolveChoices will copy the full type information
as a concrete choice for each implementing template, which should be
much simpler for codegen and json-api.
A type generator should take account of the astInterfaces as well as
typeDecls in EnvironmentInterface; interfaces aren't included in
typeDecls because where I is an interface only ContractId I is
serializable.
* Ast.DataInterface is empty, just use the interfaces map directly
* port json-api for interface API changes; does not solve #12689
* port Scala codegen for interface API changes; does not add support
* port Java codegen for interface API changes; does not solve #11350
CHANGELOG_BEGIN
CHANGELOG_END
This extends the Scala encoder tests to include interface definitions
and interface implementatioins. Some bugs in the encoder and ast
rewriter are fixed.
CHANGELOG_BEGIN
CHANGELOG_END
We split kv replay as follow:
- [LF] we introduce a simple protobuf to store submission entry (which
roughly correspond to TRANSACTION_ENTRY and PACKAGE_UPLOAD_ENTRY KV
submission)
- [KV] we create a tool to extract form a ledger export a sequence of
submission entry
- [LF] we move the replay tool from KV to LF, and base it on
submission entries instead of ledger export
The objectify of this split is double:
- on the one side it will simplify maintenance, as it will make API
between KV and LF more clear (depends only on a protobuf definition)
- on the other side, it will made the use of the tool handy, as it
will make possible to benchmark the engine without direct dependency
between KV and LF.
CHANGELOG_BEGIN
CHANGELOG_END
* Improve MessageDigest and Mac instance creation to solve lock contention problem [DPP-956]
changelog_begin
Scalability bottleneck in regard to hashing has been fixed in multiple places.
changelog_end
Process:
- `git ls-files -z | xargs -0 -n 100 sed -i --follow-symlinks 's/DAML/Daml/g'`
- `git add -p`
- `git restore -p`
- Check there is no unstaged change left.
To review:
- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
- Quicker check for fals positives:
```
git grep DAML | grep -v migration | grep -v DAML_
```
Fixes#13190
Note: This is the "second half" of #13191, which failed to cover all the
remaining DAMLs because of:
```
$ git ls-files | grep "'"
compiler/damlc/tests/daml-test-files/MangledScenario'.daml
```
CHANGELOG_BEGIN
CHANGELOG_END
* ifaces: tests: check for iface defs in templates
This adds a test that will fail when an interface definition is present
in a module when daml-lf < 1.dev.
CHANGELOG_BEGIN
CHANGELOG_END
* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Update daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/archive/DecodeV1Spec.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* remy's suggestions
Co-authored-by: Remy <remy.haemmerle@daml.com>
* ifaces: tests: check for interface collisions in ast
We add a test to check for interface name collisions in the daml-lf AST.
CHANGELOG_BEGIN
CHANGELOG_END
* Update daml-lf/language/src/test/scala/com/digitalasset/daml/lf/language/AstSpec.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>