Commit Graph

1752 Commits

Author SHA1 Message Date
Moisés Ackerman
2393b5071f
Reject class method overlapping with record field (#14391)
* Update GHC patch

* Add daml-test-files for overlapping methods and fields

* changelog

changelog_begin
* [daml] Programs where a class method overlaps with a record field are no longer accepted (#14390)
changelog_end
2022-07-11 12:58:20 +00:00
dylant-da
3c7ab41bc3
Check interface view exists and is serializable, in compiler and in engine (#14112) (#14322)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-07-05 13:43:28 +00:00
Remy
abd47e972b
[Speedy] Do not crash when encountering an inconsistent contract key (#14276)
but rather return a proper interpretation error.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-05 10:28:38 +00:00
Moisés Ackerman
ba9abf3c5f
Use the appropriate daml-script for each Script (#14321)
* Add failing test

* Overload daml-script 'Runner.run' to work directly with 'PureCompiledPackages'

* Use new daml-script 'Runner.run' in scenario-service

changelog_begin
* data-dependencies: fixed an issue with the handling of multiple versions of the daml-script package (#14291)
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-07-04 08:26:12 +00:00
Remy
d0058dcff3
[Interface] make all ContractIds serializable (#14307)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 11:07:12 +02:00
Robin Krom
36b39aca7b
Move disclosed contract logic to speedy (#14288)
* Move disclosed contract logic to speedy

This moves the disclosed contract logic from the engine to speedy.

Fixes #14090.

* back to versioned contract instances

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-01 08:40:10 +00:00
Remy
54af1c0ecd
[stdlib] fix DA.Foldable (#14235)
fixes #14230

CHANGELOG_BEGIN

- [Bug Fix] fix DA.Foldable Standard library. Both DA.Foldable.foldl
  and DA.Foldable.toList were recuring in the wrong direction.

CHANGELOG_END
2022-06-30 21:56:10 +02:00
Carl Pulley
5c026163a9
Remove redundant fields from LedgerNodeInfo
CHANGELOG_BEGIN

[DAML Studio] as the `parent` and `rolledbackBy` fields of `LedgerNodeInfo` are not used within the code base, they have been removed.

CHANGELOG_END
2022-06-29 16:35:42 +02:00
Moisés Ackerman
583a97d02e
data-dependencies: qualify HasMethod interface (#14280)
* Add failing test

* Use qualified interface type for HasMethod instances

changelog_begin
changelog_end
2022-06-28 14:12:39 +02:00
Carl Pulley
6ed88105bb
Refactor and simplification of Transaction#processNodes
* fixes #14183

CHANGELOG_BEGIN

- [DAML Studio] Refactor and simplification of Transaction#processNodes to avoid need for custom state during processing. Refactor of Transaction#processTransaction to make processing workflow more transparent and easier to unit test. See https://github.com/digital-asset/daml/issues/14183 for details.

CHANGELOG_END
2022-06-28 13:49:41 +02:00
dylant-da
32d6a4a2dc
Improve error message when implementing non-interface (Issue #13823) (#14249)
* Improve error for `implements` on non-interface using GHC source-map

* Pass source location for implements directly

* Update GHC revision to pick up updated implements location

* Change revision to point to merged GHC source location changes

CHANGELOG_BEGIN
CHANGELOG_END

* Handlers output strings in convertInterfaceTyCon

* Improve error for requires on non-interface

* Use prettyPrint instead of GHC.showSDocUnsafe . ppr

* Test error messages for implement/require noninterface

* Fix error line numbers, point to merged GHC changes instead of branch

* Enable interfaces in new tests, Fix copyright year

* Add trailing newline to interface tests

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-06-28 10:14:53 +01:00
Moisés Ackerman
f4211b709f
data-dependencies: generate opaque constructor for interfaces (#14228)
* Add simpleImportTestOptions helper

* Add failing test

* data-dependencies: Generate opaque constructor for interfaces

changelog_begin
changelog_end

* Add comment in test case
2022-06-20 17:49:12 +02:00
Sergey Kisel
b1d8c14c55
Removal of Sandbox Classic in Haskell code [DPP-1073]. (#14127)
* 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>
2022-06-16 14:14:39 +02:00
Remy
2d5094160e
[Engine] clean key uniqueness mode (#14194)
This is a follow up of #14175 and #14176.  

Basically
-  we kill the `On` mode which is not used anymore.
- we factorize the visibility check.
- we rename `LocalContractNotVisible` into `ContractNotVisible`

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-16 12:04:45 +00:00
dylant-da
90f0bf8ba0
Display key used by exerciseByKey and fetchByKey in transaction log (#14035) (#14162)
* Show key in transaction log when exercising by key

* Only show key if key was actually used

* Show key if used by a fetch in transaction view

* Add test for key showing up in log on fetch/exercise

* CHANGELOG_BEGIN
Display key used by exerciseByKey and fetchByKey in transaction log
CHANGELOG_END

* Dummy commit for CHANGELOG

changelog_begin
changelog_end

* Use "by key" instead of "using key", to better match function names

* Test that key is only reported when ByKey is used
2022-06-15 16:50:35 +00:00
Carl Pulley
7d76460ee8
DAML Studio Activeness checks
* fixes #13835

CHANGELOG_BEGIN
  - [Daml Studio] Fix a bug where some contracts were considered inactive even though their consumption was under a rollback. See https://github.com/digital-asset/daml/issues/13835 for details
CHANGELOG_END
2022-06-15 11:35:18 +01:00
Moritz Kiefer
d233bfa4b4
Add missing activeness check when reading from globalKeyInputs (#14080)
* Add missing activeness check when reading from globalKeyInputs

changelog_begin

- Engine. Fix lookup by key. See issue Lookup archived contracts may succeed when combined with rollback exceptions #14107 for more details.

changelog_end
2022-06-13 19:27:08 +00:00
Moisés Ackerman
3255dccfc9
Qualify interface name in _requires_ markers (#14054)
* Add failing test
* update ghc patch
* Update *.EXPECTED.desugared-daml daml-test-files
2022-06-07 10:00:36 +00:00
Moisés Ackerman
ee394702b8
Add CoImplements to DefInterface in protobuf (#14053)
* Update docstring for TemplateImplements.tpiMethods
    * The change happend on https://github.com/digital-asset/daml/pull/13142

* Add CoImplements to DefInterface in protobuf
    * Also adds encoding/decoding logic in the haskell side

* Part of https://github.com/digital-asset/daml/issues/14047

changelog_begin
changelog_end
2022-06-03 16:05:18 +00:00
Remy
ae8f50dbb8
LF: drop inheretedChoices from Implements (#14068)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 18:48:54 +00:00
Remy
09034a265d
ScenarioRunner: move the building of the speedy machine (#14024)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 16:40:48 +02:00
Remy
7638e086ae
Script: infer the typeId of Choice in daml (#13971)
part of #13653

goes with digital-asset/ghc#122

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-02 14:02:12 +00:00
Moisés Ackerman
25b342240e
Fix data-dependencies leaking dependency internals (#13981)
* Add failing test

* Do not overwrite existing dalfs when installing a dar dependency

changelog_begin
* data-dependencies: fixed an issue with the handling of transitive dependencies through a data-dependency (#13981)
changelog_end
2022-05-30 13:19:59 +00:00
Moisés Ackerman
cc41d0ce3a
Replace 'fetchByKey' with 'lookupByKey' in 'LookupKeyed' choice in KeyNotVisibleStakeholders (#14011)
changelog_begin
changelog_end

Co-authored-by: Danilo Faria <danilo@digitalasset.com>
2022-05-30 08:39:47 +00:00
Moisés Ackerman
789d9a44b1
Integration test fixes (#13982)
* Add integration test for runtime check of contract id in contract key

* Replace 'LookupKeyed' with 'FetchKeyed' in 'blindFetch' scenario

changelog_begin
changelog_end

* Replace 'FetchKeyed' with 'LookupKeyed' in 'divulgeeLookup' scenario
2022-05-25 14:48:09 +02:00
Remy
d3264236ba
Interface: drop collision check between inherited choice name (#13939)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 17:53:18 +02:00
Remy
a3cccbc6eb
Update GHC (#13917)
with digital-asset/ghc#120

fixes #13915

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-19 12:52:46 +00:00
Moisés Ackerman
fedfd5ad4a
data-dependencies: Constraint synonym context on class (#13916)
* Add failing test case

* Use convTypeLiftingConstraintTuples for superclasses

changelog_begin
* data-dependencies: fixed an issue with the handling of constraint synonyms in superclasses (#13916)"
changelog_end
2022-05-18 18:04:37 +02:00
Moritz Kiefer
13b69b3004
Fix locations for LF errors (#13895)
* Fix locations for LF errors

fixes #13837

changelog_begin

- [Daml Compiler] Fix locations of certain types of error messages, e.g., missing interface methods.

changelog_end
2022-05-17 13:45:58 +02:00
Remy
ea0d101913
Interface: Rename fixedChoice to choice (#13883)
CHANGELOG_BEGIN
CHANGELOG_END
2022-05-17 12:03:53 +02:00
Moisés Ackerman
ad123f9b22
Add da-hls helper (#13853)
* Add haskell-language-server executable

* Add da-hls alias

* strip prefixes in da_haskell_libraries

* Remove dev-env-provided ghcide

* Update mentions of 'ghcide' to 'hls'

changelog_begin
changelog_end
2022-05-12 10:53:10 +02:00
Moisés Ackerman
05960c6edf
Preserve fixity information in data-dependencies (#13774) 2022-05-05 18:50:51 +02:00
Moisés Ackerman
61cb257225
Make disclosure explicit in Daml Studio tree view (#13735)
changelog_begin
* Daml Studio: transaction tree view now differentiates between disclosed and divulged contracts
changelog_end
2022-05-02 09:18:46 +02:00
Moisés Ackerman
9fb7f11316
Replace more instances of 'scenario' with 'script' (#13651)
* Replace more instances of 'scenario' with 'script'

changelog_begin
* Remove Daml Studio 'scenario' snippet
* Add Daml Studio 'script' snippet
* Update documentation for 'daml test' command
changelog_end

* remove 'test' snippet

changelog_begin
* Remove Daml Studio 'test' snippet
changelog_end
2022-04-27 17:49:32 +02:00
Moisés Ackerman
9af86bcc2c
Update reference and docstrings for fromInterfaceContractId and fetchFromInterface (#13712)
changelog_begin
changelog_end
2022-04-27 14:10:17 +02:00
Remy
3e2edfe5e2
Drop wrong comment in GHC.Err (#13664)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-22 13:28:25 +00:00
Robin Krom
c15c5a42a4
daml test: print test summary at end of test suite. (#13648)
This changes the output of `daml test`, such that at the end of the test
suite a summary is printed, indicating which tests failed and which
passed.

Fixes #13535.

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-22 12:30:30 +02:00
Moisés Ackerman
611cce8c8c
Add parens in desugared code (#13603)
* Add parens around 'fromAnyException' view pattern in '_tryCatch' desugaring

* Add parens around desugared 'setField' calls and around its first argument.

* Update desugaring golden files

* Add golden test for parens around 'setField' in renamed daml

changelog_begin
changelog_end
2022-04-20 17:05:16 +00:00
Robin Krom
e0ddfef89c
damlc: add option to filter which scenarios to run (#13600)
This adds an option to specify a pattern such that only tests containing
the given pattern in their name will be executed.

Fixes #13534.

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-20 14:43:14 +02:00
Moisés Ackerman
2e22929cd0
Desugared Daml golden tests (#13591)
* Add daml-desugar library

* Add desugar command to damlc

* Add daml-desugar golden tests

* Add EXPECTED.desugared-daml files for Interface tests

* Add EXPECTED.desugared-daml files for Exception tests

* drop manually generated {Exception,Interface}Desugared files

changelog_begin
changelog_end
2022-04-14 13:14:37 +00:00
Stefano Baghino
d105db2ece
Mention that we do not publish docs for snapshots in the release guide (#13587)
changelog_begin
changelog_end
2022-04-14 10:37:49 +02:00
Robin Krom
fcd3b6622b
ifaces:support exercising by required interface (#13554)
* ifaces:support exercising by required interface

This adds support to exercise an interface choice on a contract ID,
where the interface is required by one of the implemented interfaces of
the contract template.

Fixes #13434.

CHANGELOG_BEGIN
CHANGELOG_END

* some improvements based on review

* added a test plus a bugfix

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/PhaseOne.scala

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* 2 more interface tests for the command preprocessor

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-12 18:15:29 +00:00
Moisés Ackerman
d85ced7b79
Cross-module interface tests (#13560)
* Add test case 'require interface from data-dependency'

* Add test case 'data-dependency interface hierarchy'

changelog_begin
changelog_end
2022-04-12 10:23:31 +02:00
Moisés Ackerman
606896e17f
Add partial ContractId-in-template-key check (#13541)
* Add Keyability check in DA.Daml.LF.TypeChecker

* Update expected errors in daml-test-files/ContractIdInContractKey.daml

* Update no-contract-ids-in-keys daml-lf scenario test to circumvent new check

changelog_begin
[Daml Compiler] Implemented compile-time check disallowing ContractId types in contract key types. This check looks for potential problems with the contract key type only within the template's module.
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-11 18:05:49 +02:00
Robin Krom
8c046c7776
ghc-lib:remove unused let bindings (#13525)
* ghc-lib:remove unused let bindings

This updates ghc-lib, such that no unused let bindings are created in
Archive choices.

Fixes #13431.

CHANGELOG_BEGIN
CHANGELOG_END

* update ghc-lib hash

* Update of InterfaceDesugared.daml
2022-04-11 12:34:17 +00:00
Moritz Kiefer
7da8d54613
Add unionWith to DA.Map (#13532)
changelog_begin

- [Daml Stdlib] Add `unionWith` function. `unionWith` is a more
  flexible version of `union` that accepts a function to combine
  values found in both maps.

changelog_end
2022-04-08 09:51:47 +00:00
Remy
d94aa137f1
Remove by_interface from scenario transaction Nodes (#13509)
part of #13491

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-06 11:09:52 +00:00
Moisés Ackerman
b08fcfada3
Property test buildLfPackageGraph (#13481)
* Generalize buildLfPackageGraph to arbitrary payload type

* Reinstate 'data-dependencies + exposed-modules' test without quickcheck

* Add property-based test on the graph resulting from buildLfPackageGraph'

changelog_begin
changelog_end
2022-04-06 10:00:58 +02:00
Moisés Ackerman
6402b2e95c
Handle scenario service errors (#13479)
* Add ChoiceGuardFailed and ContractDoesNotImplementInterface errors to scenario-service protocol

* Update daml-test-file InterfaceErrors.daml 

* Add daml-test-files for ChoiceGuardFailed and ContractDoesNotImplementInterface errors

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-05 09:26:08 +00:00
Moisés Ackerman
f59d1cd0b4
Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin (#13465)
* Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin

* Add entry for TYPEREP_TYCON_NAME in daml-lf spec

* disable quickcheck test in DA.Test.Packaging

changelog_begin
changelog_end
2022-03-31 14:35:46 +02:00