Commit Graph

274 Commits

Author SHA1 Message Date
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
Gary Verhaegen
1697e764bd
release 0.12.7 (#579) 2019-04-17 16:41:35 +01: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
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
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
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
Jussi Mäki
1f2246c822 Do not divulge contracts to observers in nonconsuming exercises (#325)
* Do not divulge contracts to observers in nonconsuming exercises

Disables support for non-default ledger feature flags, as they
are meaningless since ledger server logic does not respect the flags.
Instead of large refactoring to add support for the old flag settings,
it is best to disallow the deprecated flags, and later on phase out the
flags completely.

Re-enables test_divulgence_of_token in sandbox semantic tests.

Fixes #157.

* purge LedgerFlags entirely...

...since we only support one version of them anyway, and clearing them

* updated release notes
2019-04-11 14:41:35 +02:00
Stefano Baghino
e775b4974e
Amend the Node.js bindings Ledger API values representation (#338)
Finishes the work started in #324:

- drops deprecated `name` in identifiers, adopting `moduleName` and `entityName`
- use string to represent `timestamp`s to avoid a loss of precision
- use string for `date`s too for consistency and future-proofness

The work unconvered a quite serious bug caused by the lack of coverage
on the validation of timestamps: the model was expecting timestamps to
be of type timestamp, whereas in Ledger API values they are represented
by numbers.
2019-04-10 10:47:29 +02:00
Stefano Baghino
fa5c704e7e
Map Protobuf's 64 bit integers to strings in JS (#324) 2019-04-09 15:19:32 +02:00
Nick Smith
3d9731162b
Java codegen daml lf map (#201)
* Fixes #184 java-codgen: Correct num. of type params for DamlLf Map primitive.
2019-04-08 08:31:23 +02:00
Stefano Baghino
f275b0c471 Add verbosity option for Java codegen (#218)
Allows users to supply the argument -V or --verbosity with a number from 0 to 4 for additional logging.

Also, the first and last log message is logged as a warning, when it really
should just be on INFO level.
2019-04-05 10:54:42 +02:00
Bernhard Elsner
e2524806ac Incorporate Robert's suggestion 2019-04-04 16:40:36 +02:00
Bernhard Elsner
d03c24262f Update release notes for Navigator changes 2019-04-04 16:40:36 +02:00
Francesco Mazzoli
9c7357c7de update all references of old repo to new repo 2019-04-04 16:20:07 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00