This should make `daml start` a bit more useful since you don’t have
to switch to starting all processes separately once you start
deviating from the defaults, e.g., I found myself wanting to specify a
custom ledger id during the hackathon. This is part 1 of ##2993.
* ADT for json-api's LF value query predicates
* expand predicates into primitive cases
* expand more cases for the predicate reader
* instantiating type references
* record case
* get super-reductionist with ValuePredicate so we can tease out the proper model by operations
* just put the literal predicates in the ADT
* more primitive predicates
* properly build RecordSubset predicates
* tests for ValuePredicate LF value predicate functions
- false cases fail because outer layer still stubbed
* outer RecordSubset always used
* tests for comparing literal predicate and ApiCodecCompressed parsing
* map querying
* Adding ListMatch
* removing List test cases covered by LF-JSON encoding tests
* Optional support; precompile ListMatch elements
* use go instead of toFunPredicate
- deals with potential subst introduction as we make VP more abstract
* test cases for optional queries
* Adding VariantMatch
* Fixing comments
* some precompiling and fusion
* Adding value predicate to contracts/search endpoint, WIP
* Adding value predicate to contracts/search endpoint, WIP
* add filtering to ContractsService#filterSearch
* Adding contracts/search result filtering based on the constructed predicates
* cleanup
* make error throwing in ValuePredicate a little nicer
* scalafmt
* cleanup
* follow JSON format rules for numeric queries
* test that apiValueToLfValue . lfValueToApiValue = arr id
* API value -> LF value discards scale; account for that in ValuePredicate
- fixes queries that match numerics
* document query
* release note
* test for contracts/search with query
* more tests for contracts/search with query
* More tests and cleanup
* more cleanup
* better test
* Adding disclaimer
* records, not documents
* better error message in the fromCon case
* Use a consistant include dir for cwd
See https://github.com/digital-asset/ghcide/pull/114 for the actual
fix.
This PR just bumps ghcide and adds a regression test. I’ll change the
revision before merging, I just want to test CI for now.
fixes#2929
* Switch to proper ghcide revision
* writeIfacesAndHie no longer exists
* Add changelog entry
* Maybe I should try to compile code before committing but I don’t want to
* Fix ghcide exe
This removes the need for clients to handle the special case where the
stream might be empty.
Now the clients can always assume that they receive at least one
response element in the stream.
* Fix contract key uniqueness check in kvutils
Archival of a contract with a key and recreation within the
same transaction is now allowed in kvutils.
* Add assertions to check that new contract has been created with same key
* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC internally
* daml-lf: add CAST_NUMERIC and SHIFT_NUMERIC to archive proto
* daml-lf: update spec with CAST_NUMERIC and SHIFT_NUMERIC
* update release notes
* fix spec
* Address comments from Fran and Gerolf
* fix unrel
* Improve UX of generic templates over Ledger API
Currently, if you write
```
template Template t => Proposal t with
receiver: Party
asset: t
where ...
template Iou with ...
template instance ProposalIou = Proposal Iou
```
you'll get the following DAML-LF types:
```
record Proposal t = { receiver : Party, asset : t }
record Iou = ...
record ProposalIou = { unpack : Proposal Iou }
```
The definition of `ProposalIou` is not particularly user friendly when used
over the Ledger API.
This PR changes the definition of `ProposalIou` to
```
record ProposalIou = { receiver : Party, asset : Iou }
```
Basically, the definition of `Proposal` is copied and `t` is instantiated
with `Iou`. This should make a much nicer UX.
* Update documentation
* Add test
* Fix docs examples
* Fix release notes
* filter out exception stack traces logged at debug
* Adding logback.xml for DAML Assistant release
* Fixing readme
* Fixing readme
* Use the config file in the assistant
* WIP
* Ensure identifier uniqueness across endpoints
* Use Greek alphabet letters for node naming to better tell them apart
* Allow reference server to specify extra participants
* Restore all semantic tests
* Update changelog
* Have exponential backoff retries when creating the endpoint test context
* Use proper names for the DB connection pools.
* Add some trace logging for DB operations.
This does not capture timing of individual statements but
rather the time for "units of work".
For example "lookup contract" doesn't mean only loading
a single row from the contracts table, but also 2 additional
queries for looking up witnesses and divulgences.
This is not a problem, because this is trace level logging
that helps us debug problems and shouldn't be made sense of by
users at this stage.
* Make description a by-name parameter.
This avoids building up the string if trace logging
is not enabled (i.e. most of the time).
* Make sure ActiveContractService sends out a consistent snapshot
instead of looking up the latest ledger end, we can only take the latest known ledgerEnd in the scope of SqlLedger.
If we don't do that, we can miss contracts from a partially inserted batch insert of ledger entries
scenario:
1. batch insert transactions A and B at offsets 5 and 6 respectively; A is a huge transaction, B is a small transaction
2. B is inserted earlier than A and the ledger_end column in the parameters table is updated
3. A GetActiveContractsRequest comes in and we look at the latest ledger_end offset in the database. We will see 6 (from transaction B).
4. If we finish streaming the active contracts up to offset 6 before transaction A is properly inserted into the DB, the client will not see the contracts from transaction A
The fix to that is to use the latest known head to the dispatcher, which is updated AFTER a batch has been inserted completely.
This PR also factors out the basic readonly functionality that is
duplicated between SqlLedger and ReadOnlySqlLedger into a class
BaseLedger.
* copyright header
* add Numeric.java
* ledger-api: rename `decimal` field to `numeric` in value protobuf
* Address Gerolf's comment
* ledger-api: add missing renammings
* ledger-api: relax syntax of numbers that can be sent as numerics
* extractor: fix
* leger-api: change format of number though ledger api
* daml-lf: fix numeric regexp
* ledger: fix tests
* language: compile everything in the source directory
This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
Both language extension are needed to improve the UX of generic templates.
Without them templates a la
```
template Template (A t) => B t with
```
would produce an error that we need `FlexibleContexts` for the
`Template (A t)` context and a warning suggesting to simplify it to
`AInstance t`. The latter would expose an implementation detail we prefer
to hide.