Commit Graph

1882 Commits

Author SHA1 Message Date
Samuel Williams
d6bc75fcc0
Bring back script integration, this time tested for different SDK versions (#16361) 2023-02-23 09:20:12 +00:00
dylant-da
adb01a7b68
Table and transaction view in daml test (#16353)
* Initial outputTables work

* refactor outputTables

* Fix duplicate ShowCoverage opt

* Export TableOutputPath & TransactionsOutputPath constructors

* Implement outputTransactions

* Fix redundant imports, unused fields

* Embed extension's CSS style into generated tables / traces

* lint

* Extract webview css without locateResource

* Check stylesheet exists before reading it, emit warning if necessary

* Refactor tryWithPath
2023-02-22 17:56:50 +00:00
Samuel Williams
1d8c361dc1
Revert integration test support until fixed (#16360)
* Revert integration test support until fixed

* Remove some missing changes
2023-02-21 14:19:37 +00:00
dylant-da
a90865d370
Show time elapsed on running scenarios in IDE (#16324)
* PoC: Add live script runner with intermediate live messages

* Unify live and non-live scenario service script runners

* Add live scenarios

* Clean up runLiveScenario

* dedupe runLiveScenario/runLiveScript

* return to onComplete mode

* Send status update every second

* Send progress events with milliseconds passed instead

* Fix runLiveScript -> runLiveScenario

* Show milliseconds passed in scenarios

* Sleep a random amount 300;600 ms

* Try to prevent older status updates from overwriting newer ones

* lint

* wrap errors appropriately

* Remove wrong secondary webview update

* Define variants inside companion object

* use abstract class instead of trait

* lint
2023-02-20 17:19:42 +00:00
Moisés Ackerman
dd9c07177f
Timeouts are now reported correctly for daml-script Scripts (#16344)
Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-02-20 11:03:21 +01:00
Remy
12c240e06e
[Speedy] do not need disclosed contract at Machine creation time (#16302)
This PR make several (small) changes on how the disclosed contract are
handle by the speedy machine.

(1) disclosed contract at not anymore pass a builtin time. They were
any pass latter using `SBCacheDisclosedContract`.

(2) disclosed contracts are first keep in their own cache,
disclosedContracts: Map[V.ContractId, CachedContract]. They are moved
to the cached for used contract only if used.  In fact we need to be
sure the used disclosed contracts pass through the
Speedy#addGlobalContract to verify the transaction limits are not
overpassed.
2023-02-17 22:59:41 +00:00
Samuel Williams
d3feb57b39
Support Script tests in integration suite (#16323)
* WIP Implement integration script test support

* Add ghc_pkg

* Get scripts to run in integration tests!
Add expected error to new test

* Slight refactor
2023-02-17 11:21:29 +00:00
Samuel Williams
fb55f4c1bb
Add signatory labels to create and fetch in tree view (#16291)
* Add signatory labels to create and fetch in tree view

* Switch node printing in scala and expected ledger files

* Update docs/images

* Update party formatting to use `x, y and z` and correct verb tense

* Update scala to match haskell, update tests and docs (except images)

* Cleanup code from suggestions

* Fix misformatting, refactor
2023-02-16 15:57:01 +00:00
Samuel Williams
0516143831
Fix warning about unused this in exception messages (#16313)
* Fix warning about unused `this` in exception messages

* Fix desugar tests

* Update ghc version

* Update test to include context
2023-02-16 15:32:30 +00:00
mziolekda
1a3980bf89
Separate test-common from the rest of the ledger code (#16307)
* move files

* format

* wrong file

* fix conformance tests

* add readme

* fix compatibility tests

* fix haskell tests
2023-02-14 15:29:13 +00:00
Samuel Williams
0c9ba9e691
Allow name shadowing in choices (#16306)
* Add bypassReduceLambda to allow shadowing

* Fix integration test

* Update ghc, update desugared cases

* Update ghc version
2023-02-14 11:39:42 +00:00
Samuel Williams
5c00481ae0
Source location plumbing (#16269)
* Update protobuf to include sourceloc for implements and coimplements
Relevant haskell changes

* Update error ranges in tests

* Extract source locations from various template/interface parts

* Improve ExprSource extraction

* Move location from instance head to template/interface parts
Add location to instance print
2023-02-10 16:26:34 +00:00
Samuel Williams
9fdeaf2ed4
Fix list pattern match warnings to use :: (#16278)
* Fix list pattern match warnings to use ::

* Add test case

* Update ghc version
2023-02-10 16:24:46 +00:00
Remy
a75db47275
[LF] factorize GlobalKeyWithMaintainers and KeyWithMaintainers (#16251) 2023-02-08 13:58:43 +01:00
Samuel Williams
90a0f13829
Implement name synonyms in error prints (#16242)
* Implement interface name synonyms in error prints
* Add View type synonym test
2023-02-08 10:33:57 +00:00
Remy
2851401df6
[ScenarioService] add evaluation timeout (#16204)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-02-06 08:59:12 +01:00
Remy
aad8725ea7
[damlc] change default output to 1.15 (#16157) 2023-02-06 08:58:47 +01:00
Remy
68a718ef58
Revert "Revert "Reactive requires in surface language (#15570)" (#16222)" (#16231)
This reverts commit db6e87589a.
2023-02-03 13:05:48 +01:00
Remy
db6e87589a
Revert "Reactive requires in surface language (#15570)" (#16222)
This reverts commit e94f1a74a9.
2023-02-02 19:20:17 +00:00
dylant-da
c7ae5f1c93
Allow run tests manually (#16211)
* Add rules for running single scenarios, redefine RunScenario using them

* Turn runScenario into an action, not IO

* Add FormattingStarted custom message type

* Redefine OfInterest rule in terms of RunSingleScript

* lint

* fix broken renamed var

* Use getFilesOfInterest for diagnostics & uncompilable check

* explicitly run tests that need to be run

* Amend test

* Remove commented out code

* Remove vr formatting message
2023-02-02 17:59:11 +00:00
nickchapman-da
d406e0a8df
remove clunky of suffix from with-authority internal names (#16214) 2023-02-01 16:19:06 +00:00
Moisés Ackerman
e9963e88df
Unhide DA.Internal.LF.coerceContractId (#16180) 2023-01-27 15:24:11 +01:00
Remy
3603ba870b
[Speedy] add cooperative interuptions (#16129)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-01-26 16:05:33 +01:00
nickchapman-da
4aa5b7d768
add new tx node type: Node.Authority (#16070) 2023-01-25 11:09:56 +00:00
Moisés Ackerman
8784ebd9ce
Add choiceController and choiceObserver functions (#16088)
* Add daml test file for choice functions

* Add HasChoice{Controller,Observer} type classes

* Add choice_{controller,observer} in LF

* Update GHC_REV

* Generate HasChoice{Controller,Observer} instances

* Remove manual instances in daml test file for choice functions

* Remove/forbid choice{Controller,Observer} before featureChoiceFuncs

* update *.desugared-daml golden files

* Apply code review suggestion

* Update GHC_REV (da-master-8.8.1)

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-01-18 14:50:00 +00:00
nickchapman-da
41fa30cfd4
add daml feature: DAML_WITH_AUTHORITY (#16075) 2023-01-16 15:18:22 +00:00
nickchapman-da
f32419da20
[engine] withAuthorityOf: support from Daml --> Speedy (#16029) 2023-01-16 12:55:34 +00:00
Carl Pulley
980464a866
Disable visibility checks for local contract keys (#15131)
Main part of  #14199

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-01-13 15:16:33 +00:00
dylant-da
03a76f4a61
Turn Daml-specific errors into suggestions on the original error (#16017) 2023-01-11 15:44:45 +00:00
Moisés Ackerman
4feeed6598
Use daml.yaml args in 'daml repl' (#15958) 2023-01-09 12:45:22 +01:00
dylant-da
0701488c40
Fix return type error for methods (#15999)
* Add tests for method result mismatches & for interface synonyms

* point to updated ghc
2023-01-06 12:54:34 +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
Remy
e94f1a74a9
Reactive requires in surface language (#15570) 2022-12-19 09:28:43 +01:00
Bernhard Elsner
1f30da1f23
Remove "Module" from daml-doc H1 headers (#15862)
* Remove "Module" from daml-doc H1 headers

CHANGELOG_BEING
- Remove the word "Module" from the H1 page header of
- module pages and stop overriding the ToC headers to make
- the generated pages easier to use.
CHANGELOG_END

* Reinstate links in daml-docs rst TOC

* Update render tests

* Update golden tests

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-12-16 10:19:08 +00:00
Remy
f1aca5e11c
[Speedy] create Scenario Machine (#15588) 2022-12-16 08:20:42 +00:00
dylant-da
445104a41b
Custom error / fix error for wrong expected return type of a choice. (#15855)
* Point to updated GHC

* add test for choice result mismatch

* add test for interface

* point to updated ghc

* point to merged ghc
2022-12-13 18:08:32 +00:00
dylant-da
f9d7301024
Fix erroneous code action/lens suggestions in Daml Studio (#15731)
* point to updated ghc

* point to updated GHC

* point to updated GHCIDE

* point to updated ghc

* Make _requires_ non-writable by inserting dollar - amend detectors

* Make _choice_ declarations non-writable (add dollar)

* Add checks for dollar-gen'd code require/view/interface_instance/method

* point to updated GHC

* point to updated ghc

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* point to updated GHC

* Point to updated ghcide

* update desugar tests

* point to revised daml-ghcide

* point to updated ghc

* point to updated ghc

* replace with isDamlGenerated

* point to merged ghc and merged ghcide
2022-12-13 12:06:40 +00:00
Stephen Compall
1ac4199538
update qs, express for security (#15874)
- fixes for CVE-2022-24999

* upgrade qs, express in root

* upgrade qs in daml-extension

* upgrade qs, express in navigator
2022-12-12 15:52:19 -05:00
Stefano Baghino
18ed316827
Accept uppercase English alphabet letters in user IDs (#15832)
* Accept uppercase English alphabet letters in user IDs

changelog_begin
Accept uppercase English alphabet letters in user IDs
changelog_end

* Fix title case in docs change

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>
2022-12-08 16:44:54 +00:00
dylant-da
caf6d1d22a
Fix internal interface instance count (#15806) 2022-12-07 13:37:47 +00:00
Moisés Ackerman
f35ebb8dcd
Move stdlib datatypes into stable packages (#15795)
* Move datatype DA.Action.State.State into a stable package

* Move datatype DA.Stack.SrcLoc into a stable package

* Move datatype DA.Random.Minstd into a stable package

* Skip doctest for DA.Action.State.Type

* Don't use magic numbers in CodeGenRunnerTests.scala

* Update comment in StablePackageTest.scala
2022-12-06 15:48:35 +01:00
Stephen Compall
c24c17d595
Javascript library security updates (#15798)
Incorporates fixes for

- CVE-2022-3517
- CVE-2022-37599
- CVE-2022-37601

* update minimatch in root
* update minimatch in daml-extension
* update minimatch in typescript libraries
* update minimatch and loader-utils in navigator
2022-12-05 12:40:46 -05:00
Moisés Ackerman
6bafad6b20
Fix dlint hints for DA.{Action=>Functor}.void (#15746) 2022-12-01 16:06:33 +01:00
Moisés Ackerman
ccb1df08a7
Use daml-base-anchors.json when '--input-anchor' unspecified (#15715)
* Use default anchors for daml-prim and daml-stdlib when building docs

This PR introduces two flags for subcommand 'daml docs':

* '--default-input-anchor' to use the default anchors defined by //compiler/damlc:daml-base-anchors.json. This is the default if neither '--input-anchor=PATH' nor '--no-input-anchor' are passed.
* '--no-input-anchor' to use an empty anchor map. This is used to build //compiler/damlc:daml-base-anchors.json, since it cannot depend on itself.

* break cyclic dependency
2022-12-01 10:08:07 +01:00
Moisés Ackerman
badfb9dcea
Improve error message for attempted use of '..' in record update (#15712)
* Update GHC_REV

* Add test case
2022-12-01 10:07:29 +01:00
dylant-da
05d9ee89f3
Improve interpretation error consistency (#15680)
* Add custom viewtype mismatch error

* Modify error message on EViewTypeMismatch to be like GHC error

* Make EUnknownMethodInInterfaceInstance error consistent w/ GHC

* Add MethodTypeMismatch error, sync with GHC error

* Prefix fields in new errors

* Intercept type mismatch in method to throw EMethodTypeMismatch

* Synchronize EUnknownField with GHC-side message

* Complete synchronizing EUnknownField with GHC-side error message

* satisfy lint and changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* lint

* Fix TypingSpec for new EMethodTypeMismatch

* lint

* lint again

* EFieldTypeMismatch error for ERecUpd/ERecProj mismatch, like in GHC

* lint
2022-11-29 13:02:46 +00:00
Gary Verhaegen
46a4804672
bump nix (#15628)
Partly because the current version is from February (of this year,
fortunately), and partly because I need a more recent one to bump node
to 18 and fix the GSG for that.
2022-11-24 14:29:09 +00:00
dylant-da
ff6e776da0
Improve type error for Numeric types with precision > 37 and mistyped/missing field access (#15626)
* point to GHC with improved error

* Point to new GHC

* Fix error in RelTimeDetailsHidden1

* Point to updated ghc

* Point to new GHC

* Satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Fix assertion in RelTimeDetailsHidden1

* Amend tests with out-of-bounds NumericScale, point to updated GHC

* Drop quotes around type error

* Add tests for field access errors

* point to merged GHC
2022-11-22 15:44:25 +00:00
dylant-da
ccde982df5
Error for implementing non-interfaces (#15435)
* point to updated GHC

* satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* Point to updated GHC

* Expect new interface view error message in ImplementsNonInterface

* Add test for trying to implement a non-interface

* Point to GHC with better error suppression, fix tests

* Remove unused TryImplementNonInterface

* point to rebased ghc

* point to forwarded GHC changes

* point to updated GHC

* Fix expected error in ImplementsNonInterface

* Point to merged commit
2022-11-22 11:07:21 +00:00
Jonas De Vuyst
514a757e57
Add DA.List.chunksOf function in Daml stdlib (#15618) 2022-11-21 16:09:34 +00:00