* remove hasInterfaceId, add Optional to type
* add some missing properties in ExercisedEvent to equals, hashCode, toString
* mark ExercisedEvent final, as with other events
CHANGELOG_BEGIN
- [Java bindings] ``ExercisedEvent#getInterfaceId`` has a different type
since 2.3.x, indicating its optionality.
CHANGELOG_END
* add a test that breaks on missing identifier
* fix both hasInterfaceId boolean inversions
- confirmed that the test in parent breaks unless both changes are made
* add changelog
CHANGELOG_BEGIN
- [Java bindings] Fix a regression found in 2.3.0 RC with the
introduction of interface IDs in ``ExercisedEvent``s.
CHANGELOG_END
* add resolveRetroImplements to EnvironmentInterface
* test that resolveRetroImplements does nothing with no data
* resolve retroactive interfaces in Java codegen
* resolve retroactive interfaces in Scala codegen
* resolve retroactive interfaces in json-api
CHANGELOG_BEGIN
CHANGELOG_END
Fixes#14073.
CHANGELOG_BEGIN
- [js] Type ``LedgerOptions``, the type of `new Ledger` arguments, can
be imported by name from ``@daml/ledger``, and is included in the
documentation.
CHANGELOG_END
These are not referenced from anywhere in the repo, and running them
manually is made very annoying by the removal of the Scala codegen and
the `quickstart-scala` template.
If they were deliberately kept to serve as examples of using the Scala
bindings (which I understand are still in use despite being deprecated),
I think we should find another way to keep that bit of documentation
alive, specifically a way that actually gets tested.
CHANGELOG_BEGIN
CHANGELOG_END
* Removal of Sandbox Classic in Haskell code.
CHANGELOG_BEGIN
CHANGELOG_END
* Further sandbox-classic removals
* Upload dar files when withSandbox is used.
* fix formatting
* Moved upload of dars in createSandbox.
* Fixed test by passing the token before the token file is created.
* Added implicit party allocation argument for haskell tests.
* DPP-1073 Infer sandbox token from the shared secret.
* Different slicing of runLedgerUploadDar
Co-authored-by: Andreas Triantafyllos <andreas.triantafyllos@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
- The "version replacement" step was broken: it replaced
`0.0.0-SDKVERSION` with `{sdk_version}` instead of the current SDK
version. This is fixed by adding a `format` call in the `ts_docs`
Bazel rule.
- The section removal was broken as it assumed the version number was
not replaced at all (so tried to detect `0.0.0-SDKVERSION` still).
This is fixed by using a more robust "section removal" method.
CHANGELOG_BEGIN
CHANGELOG_END
* move template/interface combination to daml/types library
* interface collision stops overloading at runtime
* include Omit in template extends interfaces clauses
CHANGELOG_BEGIN
- [codegen js] When a choice is inherited from two or more interfaces,
the template object no longer inherits one of the choices at random.
Such choices must always be invoked directly by referring to the
interface object.
CHANGELOG_END
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* inherited choices are gone, convert to interface
* use toInterface for conformance tests on interfaces
CHANGELOG_BEGIN
- [Scala codegen] Interface choices can no longer be invoked directly on
template IDs, or via ``createAnd`` or ``key`` directly. Instead, use
``toInterface[Ifn]`` before calling the relevant ``exercise*`` method.
The resulting ledger commands now contain the correct interface ID
rather than template ID for looking up the choice, but see #13993 for
a caveat regarding create-and-exercise and exercise-by-key.
CHANGELOG_END
* Template.Implements marker, and toInterface for contract IDs
* unsafeToTemplate for interface contract IDs
* toInterface for create-and-exercise, exercise by key
CHANGELOG_BEGIN
- [Scala codegen] Template contract IDs and interface contract IDs have
new coercion methods, ``toInterface`` and ``unsafeToTemplate``,
respectively.
``toInterface`` can also be used with ``createAnd`` as well as ``key``
for create-and-exercise and exercise-by-key respectively; however, see
#13993 for a caveat regarding ledger API support.
CHANGELOG_END
* define Interface and InterfaceCompanion parent classes
* generate package ID aliases for interface-only modules
* generate choice methods for interfaces
* include all interfaces in what to write from Scala codegen
* handle interface references in variance resolution
CHANGELOG_BEGIN
- [Scala codegen] Interface contract ID types, and references to them in
serializable types, are now supported, as is exercise of interface
choices on interface contract IDs. To support this, ``DomainCommand``
now includes a ``ContractTypeCompanion``, which may describe either a
template or an interface, rather than a ``TemplateCompanion``.
CHANGELOG_END
CHANGELOG_BEGIN
- [Java codegen] The two-argument overload for ``fromIdAndRecord``,
deprecated since SDK 0.12.18, has been removed. Code that still uses
this should use either ``fromCreatedEvent``, or the remaining overload
of ``fromIdAndRecord`` if no ``CreatedEvent`` is available.
CHANGELOG_END
* stop resolving in Java codegen, and use direct choices only
* wrong issue reference in Scala codegen
CHANGELOG_BEGIN
- [Java codegen] Direct invocation of interface exercise methods on
templates is no longer supported, and the ``exercise*`` methods, which
could generate invalid commands in some cases anyway, are removed.
Use ``toInterface`` to access interface exercise methods.
CHANGELOG_END
* reproduce
This produces no files for EmptyIfaceOnly and yields the error
src/__tests__/test.ts(571,39): error TS2339: Property 'EmptyIfaceOnly' does not
exist on type 'typeof import(".../node_modules/@daml.js/build-and-lint-1.0.0/lib/Lib/index")'.
* generate files with no serializable types, but interfaces
- fixes parent test
CHANGELOG_BEGIN
- [codegen js] Files are now generated for Daml modules with interfaces
even if no serializable types are present, and the module contents are
generally propagated as if they had serializable types in them.
CHANGELOG_END
* new getCompanion methods generated for contract IDs
* document new output for exercise methods
* link to #14039
CHANGELOG_BEGIN
- [Java codegen] ``createAndExercise*`` and ``exerciseByKey*`` methods
are deprecated; instead, use the new ``createAnd().exercise*`` and
``byKey(key).exercise*`` methods.
When the ledger API supports it, interface choices will be reachable
via ``createAnd().toInterface(Ifc.INTERFACE).exercise*`` and
``byKey(key).toInterface(Ifc.INTERFACE).exercise*``, exactly the
syntax supported by contract-ID exercise; see #14056.
CHANGELOG_END
* InterfaceCompanion marker parent
* define INTERFACE singleton class and sole value with every interface
* don't allow instantiation of interface classes; they are never what you want
* use singleton for to<interface>, rename unsafeFrom<interface> to unsafeFromInterface
* rename to<interface> to toInterface
* document Java interface output changes
CHANGELOG_BEGIN
- [Java codegen] For interface types ``Ifc``, the template contract ID
conversion method ``toIfc()`` has been removed and replaced with
``toInterface(Ifc.INTERFACE)``, and the interface contract ID
conversion method ``unsafeFromIfc`` has been replaced with
``unsafeFromInterface``, always the same name.
CHANGELOG_END
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved
CHANGELOG_BEGIN
CHANGELOG_END
To be clear, this is a hotfix. Whoever is responsible for this test
should provide a more comprehensive fix with a fairly high degree of
urgency.
Current main is broken because we have a transitive dependency on
`@types/prettier` with a version constraint of `"*"`, and the latest
version (`2.6.1`) is not compatible with our pinned-down version of the
TypeScript compiler (`3.8.3`). A short-term solution would seem to be to
generally bump most of our npm dependencies in this test.
Currently, main tests are _not_ failing because they're still using the
cache, which has a success for this test (and its inputs, as far as
Bazel can determine, have not changed). This is in my opinion a more
important failure (that it doesn't fail), and so a proper fix of this
issue should include pinning down all of our transitive dependencies
(not just `@types/prettier` as I've done here). Arguably _in addition
to_ bumping most of them to recent-ish versions.
The daily releases break because the version string invalidates the
cache, which is how the problem surfaced.
CHANGELOG_BEGIN
CHANGELOG_END
* add inherited choices for Scala codegen, test output exercises
CHANGELOG_BEGIN
- [scala codegen] Choices inherited from interfaces may be exercised
directly from those templates via ``createAnd``, contract ID, or
exercise-by-key. Exercise by interface-contract-ID and
interface-contract-ID types in signatures are not supported.
See `issue #13858 <https://github.com/digital-asset/daml/pull/13858>`__.
CHANGELOG_END
* new test case without confounding symbols
* include inherited interfaces' modules in module references
* refer to #13845 regarding qualifiedModuleRef
CHANGELOG_BEGIN
- [daml codegen js] Some imports were missing in TypeScript declarations
and JavaScript module definitions when those imports were only used to
implement interfaces; these imports are now properly generated.
See `issue #13844 <https://github.com/digital-asset/daml/pull/13844>`__.
CHANGELOG_END
* shift some generated Contract code to a handwritten superclass
* generate a `COMPANION` for each template
* use the companion in some ledger reading tests
* document changes in template Java codegen
CHANGELOG_BEGIN
- [daml codegen js] Generated templates have types, inherited methods,
and a new static ``COMPANION`` that enable writing more
template-generic utilities directly in Java. New classes
``Contract``, ``ContractWithKey``, and ``ContractCompanion``, have
been introduced; if you are importing
``com.daml.ledger.javaapi.data.codegen.*`` and have imported classes
with these names from any other package, these references will stop
working; use individual imports instead.
See `issue #13724 <https://github.com/digital-asset/daml/pull/13724>`__.
CHANGELOG_END
* test for all varieties of mistaken interface assignment
* fresh object for templates, do not mutate interfaces
CHANGELOG_BEGIN
- [daml codegen js] Some interface IDs were overwritten with template
IDs, making exercise by interface ID impossible in those cases; this
has been fixed. Prior codegen output is invalid; codegen must be
re-run to get the fix.
See `issue #13720 <https://github.com/digital-asset/daml/pull/13720>`__.
CHANGELOG_END
This reverts commit 98c9461b72.
changelog_begin
- [Java bindings] The Single resulting from calling several of the services
exposed by the bindings are blocking again because the implementation was causing deadlocks. See https://github.com/digital-asset/daml/issues/13645
changelog_end
* newtypes for genTypeCon's return values
* type genType's result to eliminate some fst/snds
* note that genTypeCon returns constructors, not full types/serializers
- suggested by @cocreature; thanks
CHANGELOG_BEGIN
CHANGELOG_END
* replace TemplateCompanion#describesTemplate with <:<
* replace TextMap.leibniz === with =:=
CHANGELOG_BEGIN
- [Scala codegen] The signatures of Scala codegen's base classes have
changed; existing Scala codegen output must be recompiled. The
functions ``describesTemplate`` and ``TextMap.leibniz`` have different
types; it is extremely unlikely that users have used these functions
directly, but will need to adjust any callers if they have.
See `issue #13687 <https://github.com/digital-asset/daml/pull/13687>`__.
CHANGELOG_END
* reproduce issue in Java codegen integration tests
* don't discard type parameters when encountering a numeric literal type
CHANGELOG_BEGIN
- [daml codegen java] The Java codegen could produce non-compiling Java code
for Daml data types with type parameters that also used Numeric or
Decimal in their definitions; this has been fixed.
See `issue #13658 <https://github.com/digital-asset/daml/pull/13658>`__.
CHANGELOG_END
* reproduce the cross-module codegen error
* let genTypeCon calculate the JS name, don't just tack on exports
CHANGELOG_BEGIN
- [daml codegen js] Support templates implementing interfaces that are defined in
separate modules.
See `issue #13636 <https://github.com/digital-asset/daml/pull/13636>`__.
CHANGELOG_END
* Remove unused class `JavaConf`
* Adapt tests to add template references for every type
* Minimize the data passed to `collectDamlLfInterfaces`
* Separate `CodeGen` from `CodeGenRunner`
* Refactor interfaces collection and resolution
* Refactor Java codegen
* Return `InterfaceType`s from `transitiveClosure`, move `DefTemplateWithRecord` to the Scala codegen
* Remove unused abstractions from the Java codegen
changelog_begin
changelog_end
* Minimize diff: move as much as possible to `CodeGenRunner`
* Revert "Adapt tests to add template references for every type"
This reverts commit 37c8c827179daa29668fa843c79afc8cef09e431.
* Fix compilation errors
* Minimize diff: restore imports in `ClassForType`
* Minimize diff: get rid of unnecessary refactorings
* Further simplications and fixing compilation errors
* Minimize diff: move `collectDamlLfInterfaces` back to its previous position
* Address https://github.com/digital-asset/daml/pull/13440#discussion_r846301958
* Add generation of FromInterfaceContractId methods for supporting templates in the java codegen
changelog_begin
- Add generation of `unsafeFrom{InterfaceName}` methods to the `ContractId` class for templates implementing interfaces in the Java codegen. That allows to convert between interface contract IDs and template contract IDs. If a conversion was wrong it will raise an exception at runtime during the execution of a command. The conversion is thus not exception-safe.
changelog_end
* Update language-support/java/codegen/src/ledger-tests/scala/com/digitalasset/InterfacesTest.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Fix missing import
* Address https://github.com/digital-asset/daml/pull/13460#discussion_r838522450
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stefano Baghino <stefano.baghino@digitalasset.com>
* 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