Commit Graph

9 Commits

Author SHA1 Message Date
Moisés Ackerman
ab038ab078
Add warning for uses of 'template-let' syntax (#17266)
* Update GHC_REV

* Add daml-test-files for template-let warning and its toggle

* Adapt daml-test-files to template-let warning

* update *.desugared-daml golden files

* Adapt //daml-lf/tests to template-let warning

* Adapt //test-common to template-let warning

* Update //compiler/damlc/tests:daml-doc golden output

* Adapt //docs to template-let warning

* Update GHC_REV
2023-08-18 15:14:46 +00:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
nickchapman-da
c17c580b84
Fix handling for throw within handler (#14461)
changelog_begin
changelog_end
2022-07-18 17:17:34 +01:00
nickchapman-da
b023bebfda
Track locally created contracts correctly through rollback. (#14163)
changelog_begin
changelog_end

temp mod to get build

 make sure to maintain localContractSet

engine test for: ExerciseAfterRollbackCreate

fix ContractStateMachineSpec testcases and add new case

rebase and fix build failure

fix test (and comment)

fix evaluation order test fails: revert the failure back to be the expected ContractNotActive, instead of ContractNotFound

improve new test (creates in try are rolled back) to check the DamlException thrown

remove ptx.localContracts. instead use ptx.contractState.locallyCreated

improve test name

un-inline ActiveLedgerState.consume

Set() --> Set.empty

add comments for new components of ContractStateMachine

combine checks: consumedBy / inactive

improve comments, doc and test-evidence
2022-06-15 15:09:37 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
nickchapman-da
6af36fe1e3
Fix Tx.Metadata for normalized transactions (#10108)
* fix Tx.Metadata for normalized transactions

changelog_begin
changelog_end

* Fixup action seed normalization

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-25 10:53:11 +02:00
Moritz Kiefer
80b07da309
Only archive a key if it was brought into scope before (#9546)
* Only archive a key if it was brought into scope before

This PR implements the semantics we agreed on in
https://github.com/digital-asset/daml/pull/9472#discussion_r620097844.

Before, archive always marked the key as inactive in `keys`. This is
weirdly inconsistent with other operations. For example, a regular
fetch does not bring a key in scope in `keys`. This PR changes this to
a more consistent model where `keys` is modified exactly under the
following circumstances:

1. A create with a key always overwrites.
2. An archive will only mark a key as inactive if there was an entry
   in `keys` with the same contract id.
3. Lookup/fetch by key first check if we currently have an entry in `keys`.
   If so, we use that.
   If not, we need to ask the ledger. We first check if we have a
   ceched entry in `globalKeyInputs`. If we do use that.
   If we don’t, we ask the ledger.
   If the result is not active or not visible we proceed updating `keys`
   and `globalKeyInputs`.
   If the result was a cid, we check if it’s still active.

changelog_begin
changelog_end

* Review comments

changelog_begin
changelog_end

* Apply suggestions from code review

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

* fmt

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-05-06 14:11:32 +00:00
Moritz Kiefer
9ae787d005
Cache global key inputs (#9538)
* Cache global key inputs

This PR changes speedy such that it will query at most once for a global
key. This is a prerequisite for a (sensible) duplicate key detection
and for sensible multi-key semantics.

Note that there is one outstanding issue here:

As a general rule, we only want by-key operations to bring a key in
scope not just a random operation like an exercise or a fetch that
happens to have a key.

However, for consuming exercises this is currently not the case. They
always bring the key in scope. The plan here is for an archive to not
block a further lookup and instead add an activeness check to the
lookup afterwards.

changelog_begin
changelog_end

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

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

* s/CtrlImportValue/SEImportValue/

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Use a custom Scala type instead of Option[Value.ContractId]

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-05-04 13:49:58 +00:00
Moritz Kiefer
86c1630660
Fix handling of consumedBy and keys in partial transaction rollbacks (#9430)
Spun out from #9410 for ease of review and to force to write proper
tests :)

changelog_begin
changelog_end
2021-04-16 16:43:02 +02:00