Commit Graph

79 Commits

Author SHA1 Message Date
Neil Mitchell
4b89903a73 Delete the id function (#851)
* Delete the `id` function

* Fix documentation that referred to id

* Fix some DAML-LF tests that relied on id
2019-05-02 22:57:52 +00:00
Brian Healey
ed22a1e061
Update urllib version to avoid security vulns warning (#864) 2019-05-02 15:39:32 -04:00
Martin Huschenbett
df230912c7
Drop DAML-LF 1.0 support from compiler (#863)
* Drop DAML-LF 1.0 support from compiler

This will enable us to add `Functor`, `Applicative` and `Monad` instances
for `(->) r` in the `daml-stdlib`. We'll do this in a separate PR.

* Remove codegen test for DAML-LF 1.0
2019-05-02 21:35:06 +02:00
Jussi Mäki
9d66ee4fa2
Release version 0.12.13 (#856) 2019-05-02 18:49:43 +02:00
Francesco Mazzoli
cf89366ac6 respect contract visibility when looking up contract keys (#753)
* remove outdated flags from comments

* update tests in preparation for visibility rules

* check visibility of contract keys, fixes #751

* add release notes

* include visibility check in scenario runner

* stephen's suggestions

* fix type error in api server example

* scalafmt

* bring TransactionFiltration.scala up to speed with disclosure

see
<faf1cde1a1/ledger-api/grpc-definitions/com/digitalasset/ledger/api/v1/event.proto>
for an in-depth description. fixes #794.

* add tests for contract key visibility

* move a lot of ledger testing utils out of command checks

* move a lot of ledger testing utils out of command checks

* remove useless checks regarding divulgence

* add tests regarding event witnesses

* update release notes

* re-introduce safety when disclosing
2019-05-02 14:02:30 +00:00
Gabor Aranyossy
c501d64264
fixing bug for mishandling potential offset gaps (#802)
* hedging against possibly gaps in offsets

* doing the math right

* adding some notes

* extracting pipeline logic
 Please enter the commit message for your changes. Lines starting

* extracting "run until" logic to be testable

* testing _run until_ logic

* adding release note

* copyright

* adding link to PR

* changing lookUpByTransactionId to use TransactionPipeline

* fixing issue identified by Extractor tests
2019-05-02 15:00:41 +02:00
Moritz Kiefer
053b2ad160
Release 0.12.12 (#792)
We need a release for a client, I’ll take care of testing it and
making it public.
2019-04-30 15:29:55 +02:00
Martin Huschenbett
033e637209
Rename DA.TextMap.filter into filterWithKey (#731)
* Rename DA.TextMap.filter into filterWithKey

`filterWithKey` reflects better that the predicate used for filtering
takes the key as an argument.

* Add filter back as deprecated and change DA.Map as well

* Adapt tests to renaming
2019-04-30 11:45:13 +02:00
Beth Aitman
79f4bde160 Clarify how you get DAML studio (#765) 2019-04-29 16:03:04 +00:00
Jussi Mäki
d887b21036
Release scala source jars to bintray (#767)
Tested with a dry run:
Copying .../com_github_digital_asset_daml/bazel-out/k8-fastbuild/bin/ledger/api-server-damlonx/api-server-damlonx_src.jar
to .../com/daml/ledger/api-server-damlonx_2.12/100.12.11/api-server-damlonx_2.12-100.12.11-sources.jar
2019-04-29 17:11:01 +02:00
Gabor Aranyossy
8e54bf2e67
documenting persistence with Postgres in SDK docs (#722)
* documenting persistence with Postgres in SDK docs

* revealing jdbcurl flag as it's docuemnted now

* updating release notes

* Update docs/source/tools/sandbox.rst

Co-Authored-By: gaboraranyossy-da <gabor.aranyossy@digitalasset.com>

* Update docs/source/tools/sandbox.rst

Co-Authored-By: gaboraranyossy-da <gabor.aranyossy@digitalasset.com>

* Update docs/source/tools/sandbox.rst

Co-Authored-By: gaboraranyossy-da <gabor.aranyossy@digitalasset.com>

* Apply suggestions from code review

Co-Authored-By: gaboraranyossy-da <gabor.aranyossy@digitalasset.com>

* changed release note entry as suggested

* Apply suggestions from code review

Co-Authored-By: gaboraranyossy-da <gabor.aranyossy@digitalasset.com>
2019-04-29 15:22:05 +02:00
gleber
c095a2e20c Ledger api test tool release (#756)
* release: make 'ci/release.sh' runnable for dry runs.

release-dry-run.sh is outdated and duplicates logic from ci/release.sh, so it
got deleted.

* ledger-api-test-tool: release the tool together with the SDK components.

* ledger-api-test-tool: update docs to reflect distribution mechanism.

* ledger-api-test-tool: further docs refinements.

* Add Ledger API Test Tool mention into release notes.
2019-04-29 12:16:19 +00:00
gleber
0ef84c19b3 Add Ledger API Test Tool docs into DAML docs (#587)
* docs: add structure for Ledger API Test Tool

* docs: ledger-api-test-tool: move docs to DAML docs.

* docs: dlik: add copyrights

* ledger-api-test-tool: improve docs

* ledger-api-test-tool: further docs refinements.

* ledger-api-test-tool: expose stacktraces of SemanticTester to the user.

Previously timeout errors would produce no useful output. This gives some -
albeit low quality - output to help pinpoing the issues. This needs improvement
for better UX.

* docs: dlik: summarize how to use the tool against a DAML ledger.
2019-04-29 09:14:14 +00:00
Jussi Mäki
fce04b9e4a Track the packages used to produce a transaction (#735)
Add field 'usedPackages' to Transaction to record the packages
that were used during interpretation to produce said transaction.
This serves as a hint to specify what packages are required to
validate the transaction. Note that this may not be sufficient
for future implementations that e.g. compile DAML-LF to JVM
bytecode and require packages containing only type definitions
as inputs.

This hint is mainly required for ledger implementations for which the
packages are tracked similarly to contract instances, and which
require that all inputs to their transaction must be declared
beforehand.

This work is required for the participant-state key-value utilities
described in issue #410 and implemented in PR #637.
2019-04-27 01:12:04 +00:00
Stephen Compall
a3e9aad147
remove major LF dev version (#681)
* removing major LF dev version from Haskell proto codecs

* removing major LF dev version from scenario service client

* missed import

* remove Scala support for dev major version; remove --allow-dev option from sandbox cli

* Version.minorFromCliOption function

* don't build daml-stdlib artifacts for dev major

* remove damlc CLI --target dev

* release note about removed dev major LF version

* governance now discusses minor dev, no more major dev

* don't build from daml_lf_dev.proto anymore

* remove daml_lf_dev.proto

* raise deprecated release

* reserve 9999 in the ArchivePayload sum, as suggested by @bitonic

* use reserved proto keyword, as suggested by @bitonic

- `reserved` cannot occur within `oneof` block

* remove --allow-dev test

* dev removal release note followed the previous release; move it back to HEAD
2019-04-26 13:10:09 -04:00
Beth Aitman
9d8983e995 Fix broken docs links to fix red master (#733)
* Fix broken docs links

* Remove generated file

* Fix final broken link

* Whitespace change to make tests run again
2019-04-26 15:12:21 +00:00
Simon Meier
5f1b0b619f
daml-integration-kit: add table of DAML ledgers (fixes #673) (#729)
both the ones in development and the ones built.
2019-04-26 14:51:13 +02:00
Beth Aitman
591f3ff94e
Rework the app dev docs (rebased) (#699)
* Move application architecture guide

* Changing titles etc

* Reshuffling

* More reshuffling of files and content

* Refactoring iinto more sensible pages:

* Getting most stuff into place

* A ton of tidying up

* Fixing things up

* Tidying up

* Address review comments

* Fixes

* Fix warnings etc

* Update redirects

* Try to add copyright header

* Fix headers issue

* Clarify DAML-LF relationship

* Change I missed
2019-04-26 14:09:38 +02:00
Simon Meier
7696f085b5
daml-integration-kit: release PRE-ALPHA version in SDK (#440)
The documentation is in a state that interested third-parties can
consume; and will likely find valuable to consume. It also contains a
description of the current status of the integration kit and the roadmap
outlining its expected evolution.

We have added links to GitHub issues where documentation is missing, or
where it refers to missing pieces of code.
2019-04-26 13:41:18 +02:00
Beth Aitman
b1c6487ee3
Improve the multi party pattern (#541)
* Improve the multi party pattern

* Ensure didn't make sense

* Remove unnecessary condition
2019-04-26 11:33:56 +02:00
Gabor Aranyossy
cc32ee5025
adding missing tests around Sandbox's CLI module (#668)
* introducing CliSpec

* updating sandbox sdk docs

* fixing the missing code block

* adding missing copyright headers

* making allow-dev hidden

* HardCoded -> Predefined

* updated changelog
2019-04-26 10:12:23 +02:00
Moritz Kiefer
80e2107130 Release 0.12.11 (#713)
Now that the Windows release should be fixed, let’s try again.
2019-04-26 10:10:43 +02:00
Robert Autenrieth
f13b16c78e Navigator console: Fix documentation of contract arguments (#680)
* Navigator: Fix console documentation

Arguments have been using the JSON syntax for a while.

* Navigator: Output arguments in JSON format

... to allow copy-pasting them
2019-04-26 00:33:34 +00:00
Beth Aitman
ed690e51cb Document flexible controllers... (#634)
* First stab at flexible controllers placeholders

* Add release note

* Fixing up errors

* Finish flexible controllers todos

* Incoporate Martin's feedback

* Fix return type error
2019-04-25 16:35:16 +02:00
Stefano Baghino
7ac438e87b
Remove //language-support/js (#691)
The JavaScript ecosystem support is being spun off in its own
repository. The new home is https://github.com/digital-asset/daml-js

For further details, here is the counterpart issue in the new repo:

https://github.com/digital-asset/daml-js/issues/1
2019-04-25 14:30:25 +02:00
Martin Huschenbett
b7e6cc8948 Release SDK 0.12.10 (#686)
The main effect is that we switch to DAML-LF 1.3 as the default compilation
target, which enables contract keys and text maps.
2019-04-25 11:37:23 +02:00
Francesco Mazzoli
a504bbdc9e make DAML-LF 1.3 the default (#654) 2019-04-25 08:10:44 +00:00
Gary Verhaegen
963d0779c3 release 0.12.9 (#645) 2019-04-24 21:56:48 +00:00
Gerolf Seitz
7f8dbfeca0 Add CreateAndExercise command throughout the stack (#563)
* Add release notes entry

* Add CreateAndExercise command to Java Bindings data layer

* Add CreateAndExercise command to DAMLe

The CreateAndExerciseCommand allows users to create a contract and
exercise a choice on it within the same transaction. Users can use this
method to implement "callable update functions" by creating a template
that calls the update function in a choice body.

Fixes #382.

* Add CreateAndExercise command handling to the sandbox

* Add CreateAndExercise command to the Ledger API
2019-04-18 16:05:16 +00:00
Bernhard Elsner
aa247e4db6 Embryonic math library for DAML (#419)
* First versions of taylor series based power and log functions

* Improve precision by switching exp algo and shifting points

* Code comments for the math library

* Trig functions

* Update daml-foundations/daml-ghc/daml-stdlib-src/DA/Math.daml

Co-Authored-By: bame-da <40762178+bame-da@users.noreply.github.com>

* More efficient integer exponentiation

* Make Powerable the typeclass for (^) only.

* Move `(^)` to `Multiplicative` and fix package-database

* Round all Decimal literals to 10 digits

* Add release notes

* Update daml-foundations/daml-ghc/daml-stdlib-src/DA/Math.daml

Co-Authored-By: bame-da <40762178+bame-da@users.noreply.github.com>

* Add comment on performance

* Remove default definition for `(^)`

* Fix comments

* Fix scenario-error test

* Fix tests again
2019-04-17 21:15:25 +00:00
Moritz Kiefer
a8b16832e7 Split mvn step in quickstart example in two commands (#578)
This should hopefully make those commands seem a bit less like a
blackbox and help users understand why the second command might fail.
2019-04-17 17:21:46 +00:00
Gary Verhaegen
1697e764bd
release 0.12.7 (#579) 2019-04-17 16:41:35 +01:00
Bernhard Elsner
b2062e6ee9
Explain failure of fetch in StdLib docs (#490)
* Explain failure of `fetch` in StdLib docs

* Explain `fetch` failure in DAML Reference docs

* bump integration tests timeout further, still seems to be flaky
2019-04-16 19:53:51 +02:00
Bernhard Elsner
88ffcdbdc3
I change all the curl commands in quickstart to use correct port (#534)
* I change all the `curl` commands in quickstart to use correct port

* Fix up quickstart
2019-04-16 17:57:22 +02:00
Gary Verhaegen
bef7f758cb
release 0.12.6 (#539) 2019-04-16 15:44:20 +01:00
Gerolf Seitz
f1b077dd1a
Remove blocking call in Bot.wire (#521)
The call to blockingGet can lead to no progress being made in certain
scenarios. Therefore I am removing the blocking call and replacing it
with a regular "doOnSuccess".
2019-04-16 11:53:29 +02:00
Gary Verhaegen
4e80b1f927
release 0.12.5 (#504) 2019-04-15 21:17:38 +01:00
Brian Healey
e885dd112b
Update jinja2 and other versions (#500)
* Update jinja2 and other versions

* HOTFIX uptick jinja2 to >=2.10.1
2019-04-15 13:09:40 -04:00
Stefano Baghino
4110e039dd
Fix the DAML-LF Archive package structure (#502)
The DAML-LF Archive Protobuf definitions, as packaged and distributed
via Bintray and the SDK, currently packages the files in a directory
structure that does not match with the actual one, causing the usage of
`protoc` on the packaged definitions to raise errors. This commit fixes
it by packaging the files in the same directory structure as the one
found in the repository.
2019-04-15 18:25:09 +02:00
Gary Verhaegen
e83c21ae11
release 0.12.4 (#489) 2019-04-15 15:47:32 +01:00
Beth Aitman
d9b35ad1ab Rescuing lost PRs from old repo (#493)
* Add docs publish instructions

* Make publish script fail if Bazel fails
2019-04-15 16:30:20 +02:00
Beth Aitman
5fafdc2a26 Remove performance benchmarks section (#491) 2019-04-15 16:29:58 +02:00
Beth Aitman
fc0a3c9a98
Move DAML snippets from inline to their own files, so they're tested (#446)
* Move DAML-LF snippets to .daml file

* Move codegen snippets to .daml files

* Fix new code snippets

* Fixes from code review

* Silly mistake
2019-04-15 15:47:39 +02:00
Beth Aitman
7b8acd81d8
Update multiparty text (#486) 2019-04-15 15:45:33 +02:00
Francesco Mazzoli
6af84051ee
fix various conversion functions from string to Decimal (#439)
* fix various conversion functions from string to Decimal

Fixes #399.

This fixes a critical bug -- since:

* The DAML-LF spec specifies that the scale of `Decimal` is 10 --
    that is, there are at most 10 digits past the decimal point:
    <79bbf5c794/daml-lf/spec/value.rst (field-decimal)>.
* However, the code converting from the string representation that
    we get on the wire was _not_ performing this check. This is due
    to two reasons:

    - `Decimal.check` is a function that checks whether a given
        `Decimal` is within the upper and lower bounds of what the
        DAML-LF spec specifies, but crucially it does _not_ check that
        the scale is not exceeded:
        <79bbf5c794/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/Decimal.scala (L31)>.
        This behavior is correct in some cases (more on that later),
        but not in others. Crucially, `Decimal.fromString`, which was
        supposed to check if a decimal string literal is valid, used
        this function, which means that it accepted string literals
        containing numbers out of the required scale, rounding them to
        make them fit within the scale. This function has been renamed
        to `Decimal.checkWithinBoundsAndRound`, and a new function
        `Decimal.checkWithinBoundsAndWithinScale` has been added, which
        fails if the number provided has data not within the scale.
        `Decimal.fromString` now uses
        `Decimal.checkWithinBoundsAndWithinScale`.

    - `ApiToLfEngine.parseDecimal` assumed that `Decimal.fromString` _did_
        fail when passed numbers that were in any way invalid, and
        moreover did _not_ use the result of `Decimal.fromString`, but rather
        re-parsed the string into an unconstrained `BigDecimal`:
        <79bbf5c794/ledger/ledger-api-common/src/main/scala/com/digitalasset/platform/participant/util/ApiToLfEngine.scala (L96)>.
        The reason for the code to work this way is that in the past
        it was responsible for converting decimal strings both for the
        current engine but also for an older version of the engine which
        handled decimals of a different type. Both issues have been fixed.

* Therefore, `Decimal`s with scale exceeding the specified scale
    made it into the engine, and contracts could be created containing
    this invalid value.

* Once on the ledger, these bad numbers can be used to produce extremely
    surprising results, due to how `Decimal` operations are
    implemented. Generally speaking, all operations on `Decimal`
    first compute the result and then run the output through
    `Decimal.checkWithinBoundsAndRound`. The reason for this behavior
    is that we specify multiplication and division as rounding their
    output. Consider the case where the bad value 0.00000000005 made
    it to the engine, and is then added to 100. The full-precision
    result will be 100.00000000005, which after rounding becomes 100.
    Therefore, on a ledger where such invalid values exist, it is not
    the case that `y > 0 ==> x + y != x`, and so on.

Thanks a bunch to @briandbecker for the excellent bug report.

* fix failing test using to much precision
2019-04-14 13:49:28 +02:00
moritzkiefer-da
1326596795
Release 0.12.3 (#458) 2019-04-12 20:22:31 +02:00
Gary Verhaegen
59f480d978 prepare release note for next release (#443) 2019-04-12 16:17:31 +02:00
Beth Aitman
b902239fa3
Remove ExcludeFromDamlTests (#437) 2019-04-12 14:44:17 +02:00
gleber
aa70c7f64e
Enforce consistent formatting of BUILD files. (#412)
* Add buildifier targets.

The tool allows to check and format BUILD files in the repo.

To check if files are well formatted, run:

    bazel run //:buildifier

To fix badly-formatted files run:

    bazel run //:buildifier-fix

* Cleanup dade-copyright-headers formatting.

* Fix dade-copyright-headers on files with just the copyright.

* Run buildifier automatically on CI via 'fmt.sh'.

* Reformat all BUILD files with buildifier.

Excludes autogenerated Bazel files.
2019-04-12 13:10:16 +02:00
Gabor Aranyossy
3e154fd682
Sandbox Postgres support with passing api integration tests (#392)
* TransactionServiceIT passes

* fixup

* using record time taken from TimeProvider

* taming TransactionBackPressureIT to avoid overloading of submission service

* implement AutoClosable on all Ledger related components having stateful resources

* reenabling InMemory fixture

* disabling contract key integration test for SandboxSQL fixture

* removing TODO

* bumping up timeout on TransactionServiceIT due to slow Azure pipeline

* 1 minute timeout for SqlLedgerSpec

* making jdbcurl CLI argument hidden

* updating release notes
2019-04-12 12:25:48 +02:00