Commit Graph

1017 Commits

Author SHA1 Message Date
Stephen Compall
4c1b4842f4
generic exerciseArchive for Java codegen (#17113)
* exerciseArchive(Archive) was skipped before by the flattening rules
  because Archive is defined in a separate package. By flattening across
  packages in this PR, Archive is now a valid candidate.

* The new Exercises.Archive interface is a superinterface of most
  generated exercise* method sets, and therefore generated ContractIds,
  CreateAnds, and ByKeys, giving a LUB to different contract types that
  contains the exerciseArchive method.

  - This is most, not all, because the Daml-LF rules determine what
    codegen ought to do, and Daml-LF does not mandate an Archive method
    of any kind, never mind one in the exact shape that we happen to
    generate.

  - If an Archive is present, and it has an empty record as its
    parameter and Unit as its result type, then we can safely assume
    that the exerciseArchive method is sensible to include in the type.

  - However, this still excludes the generic ContractId type, because
    generic ContractId does not have enough data to generate a
    Daml-LF-correct Archive command given the unknowns mentioned
    above. So we simply exclude it from the type instead of guessing the
    argument and hoping the guess is close enough. That's why the
    Exercises.Archive type is available to users who want access to the
    method, which is a supertype of codegenned contract IDs among other
    things mentioned above:

      SimpleTemplate.ContractId cid = new SimpleTemplate.ContractId("id"); 
      Exercises.Archive<?> wideCid = cid; 
      assertEquals( 
       wideCid.exerciseArchive().commands(),
       cid.exerciseArchive(new Archive()).commands());
2023-07-18 09:52:16 -04:00
Stephen Compall
d04e443ed4
include the concrete ContractId type in Java codegen create's type (#17101)
* return Update<Created<ContractId>> instead of a ContractId supertype

* test case demonstrating the stricter static type of `create`
2023-07-12 10:20:35 -04:00
Gary Verhaegen
de6f31c4d8
canton: allow depending on arbitrary sha (#16926) 2023-06-01 15:06:35 +00:00
mziolekda
06abd5c649
Clean up ledger dependencies (#16894)
* remove sandbox-on-x project

update bazel readme

update release artifacts

comment out last remaining SoX test

remove ledger-runner-common

remove participant-state-kv-errors

remove recovering-indexer-integration-tests

remove participant-integration-api

update doc pages

cleanup ledger-api-auth usage

remove participant-state

fix build

fix build

clean up ledger-api-common part I

clean up ledger-api-comon part II

clean up ledger-api-common part III

remove ledger/metrics

clean up ledger-api-health and ledger-api-domain

* remove ledger-configuration ad ledger-offset

* remove ledger-grpc and clean up participant-local-store

* reshuffle few more classes

* format
2023-05-23 13:44:17 +00:00
mziolekda
95cc249ddd
Remove sandbox on x (#16890)
* remove sandbox-on-x project

* update bazel readme

* update release artifacts

* comment out last remaining SoX test

* remove ledger-runner-common

* remove participant-state-kv-errors

* remove recovering-indexer-integration-tests

* remove participant-integration-api

* update doc pages

* cleanup ledger-api-auth usage

* remove participant-state

* fix build

* fix build
2023-05-23 09:25:54 +02:00
pbatko-da
9b04f15c63
IDP extensions - proto update user idp (#16867) 2023-05-17 10:40:23 +02:00
Remy
a863d69d34
Move CatonFixture in its own bazel module (#16824) 2023-05-10 23:15:26 +00:00
Samuel Williams
537447d92c
Json Api tests to canton (#16782)
Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-05-10 16:01:39 +01:00
Carl Pulley
8fb76c5b63
In-memory trigger service Canton test migration (#16811) 2023-05-10 12:16:57 +01:00
Remy
b15f577298
Fix Main after conflict between 993ddaacb and 7149ebdb (#16818) 2023-05-08 08:44:12 +00:00
Samuel Williams
993ddaacb8
Convert remaining language-support tests to canton (#16763)
* Convert remaining language-support tests to canton

* Tweaks

* Make ScalaCodeGenIT async

* Rename usingLedger to withFixture

* Update TODOs

* Add changes from Remys PR

* Cleanup imports

* Address Remy's review

* Fix ts codegen tests
2023-05-05 16:05:15 +00:00
Samuel Williams
803b7256df
Convert hs-bindings tests to canton (#16750)
* Convert hs-bindings tests to canton
2023-05-05 10:33:23 +00:00
Samuel Williams
52b9193631
Convert all daml-helper test suites to canton (#16722)
* Convert all daml-helper test suites to canton
2023-04-21 09:19:43 +01:00
Oriol Muñoz
c316df194d
Fix errors with status code 200 not being handled properly (#16695) 2023-04-18 10:23:28 +02:00
mziolekda
d8d55ca412
upgrade to scala 2.13.10 (#16423)
* update build system to scala 2.13.10

* fix failing scala files

* format

* fix compatibility

* resolve conflict on maven_install_2.13.json
2023-02-28 23:21:53 +00:00
Sergey Kisel
b33d635beb
Customizable JWT audiences (#16330) 2023-02-27 16:05:38 +01: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
mziolekda
d9974984fd
Remove circular dependency on the //ledger project caused by ledger-resources [DPP-1410] (#16295)
* remove circular dependency on the //ledger project caused by ledger-resources

* format
2023-02-13 08:38:44 +00:00
tudor-da
e5b7ab6066
Add GetLatestPrunedOffsets to TransactionService [DPP-1394] (#16186)
* Add GetLatestPrunedOffsets to TransactionService

* Add compatibility test exclusion

* Add GetLatestPrunedOffsetsAuthIT test

* Address Pawel's review comments

* Addressed review comments

* Add exclusion for the new test for conformance tests in Canton

* WIP
2023-02-09 13:05:57 +00:00
Arne Gebert
3e29aa5ac3
Add createArgumentsBlob and ContractMetadata to Java bindings' CreatedEvents (#16221)
This PR adds the attributes createArgumentsBlob and ContractMetadata to the CreatedEvent types by the Java bindings.
Passing these attributes through is required for being able to use explicit disclosure with the Java bindings (required by the CN team).
2023-02-06 11:23:36 +00:00
Sergey Kisel
b42267298f
Reorder auth operations to check default auth service first (#16128) 2023-01-25 15:03:33 +01:00
atriantafyllos-da
a05de7d248
Upgrade toxiproxy-java, circe, spray-json, spray-json-derived-codecs versions. (#15949)
Upgraded toxiproxy-java, circe, spray-json and spray-json-derived-codecs.

changelog_begin
changelog_end
2023-01-24 17:05:57 +00:00
Nicu Reut
f370124518
Rename telemetry to tracing [PLEN-70] (#16073) 2023-01-17 09:22:31 +01:00
Sergey Kisel
f184892125
Authorization rule changes for IDPs isolation [DPP-1336] (#15848) 2023-01-12 13:43:48 +01: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
Raymond Roestenburg (Actually RayRoestenburg)
f86b25714d
Added submitAndWaitForResult(UpdateSubmission), deprecated submitAndWaitForResult(CommandSubmission, Update) (#15934)
* Fixes #15905
2022-12-24 10:50:28 +00:00
atriantafyllos-da
c43e58e054
Upgrade daml libraries 2 (rxjava, HikariCP, squareup, commons-io, sourcecode, gson, scalameter, checkerframework) [DPP-1362] (#15939)
Upgraded
* checkerframework
* scalameter
* gson
* sourcecode
* commons-io
* squareup
* HikariCP
* rxjava
2022-12-21 08:37:43 +01:00
Chun Lok Ling
206510b916
JSON encoding of Java codegen classes (#15909)
* Json toJsValue

* JsonCodec

* maven tag

* doc

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* address comments

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-12-19 18:55:01 +00:00
Stephen Compall
1f31d2dce2
use LF 1.15 instead of dev for interface-related bazel tests (#15923) 2022-12-19 13:40:45 -05:00
Chun Lok Ling
5f01588417
Conversion between javaapi.data.Value and lf.value.Value (#15885)
* init

* make it able to sync first

* deps

* adt cases

* reorder

* toLfValue

* revert

* toLfValue

* fromLfValue

* bazel

* scala check generator round trip test

* fix test

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* fix CI

* fix CI

* na

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-12-15 19:27:55 +00:00
pbatko-da
566b564f0b
[DPP-1022] ACS active_at_offset (#15764)
changelog_begin
Ledger API: Add active_at_offset to the GetActiveContractsRequest request
changelog_end
2022-12-15 18:10:33 +00:00
Stephen Compall
7472684625
ignore build-and-lint-test yarn.lock inconsistency on release (#15907)
With the below command, with or without the entry for
@types/prettier@2.6.0 removed, this command passes.

DAML_SDK_RELEASE_VERSION=0.0.0-head bazel test --test_output=streamed //language-support/ts/codegen/tests:build-and-lint-test

With the below command with the entry for @types/prettier@2.6.0 removed,
this command fails with the expected error about a missing entry.  With
the entry restored, it passes.

bazel test --test_output=streamed //language-support/ts/codegen/tests:build-and-lint-test
2022-12-15 17:46:53 +00:00
Stephen Compall
0dcd635eb8
enforced lockfile for build-and-lint-test (#14873)
* pin dependencies without #13876

* --frozen-lockfile does not work

* hide @daml.js local paths from yarn.lock comparison

This version on failure outputs something like

--- /dev/fd/63	2022-12-12 17:31:06
+++ /dev/fd/62	2022-12-12 17:31:06
@@ -708,6 +708,11 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
   integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==

+"@types/prettier@2.6.0":
+  version "2.6.0"
+  resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759"
+  integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==
+
 "@types/prettier@^2.1.5":
   version "2.7.0"
   resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc"
FAIL: /.../build-and-lint-test.runfiles/com_github_digital_asset_daml/language-support/ts/codegen/tests/ts/yarn.lock could not satisfy /.../build-and-lint-test.runfiles/com_github_digital_asset_daml/language-support/ts/codegen/tests/ts/build-and-lint-test/package.json
FAIL: yarn.lock requires all of the above changes
FAIL: //language-support/ts/codegen/tests:build-and-lint-test ...

Applying this diff to yarn.lock causes the test to pass.

* apply yarn.lock update reported by diff

* add changelog

CHANGELOG_BEGIN
CHANGELOG_END

* don't hard-code diff location

- suggested by @garyverhaegen-da; thanks
2022-12-14 18:31:14 +00:00
Nicu Reut
25f1254120
Move the metrics API to the observability module [PLEN-35] (#15831) 2022-12-12 09:35:55 +00:00
Sergey Kisel
e880f26b36
Identity Provider Management exposed via API [DPP-1334] (#15774) 2022-12-09 10:25:14 +01: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
Chun Lok Ling
936513119c
Add yarn lock file for build-and-lint-test (#15727)
* add yarn lock file

* file--frozen-lockfile

* add change log

CHANGELOG_BEGIN
CHANGELOG_END

* pure-lockfile

* remove pure lock-file
2022-11-29 17:31:48 +00:00
Chun Lok Ling
60e5aaa259
Apply package prefix only on main package of the Dar and unique package. (#15448)
* add ambiguous prefix check on package which is used to generate code.

* add test case

* Update test description

Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>

* pre prefix

* per prefix

* modify test

* lower case

* rollback per prefix code gen

* rollback per prefix code gen

* apply prefixes on unique and main package only

* fix

* move

* rename

* test same main package with different prefixes

* added test case for 2 dar files with same main package but different prefixes

* added test case for dar files with data dependencies

* add a unique package

* fixed CI

* address comment

Co-authored-by: fayi-da <112705750+fayi-da@users.noreply.github.com>
Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
2022-11-29 11:44:59 +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
mziolekda
fd8439144a
fix eta-expansion and nullary method warnings [DPP-1281] (#15689)
* Fix flake jwt leeway test

* fix eta-expansion warnings

* fix nullary method errors

* Revert "Fix flake jwt leeway test"

This reverts commit 5e2fed648b.

* format
2022-11-24 12:28:41 +00:00
fayi-da
448c184258
Remove overloaded methods in command client (#15519)
* Remove overloaded methods in CommandClient

* Remove overloaded methods in CommandClient

* Revert destructive changes to command client

* Add config for command client methods

* Add stubs for new submit methods in CommandClient

* Formatting

* create() should be static

* Add sample deprecation

* params on builder methods don't need to be optional. Add some javadoc notes

* Add tests for submitAndWait

* Add tests for submitAndWait

* Add implementation for submitAndWaitFor* methods

* Update tests

* Refactor CommandSubmissionClient

* Deprecate overloaded methods in CommandClient

* Update deprecated method use

* Lint

* Cleanup deprecated use

* Update required params

* CommandClientConfig -> CommandsBuilder

* Formatting

* Rename CommandsBuilder -> CommandsSubmission

* Delete deprecated tests

* Rename withParty(String) -> withActAs(String)

* Formatting

* Refactor SubmitRequest.java

* Refactor SubmitRequest.java

* Refactor SubmitAndWaitRequest and SubmitCommandsRequest

* Move CommandsSubmission to the java-bindings package and refactor dependencies accordingly

* todos for horrible casting

* Update language-support/java/bindings-rxjava/src/test/scala/com/daml/ledger/rxjava/grpc/CommandClientImplTest.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* make CommandsSubmission final

* e.t.c -> etc

* Remove use of singleton list for actAs

* Return unmodifiable lists in CommandsSubmission

* Cleanup SubmitCommandsRequest

* Formatting

* Update tests for SubmitCommandsRequest

* PR comments

* Use toCommands() in HasCommands

* Reorder constructor params

* Rename params and commandsSubmission -> submission

* Cleanup docs

* Update docs

* Update docs

* Cleanup test util

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2022-11-23 16:10:06 +01:00
Stephen Compall
375fcb4a47
use syntax that can report inequality failure in Java codegen test (#15643) 2022-11-22 17:03:46 +00:00
Stephen Compall
38079ea422
make packagePrefixes implicit in Java codegen (#15642)
* remove the package-prefix-free overload

* switch fullyQualifiedName, the basis, to a newtyped implicit

* remove unused packagePrefixes

* remove fullyQualifiedName indirection
2022-11-22 10:15:13 -05:00
Stephen Compall
ba595c4ee7
remove unused mbSubst from TS codegen (#15644) 2022-11-22 10:13:26 -05:00
Remy
3dee676cbb
[LF] making LF 1.15 stable (#15614) 2022-11-17 23:30:11 +01:00
Stefano Baghino
1314930584
Add comma after user ID in toString (#15538)
Currently the `toString` for `User` in Java bindings returns the following:

   User{id='participant_admin'primaryParty='null'}
2022-11-14 10:53:26 +01:00
Moisés Ackerman
06892a4ae9
Clean up uses of locateRunfiles (#15446)
* Define DA.Bazel.Runfiles.locateResource as an alternative to locateRunfiles

* Use locateResource to get default dlint rules file

Fixes #15443

* Use locateResource to get scenario-service.jar

* Use locateResource to get ghc-pkg executable

* Use locateResource to get stable-packages directory

* Use locateResource to get ghcversion.h

* Use locateResource to get hpp executable

* Use locateResource to get builtin package dbs

* Drop unused function DA.Daml.Options.Types.getBaseDir

* Use locateResource to get d3{,plus}.min.js

* Use locateResource to get repl-service.jar

* data Resource now takes a runfilesPathPrefix instead of a runfilesPath

* Add hlint warning 'locateRunfiles/package_app'

* Let locateRunfiles crash when used outside of bazel target

* typo
2022-11-10 13:20:43 +01:00
Stephen Compall
9dd5e26995
add map to Update (#15473)
* hide some internal constructors
2022-11-08 14:31:15 +00:00
Stephen Compall
6bb1f3b4af
move fromContractId and fromCreatedEvent to ContractTypeCompanion (#15472)
* add Contract, ContractId type params to ContractTypeCompanion

* move fromCreatedEvent, toContractId to ContractTypeCompanion

* ContractFilter can be simpler with this

* javadoc for toContractId
2022-11-08 08:38:22 -05:00