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.
* 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
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.
This documents some of the edge cases in the packaging code that I’ve
had trouble understanding so that the next person hopefully has an
easier time with this.
There is also some minor cleanup in this PR.
* language: daml2ts: support for enum types
This adds support for enum types to daml2ts. daml-lf enums are converted
to typescript enums and a decoder defined in the same namespace.
* static serializable check for enums and better tests
* sandbox: Move SandboxServer's helper classes to the companion object.
And make them `private`, `final`, and non-`case`.
* sandbox: Drop SandboxServer.apply and just call the constructor.
* sandbox: Move the SandboxServer#SandboxState class into the object.
Leave the `resetAndRestartServer` method behind, though.
* Implementation for the configuration management service
- Add configuration generation to the response of SetTimeModel
- Implement the ConfigManagementService
- Implement integration test into test tool
This is still a draft as it has unsolved FIXMEs and
it conflicts with #3744 which should go first.
The main conflict is with changes to PartyAllocationResponse which cannot
no longer reference "domain.PartyDetail" as we would have a cyclic dependency
(participant-state contains Configuration which we point to from domain.ConfigurationEntry).
The still open issues are:
- Revisit PartyDetail
- Naming: LedgerConfigurationService and ConfigManagementService are not talking
about the same configuration and it feels confusing.
- Remove duplication of ConfigurationEntry? Do we need both domain.ConfigurationEntry
and ledger.store.ConfigurationEntry? Only difference is in the types of participantId
and submissionId.
* Address review part 1
* Fix up tests after rebase and address PR review
* Post-merge fixes
* Add missing config MRT checks and fixes to tests
- Check config MRT in InMemoryLedger and SqlLedger
- Use proper source of time in ConfigManagement
- Separate out ConfigManagementServiceIT in sandbox conformance tsets
* Reformat
Closes#2857
- Also deals with the long ignored todo about not using the context
- Attempts at restoring this as a non-flaky test
- Attempts at running the same test across runtime environments
* sandbox: No point creating a class just for the `close` method.
The LedgerApiServer class doesn't actually have much behavior apart from
closing. The `startServer` method is called during construction, which
definitely counts as spooky action at a distance. This change moves that
behavior to `LedgerApiServer.start` (renamed from `LedgerApiServer
.create` to make it more explicit).
There's not much point creating a class for the rest, so all behavior is
now in that `start` method.
* sandbox: Build up a list of "closeables" as the LedgerApiServer starts.
* sandbox: If the LedgerApiServer fails to come up, stop the parts.
* sandbox: Apply @stefanobaghino-da's refactoring suggestions.
* sandbox: Don't log while building the gRPC server; log at the end.
* sandbox: Turns out we should not stop the server when it works.
Facepalm.
* Ledger api test tool party flakiness for multi-participant runs
Caused by synchronize not waiting for parties to fully exist on
all participants.
* Reenable canton test run
* Update canton to 0.5.2
* Revert "Update canton to 0.5.2"
This reverts commit d0e530c652.
In the code generated by `daml2ts`, every template companion object lists
all its choices and every choice has a pointer back to the companion object
of its template. Thus, there's a knot to tie.
So far, we initialized the choices as `undefined` and later mutated them to
point to the template companion object. This feels kind of hacky,
particularly since we end up with cyclic values.
This PR pushes the pointer from the choice back to the template companion
object behind a lambda. This makes the hack unnecessary and removes the
cyclic values.
* Add package_entries table
* Change PublicPackageUpload event to cover list of packages.
Add PublicPackageUploadRejected.
* Produce new package update events in KeyValueConsumption
* Update signature of uploadPackages
* Cleanup InMemoryKVParticipantState. Add submissionId to uploadPackages.
* Fix up InMemoryKVParticipantStateIT
* Initial ledger dao changes for package entries
Drop the participant_id as we never expect to see
entries of other participants. This should be done
for party_entries as well.
* Drop UploadPackagesResult
* Implement getPackageEntries and refactor callers
* Add maxRecordTime to uploadPackages
* First cut at updating ApiPackageManagementService
* Update tests, wire through the packageEntries
* Don't extend IndexPackagesService in InMemoryPackageStore
It does not implement the full interface and it isn't used
directly as one anyway.
* Drop maximum_record_time from package_management_service
Adding maximum record times touches the whole stack. Leaving
this change to another PR.
* Wire through the removal of maximum_record_time.
And remove dead code from InMemoryKVParticipantState
* Remove checking for duplicate package uploads
This aligns with the behaviour of WriteService.
* Reformat
* Fix PackageManagementService after adding of submission_id to the service
* Lookup by Contract ID and Contract Key is WIP
* factor out "contract ID or key" JSON decoding
- adapted from fc132253 (#2695)
* Resolving conflicts
* Resolving conflicts
* Lookup by contract ID works
* Testing new contract created by IOU_Transfer can be looked up
* error if key and contractId specified for lookup at the same time
* Lookup by contract key test
* Lookup docs
* re-format with `./fmt.sh`
* minor cleanup
CHANGELOG_BEGIN
- [JSON API - Experimental] Fix and document ``/contracts/lookup`` endpoint. See #3755.
CHANGELOG_END
* daml-lf: second version of type synonym spec
* cosmetic changes
* more fixes
* make special application for type synonymes
* Update daml-lf/spec/daml-lf-1.rst
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
* make type synonym different from type constructor
* typos
CHANGELOG_BEGIN
- [Sandbox] Restore 0.13.38 logging behaviour.
- [Navigator] Restore 0.13.38 logging behaviour.
- [Extractor] Restore 0.13.38 logging behaviour.
- [Internals] As of 0.13.39, we merged a number of internal JAR files in
the SDK tarball to reduce its size. These jars used to be standalone
JARs you could invoke as e.g. ``java -jar sandbox.jar <args>``. As a
result of merging the jars, they lost their individual ``logback.xml``
configuration file. Although running the jars directly was (and is
still) not supported, note that you can now achieve the same behaviour
with e.g. ``java -Dlogback.configurationFile=sandbox-logback.xml -jar
daml-sdk.jar sandbox <args>``.
CHANGELOG_END
* sandbox/reference-v2: Split `Config` into three.
- Reference v2 CLI configuration
- Standalone API server configuration
- Standalone indexer configuration
* reference-v2: Simplify CLI parsing of TLS config and extra participants.
Turns out we _always_ want to support extra participants. They're
optional, after all.
* first checkpoint for adding websocket
* unify shared method across websocketEndpoints and Endpoints using EndpointsCompanion objc
* add config for ws backpressure and logging
* add copy right header
* merge and change TODO comments
* resolve conflicts
* disable ws service for now to save merge conflicts while working on improvements
* Revert "Remove docker bazel target for sandbox (#3802)"
This reverts commit 48a381ca49.
* sandbox: Use the public `openjdk` Docker image rather than GCR's.
Turns out you need to authenticate with Google Container Registry
regardless of whether the image is public or not. We don't want people
to have to bother logging in to GCR just to get Bazel working.
* Add Eq instances for AnyTemplate, AnyChoice and AnyContractKey
CHANGELOG_BEGIN
- [DAML Standard Library] Add ``Eq`` instances for ``AnyTemplate``, ``AnyChoice`` and ``AnyContractKey``.
CHANGELOG_END
* Add DAML_ANY_TYPE to the CPP guard
* sandbox: Split the StandaloneApiServer from the StandaloneIndexerServer.
* sandbox: Move StandaloneApiServer's nested classes to its companion.
And make them private.
* reference-v2: Rename `IndexServer` to `ApiServer`.
* sandbox: Move the services into the `apiserver.services` package.
* sandbox: Move SandboxEventIdFormatter's vals to the top.
* sandbox: StandaloneApiServer helper classes don't need to be Products.
* docs: Fix links for LedgerApiServer and Standalone{Api,Indexer}Server.
* sandbox: Delete a misleading comment from `StandaloneApiServer`.
* sandbox: Rename SandboxEventIdFormatter to EventIdFormatter.
* Fix package names in depends field in pkg configs
Previously, we derived this based on the DAR name which breaks if you
use -o with rather confusing error messages. Now, we read it from the
`Name` field in the manifest that we added in
https://github.com/digital-asset/daml/pull/3805.
CHANGELOG_BEGIN
- [DAML Compiler] Fix an issue where transitive package dependencies
resulted in packages not being found, if the DAR name was changed with
`-o`.
CHANGELOG_END
* Fix package dependencies