Commit Graph

2694 Commits

Author SHA1 Message Date
Andreas Herrmann
9fbb787062 Remove unused dependencies to da_scala_test(_suite) (#3925)
* Remove unused scala.bzl imports

* override_targets org.scalatest.scalatest_2.12

Otherwise, rules_scala implicitly adds a different version to scala_test
than other packages transitively depending on scalatest. This causes
unused dependency checker to raise an error.

* Handle rules_scala scalatest in pom_file.bzl

* Inline all scala_test dependencies

So that `unused_dependency_checker = "error"` can be applied to them.

* Run //:buildifier-fix

* TMP scala_test_suite --> scala_test

* da_scala_test: Enable unused dependency checker

* //navigator/backend:navigator-scala-tests

* //ledger/sandbox:sandbox-scala-tests

* //ledger/participant-state/kvutils:kvutils-tests

* //ledger/participant-state:participant-state-tests

* //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test

* //ledger/ledger-api-common:ledger-api-common-scala-tests

* //ledger/ledger-api-client:ledger-api-client-tests

* //ledger/ledger-api-auth:ledger-api-auth-scala-tests

* //ledger-service/lf-value-json:tests

* //ledger-service/jwt:tests

* //ledger-service/http-json:tests

* //ledger-api/rs-grpc-akka:rs-grpc-akka-tests

* //language-support/scala/codegen-sample-app:tests

* //language-support/scala/codegen-sample-app:ScalaCodeGenIT

* //language-support/scala/codegen:tests

* //language-support/scala/bindings-akka:tests

* //language-support/java/codegen:test

* //language-support/java/codegen:ledger-tests

* //language-support/java/bindings-rxjava:bindings-java-tests

* //language-support/codegen-common:test

* //extractor:extractor-scala-tests

* //daml-lf/scenario-interpreter:scenario-interpreter_tests

* //daml-lf/language:language-test

* //daml-lf/interface:tests

* //daml-lf/engine:tests

* //daml-lf/encoder:tests

* //daml-lf/archive:daml_lf_archive_reader_tests

* //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests

* UNDO scala_test_suite --> scala_test

This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 13:49:59 +00:00
Rohan Jacob-Rao
6c480cf9ae
Fix typos in daml2ts readme (#3927) 2019-12-27 11:10:32 -05:00
Rohan Jacob-Rao
f04ce1a3c8
Fix typo in hlint rule (#3926) 2019-12-26 16:23:04 -05:00
Leonid Shlyapnikov
f22d52a2ff Change variant JSON encoding, so it is easier to pattern match on it in TypeScript (#3882)
* Change variant json encoding,

adding integration test

* Add DamlLfTypeLookup dependencies

* Add MetadataReader

* Add test WIP

* Add serialize test cases

* Add serialize test cases, WIP

* Test for variant encoding decoding

* Solving merge conflicts

* Updating roundtrip test

* Minor cleanup

* Addressing code review comments

Add JsonVariant custom matcher

* Update specification

* Update link

* Add test case, WIP

* Add proper template key resolution

* Got rid of choice record ID resolution, resolving choice type and key type

* Fixing logging

* Add Contract Key decoding tests

* cleanup

* cleanup

* Update JSON variant encoding tests

* Add more contract key JSON decoding tests

* Fix variant JSON encoding

* Change value predicate to support new variant encoding

* Change value predicate to support new variant encoding

* Add lookup by contract key test case

where contract key contains variant and record

Add `requiredResource` to bazel utils

CHANGELOG_BEGIN

- [JSON API - Experimental] Change variant JSON encoding. The new format is ``{ tag: data-constructor, value: argument }``.
  For example, if we have: ``data Foo = Bar Int | Baz``, these are all valid JSON encodings for values of type Foo:
  - ``{"tag": "Bar", "value": 42}``
  - ``{"tag": "Baz", "value": {}}``
  See #3622

- [JSON API - Experimental] Fix ``/contracts/lookup` find by contract key.

- [JSON API - Experimental] Fix ``/command/exercise`` to support any LF type as a choice argument.
  See #3390

CHANGELOG_END

* minor cleanup

* Fix copy/paste

* Renaming

* Got rid of DAML LF identifier resolution

resolving DAML LF Type based on command type

* Address code review comments, thanks @S11001001

* Address code review comments, thanks @S11001001

Do not include any error handling here; this partial function should
only match the successful case, JsonVariant.

* Address code review comments, thanks @S11001001

comment

* Address code review comments, thanks @S11001001

using `JsonVariant` for variant encoding/decoding

* Address code review comments, thanks @S11001001

replace `find` and `map` chain with collectFirst

* Update docs/source/json-api/lf-value-specification.rst

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <scompall@nocandysw.com>
2019-12-24 20:55:44 +00:00
Samir Talwar
1794d8a2fd Sandbox: Manage resources and close them properly on failure. (#3871)
* sandbox: Create a monadic `ResourceOwner` to manage resources.

* sandbox: Rewrite `ResourceOwner` to be async.

* sandbox: Make sure failed resources are closed immediately.

* sandbox: Better naming in `Open`.

* sandbox: Rename `Open` to `Resource`, and open/close to acquire/release.

* sandbox: Convert `() => AutoCloseable` into `ResourceOwner`.

* sandbox: Refactor the LedgerApiServer in terms of resources.

* sandbox: Explicitly convert `() => AutoCloseable` to `ResourceOwner`.

Explicit > Implicit, right?

* sandbox: Create helpers for converting things to ResourceOwners.

Because I tried to start using them and there was so much code being
written at once.

* sandbox: Simplify construction of JdbcLedgerDao.

* sandbox: Releasing resources should be idempotent.

In that we should only do it once.

* sandbox: Fix the ResetService by closing the API services _first_.

They need to be shut down before the gRPC server.

* sandbox: Don't try and shut down PostgreSQL twice in tests.

* sandbox: Actually run the assertions in ResourceOwnerSpec.

Facepalm.

* sandbox: Test `Resource.sequence` more rigorously.

* sandbox: Move the helpers around `Resource` into `Resource.apply`.

* sandbox: Convert LedgerApiServer resource owners to classes.

* sandbox: Make `ResourceOwner` a monad too, delegating to `Resource`.

* sandbox: Turn `LedgerApiServer` into a ResourceOwner.

* sandbox: Simplify the public signature of `Resource.apply`.

* sandbox: Use ResourceOwners to simplify DB resource management.

This is one hell of a change. Sorry.

* sandbox: Try not to nest `Await.result` calls.

Causes issues when running in a `DirectExecutionContext`.

* sandbox: Turn index subscriptions into resources.

* sandbox: Fix warnings in RecoveringIndexerSpec.

* sandbox: Always release before recovering the indexer.

* sandbox: Add `flatten` and `transformWith` to `Resource`.

* sandbox: If releasing twice in parallel, the second should wait.

* sandbox: If the indexer recovers, clean up the old subscription.

* sandbox: Convert StandaloneIndexerServer into a resource owner.

* sandbox: Convert StandaloneApiServer into a resource owner.

* reference-v2: Rewrite ReferenceServer in terms of resources.

CHANGELOG_BEGIN

- [Reference v2] On an exception, shut down everything and crash.
  Previously, the server would stay in a half-running state.

CHANGELOG_END

* sandbox: Rewrite SandboxServer in terms of resources.

* sandbox: Write the port file in a Future.

* sandbox: JdbcIndexer no longer needs to manage the actorSystem.

* sandbox: Shut down the LedgerApiServer when closing the Sandbox.

* sandbox: Rename `Resource.pure` to `Resource.successful`.

* sandbox: Rename `Resource.sequence_` to `sequenceIgnoringValues`.

* sandbox: Delete `CloseableResource`.

It's only used in once place. Just inline it.

* sandbox: `LedgerDao` no longer needs to be closeable.

* sandbox: Delete implicit materializers where they're not used.

* http-json: Wait for the Sandbox to start in tests.

* sandbox: Convert `scheduleHeartbeats` into a ResourceOwner.

* reference-v2: Explain why we steal ownership of the actor system.

* sandbox: Document why we only release resources once.

* sandbox: Add clues to ResourceOwnerSpec.

* http-json: Fix HttpServiceTestFixture to pass auth service through.

* codegen-sample-app: In ScalaCodeGenIT, wait for the server to  start.
2019-12-22 15:05:55 +00:00
Martin Huschenbett
b72dbb90f2 Remove some dlint rules which don't apply to DAML (#3920)
Also fix some rules to use `mapA` and friends instead of `mapM` and friends.
2019-12-22 07:56:18 -05:00
Stephen Compall
4d04044719
reenable scalafmt (#3924)
* reenable scalafmt

* CI experiment

* add --diff-branch option

* reformat test Scala file, after confirming its failure in CI
2019-12-20 18:02:43 -05:00
Martin Huschenbett
f725137795 daml2ts: Do some maintenance tasks in daml-ledger-fetch (#3922)
Fix a few todos. Remove a few useless lambdas. Use newer syntax.
2019-12-20 18:44:17 +00:00
Stephen Compall
ac7fa36162
typed testing support for LF Enums (#3913)
* runtime-filtering-only-style enum for ValueAddend

- the alternative is a coproduct of singleton types, which would be more
  like the other ValueAddend combinators, but done differently here as
  an experiment

* test an enum case for lf-value-json
2019-12-20 12:14:17 -05:00
Martin Huschenbett
02d72e3a55 daml2ts: Clean up yarn.lock for support libraries (#3921) 2019-12-20 17:08:56 +00:00
Stefano Baghino
48d2fa1e1a Nuke //ledger/ledger-api-integration-tests (#3919) 2019-12-20 15:44:28 +00:00
Stefano Baghino
7020ed3b15
Moves CommandCompletionIT to Ledger API Test Tool (#3901)
* Moves CommandCompletionIT to Ledger API Test Tool

Closes #2841

Also refactors test observers into a single API and unifies the existing implementations of the DirectExecutionContext

* Allow explicit offsets to get checkpoints

* Raise checkpoint test timeout

* Consolidate checkpoint tests in a single test case

* Fix compilation issues

* Exclude command submission/completion tests for rev-v2

* Drop test not relevant for Ledger API implementations

* Fix compilation errors
2019-12-20 15:55:23 +01:00
Shayne Fletcher
11681c6aa3
Add 'R' to 'Choice<T,C,R>' defn (#3895)
* 'Choice<T,C,R>' defn

* Speculative. Account for the absence of tuples

* Finalize the exercise decoding and add a test

* Shorter version of bazel bootstrap (recommended by AH)

* argDecoder => argumentDecoder

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/daml-ledger-fetch/src/index.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/generated/src/__tests__/test.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/tests/ts/generated/src/__tests__/test.ts

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Remove spurious return

* argDecoder => argumentDecoder

* Note to self : don't accept suggestions, implement them yourself

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-12-20 08:48:23 -05:00
Stefano Baghino
822ce28e75
Port command/transaction checks to Ledger API Test Tool (#3917)
Closes #2842
Closes #2843

The separation between high-level and low-level is not particularly meaningful, as the low-level variant issues commands with a component used by the high-level variant.
The separation aims at performing integration tests at two different levels but this can be addressed by a single suite of integration tests and relying on unit testing for individual components.

The first two tests:

- 'having many transactions all of them has a unique event id' reads transactions from an empty ledger and doesn't really test anything, so this has been dropped because the uniqueness of event identifiers is already more than covered by many tests in the 'TransactionService' suite.
- 'handle bad Decimals correctly' ensures the ledger api rejects unrepresentable decimals and it have been re-implemented as 'Reject unrepresentable numeric values' in the 'CommandService' suite.

The other tests are about command-and-exercise:

- 'process valid commands with workflow ids successfully' -> 'Implement create-and-exercise correctly'
- 'fail for invalid create arguments' -> 'Fail create-and-exercise on bad create arguments'
- 'fail for invalid choice arguments' -> 'Fail create-and-exercise on bad choice arguments'
- 'fail for an invalid choice' -> 'Fail create-and-exercise on invalid choice'
2019-12-20 13:24:55 +01:00
Stefano Baghino
6ece2b4147
Port backpressure tests to Sandbox integration tests (#3910)
Closes #2847
2019-12-20 13:22:18 +01:00
Martin Huschenbett
be8c55e666
Remove dlint hint notes mentioning NaN (#3916)
There's no NaN in DAML, hence the note that a refactoring suggested by dlint
is wrong for NaN is useless.
2019-12-20 13:15:15 +01:00
Rohan Jacob-Rao
2b4a79c68f Tidy up release instructions (#3911)
* Tidy up first step of release instructions

* Minor adjustments to the rest of the instructions

* Fix

* Tweak
2019-12-20 11:12:12 +01:00
Brian Healey
9f13a2fb10 Upgrade to Akka 2.6.1, akka-http 10.1.11 and Scala 2.12.10 (#3903)
* Upgrade to Akka 2.6.1, akka-http 10.1.11 and Scala 2.12.10

Akka 2.6.1 Upgrade Changes
- Materializer in place of ActorMaterializer
- Source.future instead of Source.fromFuture
- The Scheduler.schedule method has been deprecated in favor of selecting scheduleWithFixedDelay or scheduleAtFixedRate
- onDownstreamFinish(cause: Throwable)
- ActorAttributes.supervisionStrategy(...) in place of ActorMaterializerSettings.withSupervisionStrategy

See https://doc.akka.io/docs/akka/current/project/migration-guide-2.5.x-2.6.x.html

* Akka 2.6.1 Upgrade Changes
- onDownstreamFinish(cause: Throwable)

See https://doc.akka.io/docs/akka/current/project/migration-guide-2.5.x-2.6.x.html

* code review: remove unnecessary supervision strategy
2019-12-19 18:00:59 +00:00
Samir Talwar
752e15bfb7 Sandbox: Test RecoveringIndexer logs, and stop dumping them to STDERR. (#3891)
* sandbox: Fix warnings in RecoveringIndexerSpec.

* sandbox: Test RecoveringIndexer logs, and stop dumping them to STDERR.

Printing logs during test execution is really annoying. This stubs the
logger factory with a TestNamedLoggerFactory which captures them in a
list instead, for testing purposes.

* sandbox: Remove unnecessary comments from {,Simple}NamedLoggerFactory.

* ledger-api-common: Remove unused parts of the NamedLoggerFactory.
2019-12-19 15:39:05 +00:00
Stephen Compall
7c1e40f391 friendly and gen testing for LF records, variants (#3838)
* drop Nones from records when JSON-encoding

* elide some needless conversions in ApiCodecCompressed

* record with visible Inj

- seems to be running up against scala/scala#5075

* use new 3rdparty lib reference

* construct record types field-by-field

- works around scala/scala#5075

* switch to record style for records' Inj

- suggested by @leo-da

* include some samples to experiment with record

* record parsing

* RecordVa doesn't benefit from kind-projector

* scalafmt

* make RecordVa details private; only intended API is public

* Arbitrary and Shrink record support

* rename RecordVa#Inj to HRec, to accommodate variants in same cons structure

* use record testing in lf-value-json

* add complex record type

* add complex record value and test it

* more documentation for RecordVa

* Table-ify prior record tests

* start adding variant support

* scalacheck support for variants

* more scalacheck support for variants

* variant examples

* example of using align for records

* test variant roundtrip

* test variant in record

* add sample tests for the JSON format of records and variants

* rename record-specific functions in RecordVa

* rename RecordVa to RecVarSpec
2019-12-19 14:48:27 +00:00
Stefano Baghino
9f16d2de43 Fix WallClockTimeIT sandbox configuration (#3907)
Using the default configuration as a base for this test meant binding on 6865 instead of using dynamic port binding, which could cause flaky errors if some other test is occupying the port
2019-12-19 14:06:05 +00:00
Shayne Fletcher
70ea02c592
Update hlint (#3900) 2019-12-19 07:38:28 -05:00
Moritz Kiefer
10a7715d2b Avoid globbing for stable packages (#3905)
I managed to break our Windows CI twice already due to this so while
it makes me sad, I think hardcoding those files is the more sensible
option for now.
2019-12-19 10:29:10 +00:00
Moritz Kiefer
52bf6056a4 Limit ghci target on CI to damlc (#3904)
I’ve seen a bunch of builds on MacOS that seemed to hang forever
somewhere during loading the target (during the step where ghci is
loading modules so after Bazel). I don’t quite know what is going on
there but it seems to correlate with the change in
https://github.com/digital-asset/daml/pull/3829 that further extended
the repl target. Given that the GHCi step takes several minutes by
now, even if it is successful, I think it makes sense to limit this to
damlc given that we very rarely have issues that would result in damlc
loading but the repl target not loading (and very few people use the
latter anyway).
2019-12-19 09:32:55 +00:00
Robert Autenrieth
b87aee82c3 Inline the Navigator banner (#3887) 2019-12-19 09:31:14 +00:00
Peter Garmaz
03d55fa86a daml-sdk container improvements (#3902)
* re-add cleanup for /tmp to remove 700ish mb of unneeded temp files made by the sdk installer

* Set WORKDIR to daml user home dir so that sdk tools can create files

* add daml sdk config defaults for auto-install and update-check sdk install RUN command

* add --no-cache to apk add to reduce size a little

* add line return to end of daml-config.yaml
2019-12-19 08:31:15 +01:00
Rohan Jacob-Rao
256a8f09f6 Release (#3894) 2019-12-19 04:16:15 +00:00
Brian Healey
e8c6364d32
Update akka-http version to 10.1.12, akka-stream version to 2.5.26, and corresponding uptick to scala 2.13 (#3899) 2019-12-18 23:14:28 -05:00
Brian Healey
ec18d9aa95
Update ledger-api-test-tool readme instructions for daml docs (#3898)
* Update ledger-api-test-tool readme instructions for daml docs

* remove STDERR / STDOUT pipe to file examples

* address review feedback

* Add commentary on tests which can be excluded for an --all-tests run because of clock, stress or mutation issues
2019-12-18 22:23:00 -05:00
Moritz Kiefer
c48b0ee289 Move Any wrappers and Archive to stable packages (#3890)
* Move Any wrappers and Archive to stable packages

There are no actual API or functionality changes in this PR but the
logic for locating the stable packages has slightly changed since the
Any wrappers package only makes sense for LF 1.7. To address this, we
simply filter out stable packages for newer LF versions since it
doesn’t make sense to depend on those anyway.

CHANGELOG_BEGIN

- [DAML Compiler] Move ``Archive`` type to a separate DALF.

CHANGELOG_END

* More comments

* Fix java codegen tests

* fix more tests

* Force cache reset on Windows

* Revert "Force cache reset on Windows"

This reverts commit 9f2b7d70b2.
2019-12-19 01:26:38 +00:00
lima-da
a801a55d81
update encoder to be urlEncoder (#3893)
* update encoder to be urlEncoder

* fix decoder as well

* move decoder to constant
2019-12-18 17:26:36 -05:00
Brian Healey
8d56a5c479 Move instructions to run bazel run @unpinned_maven//:pin to top of comments (#3897) 2019-12-18 21:50:14 +00:00
Brian Healey
d8089f44b0
Uptick akka-http version to 10.1.10 / uptick scala version to 2.12.9 (#3896) 2019-12-18 16:22:39 -05:00
Brian Healey
2caa0dbfc5 README reformat on line break (#3892)
CHANGELOG_BEGIN
- [DAML Ledger Integration Kit] Move to asyncronous package management service (#3806)
- [DAML Ledger Integration Kit] Fix indexer crash on duplicate submission.  See #3847
- [DAML Ledger Integration Kit] Standardize and cleanup metric names to use underscores that are compatible with Prometheus
- [DAML Ledger Integration Kit] Add FailingCommandsIT and CommandSubmissionCompletion to Ledger test tool suite. Some of the tests previously part of the CommandService Ledger API Test Tool suite have been moved to a new home in CommandSubmissionCompletion to reflect the fact that those use the submission/completion workflow instead of leveraging the submit-and-wait alternatives.
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>
2019-12-18 15:22:49 +00:00
Martin Huschenbett
8c53ffcba0 Clean up the CPP around roundCommercial (#3889) 2019-12-18 13:39:25 +00:00
mziolekda
7b882e3767
clean up kv metric names (#3888)
* clean up kv metric names

* rename metrics committing->committer

* replace camel-case with prometheus-friendly underscore
2019-12-18 14:27:07 +01:00
Moritz Kiefer
7080fd7961 Fix roundCommercial (#3886)
* Fix roundCommercial

fixes #3884

Previously, we relieid on being able to convert to an Int, which
doesn’t work since there are Numeric values that cannot be represented
as an Int. Now, we avoid any conversions to Int which fixes this
issue.

We probably just want to have a primitive for this at some point but
given that this will only be available in newer LF versions, I think
it’s worth working around this for now.

* Move tests to a separate file to exclude LF 1.6

* Update compiler/damlc/daml-stdlib-src/DA/Internal/Prelude.daml

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Apply suggestions from code review

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Update comments

* Update compiler/damlc/daml-stdlib-src/DA/Internal/Prelude.daml

Co-Authored-By: Remy <remy.haemmerle@daml.com>
2019-12-18 12:16:04 +00:00
Stefano Baghino
af90d634fd Add CommandSubmissionCompletion suite to test tool (#3885) 2019-12-18 09:45:21 +00:00
mziolekda
2fd8372f44
fix indexer crash on duplicate submission (#3847)
* fix indexer crash on duplicate submission

* deduplicate submissions

* few formatting changes

* address review comments

* add pruning comment to dedup value
2019-12-18 09:14:49 +01:00
Moritz Kiefer
4ad3a22c90
Bump timeout in CommandClientIT (#3879)
This test suite was introduced in #3870 and seems to be extremely
flaky both locally (I get about 16/20 failures) and on CI.

The error is

  - should return completions of commands that are submitted after subscription *** FAILED *** (4 seconds, 945 milliseconds)
    Set() did not contain all elements of List("5104", "5100", "5105", "5109", "5103", "5106", "5107", "5102", "5108", "5101") (CommandClientIT.scala:330)

After bumping the timeout, I don’t get any failures locally.

Happy to choose another timeout, I have no clue what a sensible value
is here.
2019-12-18 09:11:47 +01:00
Stefano Baghino
f864ac955b
Port FailingCommandsIT to the Ledger API Test Tool (#3877)
* Port FailingCommandsIT to the Ledger API Test Tool

Closes #2850

The FailingCommandsIT suite contains tests for mismatching ledger
identifier (which is already abundantly covered by the Ledger API Test
Tool) and for bad labels in contract creation, both via submit and
submitAndWait.

Some of the tests previously part of the CommandService Ledger API Test
Tool suite have been moved to a new home in CommandSubmissionCompletion
to reflect the fact that those use the submission/completion workflow
instead of leveraging the submit-and-wait alternatives.

There are also suites that for some reason cover subsequent invocations
of the same services but I'm not sure of the meaning of those and I
would drop them, unless we have a good explanation for those.

* Optimize imports
2019-12-18 09:11:02 +01:00
Moritz Kiefer
2059c4d146
Move stable types from DA.Internal.Template to a separate module (#3876)
* Move stable types from DA.Internal.Template to a separate module

This is in preparation for splitting them into a separate LF package
with a stable package id.

* Fix visualization

* Fix data dependencies
2019-12-17 21:23:04 +01:00
Leonid Shlyapnikov
8b9fb5942d
Fixing a rare test failure, (#3868)
* Fixing a rare test failure,

two independent scalacheck Gens generate duplicate TemplateIds. Duplicate
in this context means having the same moduleName and entityName.
```
- TemplateIdMap.unique should not contain dups *** FAILED *** (102 milliseconds)
  TestFailedException was thrown during property evaluation.
    Message: None was not equal to Some(TemplateId(zy,n,s))
    Location: (PackageServiceTest.scala:81)
    Occurred when passed generated values (
      arg0 = List(TemplateId(zy,n,s)),
      arg1 = List(TemplateId(lj,n,s), TemplateId(g,n,s))
    )
```

* Addressing code review comments, thanks @S11001001

* Addressing code review comments, thanks @SamirTalwar

* Minor cleanup
2019-12-17 13:00:37 -05:00
Stefano Baghino
3ef2b2181d
Move CommandStaticTimeIT to Sandbox integration tests (#3874)
* Move CommandStaticTimeIT to Sandbox integration tests

Closes #2848

* Address https://github.com/digital-asset/daml/pull/3874#discussion_r358803654

* Address https://github.com/digital-asset/daml/pull/3874#discussion_r358802902
2019-12-17 17:01:46 +01:00
Stefano Baghino
699fef1f3a
Move Scala Ledger API client integration tests (#3870)
* Move Scala Ledger API client integration tests

Closes #2845

The Scala Ledger API client tests belong to the
//ledger/ledger-api-client package.

* Reduce noise coming from tests
2019-12-17 16:11:27 +01:00
Martin Huschenbett
00f23ef7d5
Rename Contract type to CreateEvent and move it to daml-ledger-fetch (#3869)
What was called `Contract` until now is actually a create event. Hence the
renaming. We'll most likely get a `Contract` type in DAML as well and this
renaming will avoid a name conflict. Also, create events are not part of
DAML-LF values and hence not generated by `daml2ts`. Thus, there's not need
to have them in `daml-json-types`. Instead, they should be in a future
`daml-json-api-types` package which captures the types used by the JSON API.
2019-12-17 15:05:32 +01:00
Andreas Herrmann
06cd1f14a2
Expose timestamp in DAML triggers (#3858)
* Add time to Trigger update function

CHANGELOG_BEGIN

- [DAML Triggers - Experimental] Expose timestamp in triggers.
  See `#3612 <https://github.com/digital-asset/daml/issues/3612>`__.

CHANGELOG_END

* Add triggers time test

* Update trigger docs
2019-12-17 11:12:05 +01:00
Moritz Kiefer
52e594a2e9
Move optWriteIface to compile-specific options (#3861)
Originally, this made sense as a flag in Options since we read it
during typechecking to write out interfaces on the fly. But now, we
write this is only used in execCompile so having this be a global
option that is ignored anywhere but in `compile` is rather confusing.
2019-12-17 11:05:28 +01:00
Moritz Kiefer
c65f918145
Bump ghcide (#3865)
* Bump ghcide

* Fix goto definition tests

* Fix hie-bios config

* Try to fix windows
2019-12-17 10:21:52 +01:00
Martin Huschenbett
6d83a7bf47
Move daml-json-types to TypeScript 3.7.3 (#3856)
This should have happened in a previous PR, but I missed it.
2019-12-17 08:47:41 +01:00