This is a breaking change on the ledger api. So far we could rely on the
assumption that contractId == eventId. This assumption doesn't hold
anymore in a daml-on-x setting, where the eventId is created by the
api server, but the absolute contractId is created by the ledger
implementation.
Instead of going through weird contortions to store the relevant data in
the existing database schema, it is more viable in the long term to
remove that field and instead provide facilities to lookup transactions
by contractId.
Contributes to #2068.
* DA.Bazel.Runfiles based on bazel-runfiles
* locateRunfilesMb -> locateRunfiles
* .exe extension on Windows
* Add docstring to locateRunfiles
* bazel-runfiles: Normalize on Windows
* loading Dars from ZipInputStreams
formatting and cleanup
fixing DarReaderTest not compiling
fmt
using IOUtils to read the ZipInputStream
fixing CodeGen
fixing broken legacy DAR loading
fixed v2 ReferenceServer
cleanup
* fixing rebase conflicts
* introduced a fromFile method to avoid having to do boiler-plating where the input is a File
* addressing leaking resources
* cleanup
* inlining closures
* closing the darStream
* support rpc: GetFlatTransactionByEventId
* support rpc: GetFlatTransactionById
* test: GetTransactions
* support rpc: GetTransactionTrees, and types: TransactionTree,TreeEvent
* reorder TransactionService.hs to match .proto
* rpcs: GetTransactionByEventId, GetTransactionById
* windows: root build
* windows: fixed haskell bindings tests
* windows: disable client_server_test test
* windows: marking daml_test flaky due to #1907
* windows: removing da-hs-damlc-app run from build.ps1
* windows: disable hie-core alias of currently disabled target
* support: CommandCompletionService.completionEnd
* support checkpoints from: CommandCompletionService.completionStream
* address review comments
* add type for LedgerOffset; prefer AbsOffset when known
* extend submit/complete testcase
* Define LedgerService using ReaderT to avoid boilerplate
* re-export TimeoutSeconds from GRPC.HighLevel.Client, instead of defining as a newtype
* rename: Valuable -> IsLedgerValue
We add a dependency in bindings-java to grpc-netty, so it is
automatically available in the classpath for users. Otherwise they get
an error like [0] if they don't add it explicitly.
We also publish daml-lf-archive-java to maven central.
[0] io.grpc.ManagedChannelProvider$ProviderNotFoundException: No
functional channel service provider found. Try adding a dependency
on the grpc-okhttp, grpc-netty, or grpc-netty-shaded artifact
Previously, we got the package id by listing all packages and taking
the first. That is not a valid assumption and broke with a PR. This PR
changes the tests to use the DAR reader that we already used for
visualization (now factored into a separate library) and reads the
main dalf using that.
* store archive size in `DarReader`
* rename `SandboxTemplateStore` to `SandboxPackageStore`
* store package info in `SandboxPackageStore`
* introduce package upload / read to write / index services
not tested yet, just a ton of plumbing
* WIP test the package service
* Fix build errors after rebase
* Move packages service to v2
* Ledger API client uses ledger API types
* Fix ReflectionIT
* Correctly handle uploading invalid dar files
* Fix reading DAR entry file sizes
* Improve package management IT
* Improve handling of duplicate packages
* Fix language-support build
* Use unique party and command names
* Rename lfpackage to language
* Rename SandboxPackageStore to InMemoryPackageStore
* Remove getCurrentTime ledger method
* Improve package management IT
* Move InMemoryActiveContracts and InMemoryPackageStore
* Use case object for UploadDarResult.Ok
* Address review comments
* Update release notes
Fixes#1311
* Use BazelRunfiles in test
* Fixes#1204: Release bindings and codegens to Maven Central.
Upload the Java and Scala Bindings with the respective code
generator binaries to Sonatype Open Source Repository
Host for synchronization with Maven Central.
Nim:
* fix index numbering in demo.md
* add in game "help" command to show available commands
* small code simplification for code review
GroupChat:
* DAML chat-room model, with support for multiple chat-groups with entry by invitation
* simplify: pass Invitation
* fix bug spotted by Bernhard -- Gain access to a Group without a valid invite
* Fixes#1600. Improve Bazel Scala source JAR generation.
Include sources from JAR files defined as 'sources' to a Bazel Scala
target. The improvement will allow inclusion of generated source targets
in sources JARs of dependencies.
* Use temporary directory in the dar_to_scala() rule.
Place the output of the Scala code generator in a temporary
directory instead of a directory at the 'primary' output path as Bazel
rules should never have directory dependencies.
* language-support/scala: add support for specifying roots explicitly
By default, code-gen will use all templates in the given package as roots, and
generate code for all types used. This patch adds the ability to specify roots
explicitly via a set of regex.es to match the (fully qualified) template names.
This is an experiment, tests and UI need to be adjusted later.
* scala codegen rootfilter: move filtering to envIFace handling
* doc for --root option
* scalafmt
* test filterTemplatesBy
* release note for --root Scala codegen option
* Primitive.LegacyTemplateId replaces 2-tuple TemplateId.unapply; 3-tuple variant introduced
* ensure the suggested replacements are well-typed and behaved
* suggest LegacyTemplateId for 2-valued form
* Drop support for DAML-LF 1.3 from damlc
This means `damlc` now only supports versions allowing arbitrary expressions
as contract keys. This is very helpful for the upcoming new template
de/re-sugaring underpinning generic templates.
* Unpin a few DAML-LF target versions in tests
* Fix golden tests
* Adapt changelog to rebase
* Rename DAML-LF scenario tests to 1.dev
* Update tests to --target 1.dev
* Fix release notes
* use with syntax in Daml
* attend to code review comments
* move ledger services implementation to own sub-module
* use ledger reset service when running tests for haskell-ledger-bindings
* expose LL.ClientCall in high level interface
* cancel streaming gRPC calls when attached stream is closed
* fix modification to gRPC-haskell so existing interface in preserved
* ClientCall and clientCallcancel were already available on HighLevel interface
I'm refurbishing the DAML-LF 1.3 specific tests to run against the
latest DAML-LF version (by removing the explicit target version in the
daml_compile target).
Going forward we only "reify" specific DAML LF versions when breaking
changes or new features are introduced, and we need to test the old
behavior specifically (just like we did for DAML LF 1.0 and 1.1).
* Drop support for DAML-LF 1.1 from damlc
Part of #853.
* Fix docs test
* Add show party test back
* Update release notes
* Remove target version from Java codegen test
* ValuePrimitiveEncoding.Mapped, mixin for the "axiom" parts of mapped and xmapped
* remove ValuePrimitiveEncoding.mapped
- it was okay with 1 inductive case, but now there will be 4, so just
mixin Mapped instead
* mark members of ValuePrimitiveEncoding.Mapped final
- mixins are easier to get right if you mark everything final
* add Maps to random tests
* replace <: Template[A] with : TC in ValuePrimitiveEncoding#valueContractId
- no current subclass uses this context bound, but it may be useful for
encodings that wish to make ContractId encodings dependent on the type
parameter
* replace : TC with no bound in ValuePrimitiveEncoding#valueContractId
- fixes#1325
- can reintroduce : TC with #822
* stub test for generating with #1315's liberated contract IDs
- commented out because we still want to test codegen with stable LF
only
* undo useless changes
* ContractId#apply is unbounded
* Rename Value's ContractId to VContractId
* daml-lf: a bit more about PartyId
* daml-lf: Concatenable MatchingStringModule
* daml-lf make clear type used for Scenarios only
* daml-lf create ContractId, LedgerId, TransactionId
* sandbox-sql conversion util
* LedgerName -> LedgerString
* futher type cleanup in the sandbox
* daml-lf add test for LedgerString
* fixing tests
* a bit more safety in the DB
* Address Stephen's comments
* fix rebase
* More fixes for StringModule
* change length of LedgerString (256 -> 255)
* Use closable Stream in Haskell ledger bindings
* move PastAndFuture abstraction into ledger interface code
* distinguish past/future transactions in return of Ledger.getTransactionsPF
* first cut: nim-console running against a ledger
* remove flaky failing test
* Removing unused/broken daml.bzl rules, adding Scala codegen rule
Scala codegen rule: dar_to_scala follows the same approach
as dar_to_java with a few differences:
- dar_to_scala supports multiple dars as an input
- dar_to_scala does not try to compile the generated scala (separation
of responsibilities)
* Using dar_to_scala to compile quickstart-scala example
* Fixing formatting
* Add dependency to examples-quickstart-scala-bin
So if example does not compile, it can't be published.
* Fixing the path to the jar executable
* Changing scala codegen rule to rely on zipper instead of jar
JDK's jar creates srcjar with timestamped files, zipper doesn't
timestamp files. This means we can create reproducible/deterministic/
cacheable srcjars
* Addressing code review comments, wrong var name
* add createAnd syntax to prepare CreateAndExercise commands from Scala codegen contracts
* open-style ExerciseOn typeclass
* GADT-style ExerciseOn works perfectly well, so let's go with that instead
* testing implicit conversion + ExerciseOn TC lookup
* use scalatest-style typesafe === to avoid Anys
* many more ExerciseOn tests
* support ExerciseOn polymorphism in Primitive.exercise
* generate ExerciseOn references in Scala codegen, permitting `createAnd` to combine with exercise* methods
* refactor testCreateContractAndReceiveEvent to support other commands
* compare create and createAnd's command generation behavior in a simple test
* bazel style
* test CreateAndExercise from Scala codegen against sandbox
* release note for Scala codegen create-and-exercise support
* Added agreement_text field to the CreatedEvent in Ledger API.
* Changed java bindings + java codegen
* Changed utilities for scala codegen
* Made necessary changes in Sandbox to propagate the agreement text from ContractInst to the CreatedEvent
* Made changes to the navigator to show the agreement text in the contract details page when it is set and not empty
Fixes#1110
* no var no problem
further refactor
introduced InfraState
a bit less vars
encapsulating closes
SandboxServer starts automatically
rebase fixup
collecting state into a single object
some cleanup
removing exposed materializer
LedgerBackend is closed in SandboxServer
changed ownership of Ledger
fixing perf tests
fixing some compile errors
formatting
removing unused method
fixing integration test to use correct dar file
fixing issue with PostgresFixture and SandboxResource
Fix integration tests on Windows
* fixing rebase artifacts
* ledger-api-intgration-tests: Cleanup ledger ID handling.
This changes nothing in the logic of tests. It is a preparation for moving of
most of the tests to use Dynamic ledger ID mode for tests, which is a
preparation for running these tests against remote Ledger API endpoints.
* sandbox: Rework LedgerIdMode and move it up into common.
* Fixes 895: Improve DA Bazel rules for building javadocs.
Extend the da_java_library Bazel macro to also build the Javadoc for the
target. Add the Javadoc artefacts to the release procedure.
* Add a helper function to qualify things with respect to a module
* Supress some warnings I saw when building
* Move Tuple* and Either to daml-prim:DA.Types, so they have a nice name for Java users (instead of GHC.Tuple or DA.Internal.Prelude)
* Add copyright header
* Update daml-foundations/daml-ghc/daml-prim-src/DA/Types.daml
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
* Update daml-foundations/daml-ghc/daml-prim-src/DA/Types.daml
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
* Update the daml-lf translation of tuple types
* Fix up the scala bindings for how to use types
* Clarify what action people need to take following the release notes
* Fix an expected test
* Clarify the changelogs even more
* Run ScalaFmt
* Clean up the release notes a bit
* Use the changelog from Beth
* Update the release notes again
* Update docs/source/support/release-notes.rst
Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>
* Fix up the scenario error messages
* Remove ExercisedEvent in Event oneof.
The Event message is only used in the Transaction message. Flat
transactions do not contain exercised events, but only created and
archived events. Therefore we can remove the ExercisedEvent from the
Event oneof, without breaking transport compatibility.
HOWEVER: The Java Bindings used to use the data.Event class for both flat
transactions and transaction trees. To properly represent the actual
event types in the two transaction structures,
1) Event is now and interface and is only used in the Transaction class.
2) there is a new interface TreeEvent, which is used in the TransactionTree class.
* CreatedEvent implements Event and TreeEvent
* ExercisedEvent implements TreeEvent
* ArchivedEvent implements Event
Some "pathological" cases where an occurrence of an exercised event
would have resulted only in an exception, are now removed (see change in
LedgerApiV1.scala).
Fixes#960.