Commit Graph

581 Commits

Author SHA1 Message Date
Stephen Compall
e1ff695d5e
less stringly websocket testing (#15330)
* use encoder for an exercise
* make ContractDelta a bit less magic
* encode a CreateCommand

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-25 16:31:38 +00:00
Stephen Compall
7e7a8f2f2e
use domain.Party instead of String in json-api tests (#15329)
* use domain.Party instead of String in jwtForParties, headersWithPartyAuth

CHANGELOG_BEGIN
CHANGELOG_END

* use domain.Party instead of String in headersWithPartyAuth

* fix sharedAccountCreateCommand and some corners
2022-10-25 11:31:26 -04:00
Nicu Reut
8da0a84183
Introduce explicit timer API for stopping a timer [PLEN-29] (#15344) 2022-10-25 14:44:32 +00:00
Nicu Reut
f550b69463
Reorganize the metrics package structure [PLEN-29] (#15312) 2022-10-25 10:05:40 +00:00
fayi-da
7762d2a376
Removed unnecessary log message (#15323)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-24 14:35:18 +01:00
tudor-da
1a4ef5b238
Revert "Upgrade dependencies to their latest stable release (#15216)" (#15309)
This reverts commit 1454497f

changelog_begin
changelog_end
2022-10-24 08:33:37 +02:00
Nicu Reut
5b4c7f7677
Extract metrics API that is decoupled from dropwizard [PLEN-28] (#15231) 2022-10-21 16:30:21 +02:00
Stephen Compall
31942d46ee
make resolver preserve ContractTypeId type *and* class (#15282)
* move resolveTemplateId to ContractTypeIdMap
* replace the contractTypeIdMap with an interfaceIdMap
* remove ResolveContractTypeId's type parameter, replace with Overload relation
* define the ContractTypeId resolver to be overload, ctid-type-sensitive
* remove AnyKind usages
* remove resolveTemplateId argument-passing

* demonstrate very strange inserted cast
`x.packageId` inserts a cast on `x` to `ContractTypeId.Template`, for
which there is no local evidence
* fix compiler-inserted cast problem
- Why does this fix it?  Who knows!

* failure of template ID resolution no longer fails later than we want
* fix resolution of interface IDs for websocket queries

CHANGELOG_BEGIN
- [JSON API] Some error messages have been corrected to no longer
  confuse interface IDs with template IDs, based on what varieties of
  contract type ID the endpoint in question supports.
CHANGELOG_END

* mention #15293 where relevant
* define templateId_ generically
* remove unused utilities for old resolver
2022-10-20 10:02:04 -04:00
Chun Lok Ling
6e7c408484
Replace ContractTypeId with ContractTypeId.Template where appropriate (#15199)
* domain.ContractTypeId.Template
* ResolveKeyType to use .Template
* CreateAndExerciseCommand to use .Template
* keyTypeMap
* bitraverse

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-10-19 19:39:19 +00:00
Gerolf Seitz
1454497f3a
Upgrade dependencies to their latest stable release (#15216)
The outdated dependencies where determined by running
`bazel run @maven//:outdated`.

Not all dependencies are brought up to the latest version available on
Maven Central, for the following reasons:

Nobody dares to touch DB:
  com.oracle.database.jdbc:ojdbc8 [19.14.0.0 -> 21.7.0.0]
  com.oracle.database.jdbc.debug:ojdbc8_g [19.14.0.0 -> 21.7.0.0]
  com.h2database:h2 [2.1.210 -> 2.1.214]
  org.flywaydb:flyway-core [8.4.1 -> 9.4.0]

License issues beyond version 2.6.x:
  com.typesafe.akka:akka-actor_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-actor-testkit-typed_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-actor-typed_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-http_2.13 [10.2.8 -> 10.4.0-M1]
  com.typesafe.akka:akka-http-spray-json_2.13 [10.2.8 -> 10.4.0-M1]
  com.typesafe.akka:akka-http-testkit_2.13 [10.2.8 -> 10.4.0-M1]
  com.typesafe.akka:akka-slf4j_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-stream_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-stream-testkit_2.13 [2.6.18 -> 2.7.0-M3]
  com.typesafe.akka:akka-testkit_2.13 [2.6.18 -> 2.7.0-M3]

Not a stable release:
  com.chuusai:shapeless_2.13 [2.3.3 -> 2.4.0-M1]
  io.circe:circe-core_2.13 [0.14.3 -> 0.15.0-M1]
  io.circe:circe-generic_2.13 [0.14.3 -> 0.15.0-M1]
  io.circe:circe-parser_2.13 [0.14.3 -> 0.15.0-M1]
  org.scalameta:munit_2.13 [0.7.29 -> 1.0.0-M6]
  org.scalactic:scalactic_2.13 [3.2.14 -> 3.3.0-SNAP3]
  org.scalatest:scalatest_2.13 [3.2.14 -> 3.3.0-SNAP3]
  org.scalatestplus:scalacheck-1-15_2.13 [3.2.11.0 -> 3.3.0.0-SNAP3]
  org.scalatestplus:selenium-3-141_2.13 [3.2.10.0 -> 3.3.0.0-SNAP3]
  org.scalatestplus:testng-6-7_2.13 [3.2.10.0 -> 3.3.0.0-SNAP3]
  org.tpolecat:doobie-core_2.13 [0.13.4 -> 1.0.0-RC2]
  org.tpolecat:doobie-hikari_2.13 [0.13.4 -> 1.0.0-RC2]
  org.tpolecat:doobie-postgres_2.13 [0.13.4 -> 1.0.0-RC2]
  com.fasterxml.jackson.core:jackson-core [2.13.4 -> 2.14.0-rc2]
  com.fasterxml.jackson.core:jackson-databind [2.13.4 -> 2.14.0-rc2]

Netty + boringssl + grpc + protobuf need be kept in sync, and the latest
versions also aren't stable releases:
  io.netty:netty-buffer [4.1.79.Final -> 5.0.0.Alpha2]
  io.netty:netty-codec-http2 [4.1.79.Final -> 5.0.0.Alpha2]
  io.netty:netty-handler [4.1.79.Final -> 5.0.0.Alpha2]
  io.netty:netty-handler-proxy [4.1.79.Final -> 5.0.0.Alpha2]
  io.netty:netty-resolver [4.1.79.Final -> 5.0.0.Alpha2]
  com.google.protobuf:protobuf-java [3.21.7 -> 4.0.0-rc-2]

Scalaz changed a few annoying things in 7.3, so let's stick to 7.2:
  org.scalaz:scalaz-core_2.13 [7.2.34 -> 7.4.0-M12]
  org.scalaz:scalaz-scalacheck-binding_2.13 [7.2.34-scalacheck-1.15 -> 7.4.0-M12]
  org.scalacheck:scalacheck_2.13 [1.15.4 -> 1.17.0]

Determined by the rules_scala:
  org.scala-lang:scala-library [2.13.8 -> 2.13.10]

CHANGELOG_BEGIN
Upgraded to the latest stable version of the following JVM dependencies:

ch.qos.logback:logback-classic:1.4.4
ch.qos.logback:logback-core:1.4.4
com.auth0:java-jwt:4.1.0
com.auth0:jwks-rsa:0.21.2
com.fasterxml.jackson.core:jackson-core:2.13.4
com.fasterxml.jackson.core:jackson-databind:2.13.4
com.github.ben-manes.caffeine:caffeine:3.1.1
com.github.pathikrit:better-files_2.13:3.9.1
com.github.pureconfig:pureconfig-core_2.13:0.17.1
com.github.pureconfig:pureconfig-generic-base_2.13:0.17.1"
com.github.pureconfig:pureconfig-generic_2.13:0.17.1
com.github.pureconfig:pureconfig_2.13:0.17.1
com.github.scopt:scopt_2.13:4.1.0
com.google.code.gson:gson:2.9.1
com.lihaoyi:pprint_2._13:0.8.0"
com.lihaoyi:sourcecode_2.13:0.3.0
com.sparkjava:spark-core:2.9.4
com.squareup:javapoet:1.13.0
com.storm-enroute:scalameter-core_2.13:0.21
com.storm-enroute:scalameter_2.13:0.21
com.thesamet.scalapb:scalapb-json4s_2.13:0.12.0
com.typesafe.scala-logging:scala-logging_2.13:3.9.5
com.zaxxer:HikariCP:5.0.1
commons-io:commons-io:2.11.0
eu.rekawek.toxiproxy:toxiproxy-java:2.1.7
io.circe:circe-core_2.13:0.14.3
io.circe:circe-generic-extras_2.13:0.14.2
io.circe:circe-generic_2.13:0.14.3
io.circe:circe-parser_2.13:0.14.3
io.circe:circe-yaml_2.13:0.14.1
io.github.paoloboni:spray-json-derived-codecs_2.13:2.3.9
io.reactivex.rxjava2:rxjava:2.2.21
io.spray:spray-json_2.13:1.3.6
javax.annotation:javax.annotation-api:1.3.2
javax.ws.rs:javax.ws.rs-api:2.1.1
junit:junit-dep:4.11
junit:junit:4.13.2
net.logstash.logback:logstash-logback-encoder:7.2
org.apache.commons:commons-lang3:3.12.0
org.apache.commons:commons-text:1.10.0
org.awaitility:awaitility:4.2.0
org.checkerframework:checker-qual:3.26.0
org.checkerframework:checker:3.26.0
org.codehaus.janino:janino:3.1.8
org.freemarker:freemarker-gae:2.3.31
org.jline:jline-reader:3.21.0
org.jline:jline:3.21.0
org.junit.jupiter:junit-jupiter-api:5.9.1
org.junit.jupiter:junit-jupiter-engine:5.9.1
org.junit.platform:junit-platform-engine:1.9.1
org.junit.platform:junit-platform-runner:1.9.1
org.mockito:mockito-core:4.6.1
org.mockito:mockito-inline:4.6.1
org.mockito:mockito-scala_2.13:1.17.12
org.pcollections:pcollections:3.2.0
org.playframework.anorm:anorm-akka_2.13:2.7.0
org.playframework.anorm:anorm_2.13:2.7.0
org.postgresql:postgresql:42.5.0
org.reactivestreams:reactive-streams-tck:1.0.4
org.reactivestreams:reactive-streams:1.0.4
org.reflections:reflections:0.10.2
org.sangria-graphql:sangria-ast_2.13:3.4.0
org.sangria-graphql:sangria-core_2.13:3.4.0
org.sangria-graphql:sangria-derivation_2.13:3.4.0
org.sangria-graphql:sangria-parser_2.13:3.4.0
org.sangria-graphql:sangria-spray-json_2.13:1.0.3
org.scala-lang.modules:scala-parallel-collections_2.13:1.0.4
org.scalactic:scalactic_2.13:3.2.10
org.scalameta:munit_2.13:0.7.29
org.scalatest:scalatest_2.13:3.2.10
org.scalatestplus:scalacheck-1-15_2.13:3.2.10.0
org.scalatestplus:selenium-3-141_2.13:3.2.10.0
org.scalatestplus:testng-6-7_2.13:3.2.10.0
org.scalaz:scalaz-core_2.13:7.2.34
org.scalaz:scalaz-scalacheck-binding_2.13:7.2.34-scalacheck-1.15
org.seleniumhq.selenium:selenium-java:4.5.0
org.slf4j:slf4j-api:2.0.3
org.slf4j:slf4j-simple:2.0.3
org.testng:testng:6.7
org.typelevel:cats-core_2.13:2.8.0
org.typelevel:cats-kernel_2.13:2.8.0
org.typelevel:cats-laws_2.13:2.8.0
org.typelevel:paiges-core_2.13:0.4.2
org.wartremover:wartremover_2.13.8:3.0.6
org.xerial:sqlite-jdbc:3.39.3.0
CHANGELOG_END
2022-10-18 08:50:23 +02:00
Chun Lok Ling
879048eedf
Removed alias fetchcontracts.domain.TemplateId (#15198)
* Removed alias fetchcontracts.domain.TemplateId

CHANGELOG_BEGIN
CHANGELOG_END

* order

* Apply suggestions from code review

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

* add comment for .template

* format

* todo

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-10-17 17:23:53 +01:00
Claudio Bley
e24497635d
Rework evidence security categories (#15226)
* Rework evidence security categories

using the 7 industry standard security testing areas:

* Authentication
* Authorization
* Confidentiality
* Integrity
* Availability
* Non-Repudiation
* Resilience

CHANGELOG_BEGIN
CHANGELOG_END

* Replace category `Input Validation`

* Replace category `Privacy`

* Replace category `Semantics`

* Replace category `Semantics`

* Replace category `Performance`

* Skip categories `NonRepudiation` and `Resilience` for now

There are currently no tests for these categories.

* Regenerate `security-evidence.md`
2022-10-13 09:55:45 +00:00
Stephen Compall
951817aee1
run query-store-independent tests less often (#15201)
* declare the separate kind of duplication

CHANGELOG_BEGIN
CHANGELOG_END

* move completely independent tests

* move many tests to 'QueryStoreIndependent'

* fix metering-report test to work with user tokens

* rename query-store/auth-dependent tests

- to QueryStoreAndAuthDependentIntegrationTest
- from AbstractHttpServiceIntegrationTestTokenIndependent

* security evidence moved
2022-10-11 09:27:07 -04:00
Nicu Reut
2f453a145c
Extract the testing metrics instance [PLEN-4] (#15192) 2022-10-10 18:52:49 +00:00
Stephen Compall
70f118579c
remove some ResolvedQuery cases (#15000)
* introduce ForQuery to overload ActiveContract.fromLedgerApi
* remove booleans from ResolvedQuery.apply
* wrong error string
* use the fact that query is non-empty to hide the Empty case
* we definitely only need a Semigroup, which fixes the law violation
* remove Empty

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Chun Lok Ling <110462561+chunlokling-da@users.noreply.github.com>
2022-10-10 09:33:40 -04:00
atriantafyllos-da
507f18ad20
Dpp 1222 move metric tagging classes to daml sdk (#15067)
Moved canton's tagging metric class [DPP-1222].

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-03 14:23:07 +02:00
Simon Maxen
0654f9978c
Add libs-scala/struct-json (#15090)
changelog_begin
changelog_end
2022-09-29 16:22:01 +01:00
Chun Lok Ling
40e994bd46
Bug fix. template id of archived contracted should be interface id instead (#15117)
* use Consume.syntax

* added exercise in interface "sub query endpoint" test case. checked template id of archive. it is asserting to be template id but not interface id which is wrong. I will change it back to interface id after all CI passed

* test that the archive events have the interface ID; add the template-ID-to-interface-ID mapping to archive events in websocket result stream

* Add change log

CHANGELOG_BEGIM
CHANGELOG_END

* Add change log

CHANGELOG_BEGIN
CHANGELOG_END

* use JSON converter instead of hand-writing JSON

* factor assertions for created records

* combine value assertions

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-09-29 11:52:19 +01:00
Stephen Compall
9f1033a6ec
remove some domain.TemplateId usages (#15097)
* replace several TemplateId with ContractTypeId
* replace several TemplateId with ContractTypeId.Template
* deprecate, even though this misses so many usages
* link to #15098 for followups

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-27 07:53:10 -04:00
Stephen Compall
c1cde096b2
replace OneAnd with NonEmpty for query templateIds (#15088)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-26 16:06:58 +00:00
mziolekda
41dc32a016
Remove reliance on implicit party allocation in CI tests [DPP-1234] (#15037)
* Remove reliance on implict party allocation in the authorization tests of the sandbox-on-x

CHANGELOG_BEGIN
CHANGELOG_END

* Remove the HOCON and cli config parameters

* Remove implicit party allocation from the Submission Service

* Remove support for implicit parties from the bridge

* Fix codegen reliance on implicit party allocation

* Fix daml script tests

* Fix trigger tests

* format security-evidence.md post rebase

* Fix json-api tests

* One more json-api test

* Fix haskell tests

* Corrections post-review

* Cosmetic improvements

* Fix race condition in party allocation handling
2022-09-22 10:20:53 +02:00
Stephen Compall
77672d2896
better JsNull check for Oracle; test scenarios for nested cases (#15022)
* a couple comparison query scenarios with nested position
* same JSON null test, but different
- 'gt string' (scenario 0) fails without this change
- 'gt int' (scenario 1) succeeds regardless of this change

CHANGELOG_BEGIN
- [JSON API with Oracle] Fix some nested queries that were returning no
  data.  DisableContractPayloadIndexing must be set to true to take
  advantage of this fix.
CHANGELOG_END
2022-09-21 10:21:35 +00:00
Stephen Compall
a9ebecfe5c
retest Oracle with payload indexing (#15041)
* point to #14844 and #15040 for some TODOs
* duplicate the Oracle tests, disable large literals when indexing is on
* split test file for parallelization

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-20 10:32:58 -04:00
Stephen Compall
36e49c737b
factor stream-starting code in websocket JSON API tests (#15008)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-13 19:26:59 +00:00
Stephen Compall
5bec0ba4d2
remove redundant StatusCode checks from many tests (#15007)
* ensure Status is redundant for every parseResponse user
* make parseResponse test and discard the HTTP status
* use resultContractId more

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-13 09:40:49 -04:00
Chun Lok Ling
419bf9b040
Fire a warning if both config file and cli opts found. (#14981)
* fire a warning if both config file and cli opts found.

* add change log

CHANGELOG_BEGIN
CHANGELOG_END

* fixes test case

* fmt
2022-09-08 21:22:25 +01:00
Chun Lok Ling
9b73243eea
Remove : ResolvedQuery from pattern match (#14972)
Addressed #14966

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-08 09:02:01 +01:00
atriantafyllos-da
2b89f6beea
One leeway config for all autorizers [DPP-1215]. (#14930)
* One leeway config for all autorizers [DPP-1215].

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-07 15:07:42 +02:00
Chun Lok Ling
32583edb7d
v1/stream/query interface subscription support (#14919)
* replace Set[TemplateId.Resolved] with ResolvedQuery in StreamPredicate val resolved
CHANGELOG_BEGIN
CHANGELOG_END

* make it compile first and fix those TODOs iteratively.

* `Unsupported or ResolvedQuery monoid` for collectively combine `ResolvedQuery`s; handle unsupported cases

* cleanup todo

* cleanup

* use resolvedQuery instead and add change log

CHANGELOG_BEGIN
CHANGELOG_END

* compile

CHANGELOG_BEGIN
CHANGELOG_END

* added test cases

CHANGELOG_BEGIN
CHANGELOG_END

* Address Ray's comment

CHANGELOG_BEGIN
Users can now subscribe `v1/stream/query` with queries with single interface id.
CHANGELOG_END

* Address Ray's comment

* Address Ray's comment

* fmt

* fix error message

* fix error message

* Addressed Stephen's comment

* Addressed Stephen's comment

* Addressed Stephen's comment
2022-09-07 09:20:23 +01:00
Raymond Roestenburg
fbe3d94bfe
14818 fetch by contract id with interface (#14917)
* Fallback to in-memory for interface ID.

CHANGELOG_BEGIN
- [JSON API] /v1/fetch by interface ID
CHANGELOG_END

* Added fix: not setting key in ActiveContract in interface case, fix for https://github.com/digital-asset/daml/pull/14841#discussion_r961960344
2022-09-06 11:03:31 +02:00
Raymond Roestenburg
d13695c75e
Draft /v1/query with interface ID, without query store (#14841)
Support /v1/query by interfaceID or a non-empty set of template ID's, fallback to in-memory for an interfaceId query.

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


CHANGELOG_BEGIN
- [JSON API] /v1/query with a non-empty set of template ID’s or one interface ID
CHANGELOG_END
2022-09-02 12:49:06 +02:00
Chun Lok Ling
2a01863c96
Test cases to ensure retroactive implements works in json-api (#14874)
* fixes #14821, added test case to ensure retroactive implements works in json-api

CHANGELOG_BEGIN
CHANGELOG_END

* address Stephen's comment
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-31 07:10:38 +01:00
Stephen Compall
99a48557d3
deprecate interface library names; use new names downstream (#14856)
* new names in daml-script/runner

* new names in json-api

* new names in Scala bindings/codegen

* new names in Java bindings/codegen

* new names in daml-lf interpreter tests

* more new names in daml-script tests

* new names in navigator backend

* deprecate all iface symbols and old method names

CHANGELOG_BEGIN
- [Scala API] ``com.daml.lf.iface`` has been deprecated, as discussed
  further in
  `issue #14783 <https://github.com/digital-asset/daml/pull/14783>`__.
  Use the deprecation warnings as guidance to the new names.
CHANGELOG_END

* prefix cases in OrderingSpec

- suggested by @remyhaemmerle-da; thanks
2022-08-29 20:43:47 +00:00
Stephen Compall
6236c8cc02
propagate template/interface ID distinction throughout JSON API (#14728)
* percolate Resolved/Definite status

* propagate resolution through the queries, DB updates, and domain resolutions

* include Definite in the definition of Resolved, everywhere

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-29 15:41:20 +00:00
Stephen Compall
f43bc5c8d1
use new api-type-signature names in some dependents (#14785)
* use new names in json-api

* use new names in java codegen

* use new names in Scala codegen

* use new names in TypedValueGenerators

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-23 17:52:10 +00:00
Stephen Compall
f85f7816c7
rename interface library to api-type-signature; alias symbols (#14783)
* move interface directory to api-type-signature; change bazel target; move scala files

* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature

* rename Interface to PackageSignature

* rename fromReaderInterfaces to fromPackageSignatures

* rename InterfaceReader to SignatureReader

* rename InterfaceReader to SignatureReader in deprecation note

* rename readInterface to readPackageSignature

* rename InterfaceReaderError to Error

* rename InterfaceReaderMain to SignatureReaderMain

* rename InterfaceType to PackageSignature.TypeDecl

* rename astInterfaces to interfaces

* rename astInterfaces to interfaces in PackageSignature

* rename findAstInterface to findInterface

* rename a couple arguments

CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
  to the new ``com.daml.lf.typesig`` package, with many accompanying
  name changes as documented in `issue #13669
  <https://github.com/digital-asset/daml/issues/13669>`__.

  Daml 2.5.0 or later will remove the old names, and also rename the
  Maven artifact from ``daml-lf-interface`` to
  ``daml-lf-api-type-signature``.  We recommend that users of this API
  use the deprecation guidance in 2.4.0 to port their applications
  before this happens.
CHANGELOG_END
2022-08-23 15:21:45 +00:00
atriantafyllos-da
7ff003a6aa
Rename the leeway options [DPP-1183]. (#14679)
* Rename the leeway options [DPP-1183].

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-23 10:24:41 +02:00
Chun Lok Ling
56a4d6476f
Added logging for time elapsed of ledger client call (#14711)
* Added logging for time elapsed of ledger client call

CHANGELOG_BEGIN
CHANGELOG_END

fixes #14673

* rename logging def

* ADDED TODO

* ADDED TODO

* pass in boolean for determining if it should log based on the log level

* address Ray's comment. Wrong name Ledge -? Ledger

* make isEnable public and use it to determin whether it is debug level

* refactoring. put everything in a inner object LedgerClientRequestTimeLogger

* remove useless line

* address Ray's comment

* address Ray's comment

* log the time used for source as well

* address Stephen's address
2022-08-22 21:14:38 +01:00
Simon Maxen
937f8d1d45
Switch metering report to using Struct [DPP-1135] (#14767)
* Switch metering report to using Struct

changelog_begin
changelog_end
2022-08-22 08:55:06 +01:00
Chun Lok Ling
24c4c058b8
don't use query store at ledger-begin (#14740)
* fixes 11157

```rst
CHANGELOG_BEGIN
CHANGELOG_END
```

* format

* fix it in other caller
2022-08-17 18:58:56 +01:00
Moisés Ackerman
009c3c306b
Add interface instance syntax, including retroactive interface instances (#14715)
* Extract qualifyLocally in LFConversion

* Update ghc rev

* Add parent type argument to interface instance desugaring types

* Check interface instance parent in LFConversion

* Convert interface instances in interface declarations

* Update daml-test-files to use 'interface instance' syntax

* Update other tests to use 'interface instance' syntax

* Update interface reference docs to use 'interface instance' syntax

* Update other files to use 'interface instance' syntax

* Add todo in DA.Daml.LF.Ast.Pretty

* Add daml-test-files for retroactive interface instances

changelog_begin
changelog_end
2022-08-17 12:06:59 +00:00
Stephen Compall
22d2c27c4b
distinguishing template and interface IDs in json-api (#14577)
* prevent subclasses from having different equals behavior
* introduce a nominal, matchable subtype for interface IDs

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-15 11:15:00 -04:00
dylant-da
0d37134bc2
Change placeholder unit viewtypes to empty records (#14656)
* Update views in integration-v1dev to be EmptyInterfaceView instead of ()

* Update expected desugared daml for `EmptyInterfaceView`

* Update compiler Shake / DataDependencies viewtypes to EmptyInterfaceView

* Add record viewtypes to docs, update docs

* Add empty records to daml-lf, language-support, ledger, trigger tests

* Qualify EmptyInterfaceView in ledger semantic Interface tests

* Fix imports for EmptyInterfaceView in IIou / CIou / Transferrable

* empty changelog commit

CHANGELOG_BEGIN
CHANGELOG_END

* Qualify EmptyInterfaceView import

* Fix imports of EmptyInterfaceView in TypeScript codegen tests

* Accept Interface doc changes

* Add EmptyInterfaceView to DataDependencies tests

* Remove missing interface viewtype test - all interfaces must have views

* Replace all EmptyInterfaceView with EmptyInterfaceView {}
2022-08-10 16:45:23 +00:00
dylant-da
8e8e0dabdf
Convert viewtype and view methods to LF (#14456)
* Add DA_Internal_Interface to convertTypeDef exclusion check

* Move desugared types/values for interface views into DA.Internal.Desugar

* Convert viewtype and view method declarations

* Typecheck view types and view declarations

* Add unit viewtypes to InterfaceChoiceCollision tests

* Add unit viewtypes to more compiler/damlc tests

* Modify empty interfaces/implements to have viewtypes/views

* Add unit viewtypes to remaining Interface tests

* Test for error thrown when viewtype not specified

* Fix daml-lf/ interface tests to use new syntax / unit views

* Add placeholder view of type Unit to TestInterfaces

CHANGELOG_BEGIN
CHANGELOG_END

* Fix typescript interface tests with unit viewtype

* Add unit viewtype to Java & Scala codegen

* Add unit viewtype to triggers tests interface

* Add unit viewtypes to ledger/test-common

* Add unit viewtypes to ledger-service/http-json

* Fix some damlc tests

* Use viewtype syntax in InterfaceViewNonSerializable test

* Remove HasInferfaceView instances in convertBind

* Add unit view to QualifiedInterface.daml test

* Generate HasInterfaceView instances in DataDependencies

* Add unit viewtypes and views to compiler/damlc/tests

* Document reconstruction of HasInterfaceView

* Move desugared types/values for interface views into DA.Internal.Desugar

* Add desugarable function view w/ EViewInterface desugaring

* Remove templateName and viewtype from generated EViewInterface

* Update desugared-daml

* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView

* Move view, HasInterfaceView to DA.Internal.Interface

* Update desugared-daml tests

* Stop removing and re-generating HasInterfaceView instances

* Do not generate docs for generated "_view_" methods

* Report errors with interface TypeConNames prettily

* Fix InterfaceViewNotSpecified @ERROR to reflect new error text

* Don't import magic `view` method from Prelude to avoid name clash

* Update shake interface goto definition test locations

* Temp disable view spec tests, will re-implement views in speedy

* Add unit viewtype to Java code snippet docs

* Update Interface syntax docs for views

* Add unit viewtype to Transferrable.daml

* Add back "empty" interface implementation to interfaces.rst

* Re-enable view tests by having _view methods on InterfaceViews.daml file

* Remove deprecated commented-out view desugaring code
2022-08-03 16:23:38 +01:00
Stephen Compall
1a9dc020f9
overloaded choices in json-api (#14410)
CHANGELOG_BEGIN
- [JSON API] For exercise endpoints, when multiple choices with the same
  name are defined, the one directly defined on the ``templateId``,
  which may be a template or interface ID, will be selected; if a
  template ID is specified that only inherits the choices with the same
  name, the new ``choiceInterfaceId`` option must be specified to select
  the source of the choice.
CHANGELOG_END
2022-07-27 15:40:58 +00:00
Stephen Compall
8309cfef1e
group JSON API tests by endpoint, other categories (#14522)
* group query tests
* group remaining abstract integration tests
* group user management tests
* group websocket tests

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-26 11:50:04 -04:00
Sergey Kisel
2e18276b1a
Unify TlsConfiguration between SDK and canton [DPP-1113] (#14349)
* Unify TlsConfiguration between SDK and canton [DPP-1113]

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-14 16:58:59 +02:00
atriantafyllos-da
8cce2c0394
DPP-1047 Added leeway options for JWT-based authorization. (#14375)
* DPP-1047 Added leeway options for JWT-based authorization.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-13 14:57:54 +02:00
Stephen Compall
6e3069d220
add retroImplements to lf/iface DefInterface (#14192)
* add resolveRetroImplements to EnvironmentInterface
* test that resolveRetroImplements does nothing with no data
* resolve retroactive interfaces in Java codegen
* resolve retroactive interfaces in Scala codegen
* resolve retroactive interfaces in json-api

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-29 13:13:02 -04:00
Victor Peter Rouven Müller
8d21d19133
Add support for cmd deduplication & submission id for cmd submissions (#13771)
* Add completion offset to cmd submission responses

changelog_begin
- [HTTP-JSON] there is now a new meta field called deduplicationPeriod for cmd submissions with which one can specify the deduplication period. Moreover there also is another new meta field submissionId for the cmd submissions.
- [HTTP-JSON] Calls to endpoints for command submission now include the completion offset
changelog_end

Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
2022-06-29 16:57:05 +00:00