Apparently, we never had any tests for this, so this PR adds at least
a rudamentary test. The logic for this is rather stupid and easy to
break and might change soon so I’ll hold off on adding more extensive
tests until this works a bit better.
SS.scenarioServiceClient does not just read the actual client from
some IORef, it registers the available gRPC methods. Apparently we
never knew about this or at least I didn’t.
By only doing this once, we should speed things up a bit and this
fixes once of the assertion failures that we have been seing on
shutdown (pthread_mutex_lock(&mu->mutex) == 0 in sync_posix.cc) which
was caused by trying to register a method from another thread after
destroying the channel.
* language: docs: added package import documentation
This adds a chapter on DAML archives and how to import them into other
projects to the documentation.
* Update docs/source/daml/reference/packages.rst
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* addressing comments
* removed random include in integration kit docu
Add a command line option to `damlc inspect` which allows for configuring the
details level of the pretty printed DAML-LF. Right now the only difference is
that levels bigger than 0 print all location information. Level 0, which is
the default, also prints location information top level declarations.
This feature is useful for debugging location information.
* Show function names in stack trace on failing scenario
So far, we've only shown the location of the function but not its name.
Now, we add the name of the function as well.
* copy design draft for JSON LF encoding with minimal changes
* literal block formatting
* :: on its own
* only describe the variant notation we've chosen
* wrap
* mark some text literal
* correct reason why null is not a valid Unit
* alignment
* explain that the presence of type variables has no bearing on nested Optional encoding
* correct copyright header
* quotes and subscripts
* remove disallowed examples of variants
* positive? negative?
* you never know when JavaScript will ruin your day
* what's {} anyway
* we are talking about JSON, you know
* daml-lf: make match2's fallback lazy, and add tuple2 syntax for better inference
* lf-value-json: when decoding, branch on type, *then* on value
- restores totality checking for interface ADT
- makes alternate input formats obvious at a glance
- lets us restructure in the future to cache type branch lookups
* lf-value-json: support numbers for int64s
* lf-value-json: test failures and more timestamp cases
* lf-value-json: adapt timestamp decoding to new rules
* lf-value-json: cleanup
* lf-value-json: decode Number as decimal
* lf-value-json: forbid yet another timezone format
* lf-value-json: don't copy
* lf-value-json: replace {Some, {None optional format with nest-sensitive [] format
* lf-value-json: round decimals rather than rejecting, in either string or number form
* lf-value-json: support output to JsNumber for int64s and decimals, separately
- not dependent on JavaScript safe integer range, because that is not
the purpose of this option
* lf-value-json: uncomment some now-tested rounding cases
* allow None record fields to be omitted in object syntax
* release notes
* Only report progress when client supports it
This fixes an issue that some people encountered when running hie-core
in Emacs with a version of haskell-lsp that does not understand
progress events.
* Fix tests
* More test fixes
For now, this only works on Linux (that’s a GHC limitation as far as I
know) and you have to enable it by setting the GHC_DWARF env var to a
non-empty string.
* Removing JWT verification (should be done by the ledger... eventually)
Adding JwtDecoder that does not do JWT signature validation at all.
* Updating README
* Changes to allow overriding the default JWT decode only logic.
You can pass a function that does more than just decoding.
This test represents the behavior of contract keys before the change of behavior in DAML LF 1.DEV.
The existing ContractKeys test is renamed to ContractKeysSubmitterIsMaintainer.
The `LedgerTestSuiteRunner` now uses a fixed number of
threads for the runner threadpool. This way we don't flood
the CPU with threads when using a CachedThreadPool.
* language: fix: compute correct source root when building dar
Previously we just took the base directory of the main file, which is
wrong when the main is deeper down in the module structure.
* hlinting
* reuse moduleImportPaths
I assume the plan was to implement stack traces. I intend to do that as well
but the message type does not fit my approach. Thus, let's remove it first.
* Print stack traces in the scenario on failure
Currently, we only print the last source location, which is not
particularly helpful for debugging. Now, we put all source locations we
encounter during execution on the continuation stack and print them when
a scenario fails. This PR does not print the names of entered functions
or choices. We leave this for a future PR.
* Address Moritz' comments
Otherwise, we can end up retaining references to the old map which
prevent it from being garbage collected.
On a simple testcase that repeatedly opens and closes a module, this
seems to make memory usage constant whereas it was increasing
each time before.
* Add md_instances field to ModuleDoc
* Extract instances
* Add instance fields to class and type docs.
* Implement distributeInstanceDocs
* Use Maybe list instead of list.
* Render instance docs.
* Add instance data in tests and add a golden test.
* Rename to orphan typeclass instances.
* Use per-test parties in HS ledger bindings tests
This should hopefully solve the flakiness issues caused by the reset
service. For now, there is a very small number of tests that we run on
an isolated sandbox namely the tests for party management and package
management.
* shut up hlint
* Disable reset tests
Example:
ContractKeys
- Divulged contracts cannot be fetched or looked up by key ... Success
- Contract Keys should reject fetching an undisclosed contract ... Success
- Contract keys should be scoped by maintainer ... Success
Divulgence
- Divulged contracts should not be exposed by the transaction service ... Success
- Divulged contracts should not be exposed by the active contract service ... Success
Identity
- A ledger should return a non-empty string as its identity ... Success
SemanticTests
- Test:consistency_doublespend1 ... Success
- Test:contract_keys_test ... Success
- Test:consistency_doublespend2 ... Success
- Test:authorization_success1 ... Success
- Test:authorization_rule2_failure ... Success
- Test:authorization_rule1_failure ... Success
- Test:privacy_projections1 ... Success
- Test:consistency_doublespend3 ... Success
- Test:authorization_success2_delegation ... Success
Time
- Advancing time should return the new time ... Success<Paste>
* Upgrade ghc-libs supporting generic templates
* Update Proposal and ComposedKey tests to generic template syntax
* Temporarily patch daml-doc test output (will need to fix for template instances)
* daml-lf: base interface reader on archive decoder
* fix call to InterfaceReader.readInterface
+ cosmetic changes
* daml-lf: decoder can process only serializable data