Commit Graph

323 Commits

Author SHA1 Message Date
Stephen Compall
fef8a956ee use WithTxValue in place of VersionedValue more broadly (#643)
* GenTransaction.WithTxValue alias

* undo parts of parent dealing explicitly with serialization

* use GenNode.WithTxValue more often

* use Node*.WithTxValue more often
2019-04-24 13:54:41 +00:00
Gary Verhaegen
81b976b919 allow arbitrary version numbers (#657) 2019-04-24 12:54:36 +00:00
Martin Huschenbett
6fd111f885 Remove a temporary hack regarding daml-stdlib.dar and Scala tests (#664) 2019-04-24 12:18:48 +00:00
Gabor Aranyossy
f1f494ad60 Introducing range queries in Dispatcher (#611)
* introduced a SteppingMode abstraction for Dispatcher

* changing InMemoryLedger to use range queries

* SQL Ledger uses range queries

* documenting + fixing off by one semantics of Dispatcher

* adapting DispatcherIT

* added some docs

* reverting off-by-one offset semantics required on the ledger-api

* formatting

* introducing a case class ParsedEntry for sql result parsing

* testing Dispatcher with slow range queries as well

* adding missing ORDER BY ASC

* removing commented out code
2019-04-24 11:31:17 +00:00
Martin Huschenbett
18f0b3775c Simplify implementation of fetchByKey in compiler (#647)
Currently, the structural record returned by DAML-LF's `fetchByKey` is
unpacked in the compiler. This is not very nice as it requires too much
code for my taste.

This PR shifts the unpacking into DAML land by means of the recently
introduced `unpackPair` function.
2019-04-24 10:35:58 +00:00
Martin Huschenbett
968bca7589 Check that contract keys are supported in DAML-LF type checker (#639)
Add a check to the Haskell implementation of the DAML-LF type checker to
make sure that the current DAML-LF version supports contract keys when they
are encountered.
2019-04-24 09:17:15 +00:00
Martin Huschenbett
52d2026b2a Use isSingleConType instead of hand written pattern in Convert.hs (#633) 2019-04-24 08:28:35 +00:00
Martin Huschenbett
0c452fb169 Inline record projections on this in maintainer expression (#638)
If we don't inline let bindings of the form `x = this.f`, the rewriting of
the maintainer expression in terms of the key can fail when it shouldn't.
Usually, these bindings do not exist in the surface language but are produced
by the compiler. I think the performance penalty we might pay for this is
negligible.

This fixes #384.
2019-04-23 21:04:39 +00:00
Moritz Kiefer
416b0949fa Fix termination of scenario service on Windows (#629)
* Fix termination of scenario service on Windows

The lack of a proper Windows IO manager resulted in us being unable to
kill the conduits reading the output of the scenario service so `damlc
test` and `damlc ide` blocked forever. This PR fixes the problem by
shutting down the scenario service (by closing its stdin) before
killing the conduits .

* Use fail instead of error

* Add debugging output

* Remove debug output

* Bump timeout of perf test
2019-04-23 19:43:23 +00:00
K5
c0d1386329 Make daml new files writeable. (#642) 2019-04-23 19:02:01 +00:00
Gabor Aranyossy
6422e2cafd Update README.md (#640)
adding missing description in README.md
2019-04-23 17:47:54 +00:00
Martin Huschenbett
0843d9a9e1 Add Functor/Foldable/Traversable instances for DAML's TextMap (#632) 2019-04-23 17:00:37 +00:00
Michał Majcherski
0b87c4ceae windows: fail on dev-env sync errors (#635) 2019-04-23 15:54:28 +00:00
Martin Huschenbett
0242cf985b Remove a comment regarding the consuming method of the Choice class (#628)
* Remove a comment regarding the consuming method of the Choice class

The comment has been out of date since the new "dictionary sanitization" was
implemented.

* Change default implementation of consuming method of type class Choice
2019-04-23 15:01:34 +00:00
Beth Aitman
a8648abed6 Remove outdated documentation things (#626)
* Remove outdated documentation things

* Remove outdated release section

* More outdated stuff

* Fix link
2019-04-23 14:01:45 +00:00
Jussi Mäki
7c275b17fb DamlOnX refactoring: Drop StateInit, Long Offset (#519)
* daml-on-x: Drop StateInit and use AtomicReference

- Drop the StateInit update message and introduce "getLedgerInitialConditions".
- Switch to AtomicReference from SyncVar as this is non-blocking and hence safer to use from Akka.

* ledger/participant-state: Rename recordTimeEpoch to initialRecordTime

and use the time from timeProvider at the ledger object initialization
time as the initial record time.

* fmt

* Fix use of repo as external workspace. Fix compilation issue in IndexState.scala

* Refix the use of this repo as external bazel workspace

* Fix compilation after rebase

* refmt
2019-04-23 12:56:40 +00:00
Jussi Mäki
91449122f7
Add damlonx artifacts to the release (#627) 2019-04-23 14:00:55 +02:00
Michał Majcherski
a6215f1ceb
windows: more targets (#571)
* windows: more targets
* generate Haskell from ledger-api protos - genrule fix
2019-04-23 11:12:21 +02:00
Moritz Kiefer
077e54042b
Fix daml wrapper on Windows (#624)
Apart from the fact that START was missing the windows title argument
it launches a new terminal window and then exits immediately (the
terminal windows is closed immediately as well) so it seems like the
wrong thing to use. Just calling the executable directly seems to work
fine both in cmd.exe and in powershell on my Windows 10 VM so
hopefully this is reasonably robust.
2019-04-23 10:12:12 +02:00
Anup Kalburgi
2b3c4e76bb Adding stepts to run daml scenario in daml-ghc readme (#619)
* Adding stepts to run daml scenario in damlc

* Adopting the suggested change
2019-04-19 20:02:43 +00:00
Stephen Compall
eb4d418be2 Check contract visibility when looking up contracts in sandbox (#405)
* seal engine.Error

* don't reinvent flatMap in CommandExecutorImpl

* add DivulgenceVisibility sandbox test case

- suggested by @oggy-; thanks

* add global implicit disclosure step to sandbox ACS transaction acceptance

* reorder ActiveContractsManager and include an implicitlyDisclose action

* add submitter argument to SubmissionHandle#lookupActiveContract

- the receiver must filter its response based on witnesses thereof

* propagate implicit disclosure in more places

* it's a bunch of functions

* proper error from the no-divulgence test

* rename ActiveContracts and ActiveContractsSteps to ...InMemory and ActiveContracts

* we need another table

* rename ActiveContract.witnesses to disclosedTo

* don't exclude other disclosures in ActiveContractsManager

* add local implicit disclosure when adding transaction to sandbox acs

* extra argument in ledger-api-server-example

* too late to blind?

* adapt to 10fcab8 #339

* scalafmt

* non-total map get

* disable postgres test in SandboxSemanticTestsLfRunner until implicit disclosure added

* un-flatten witnesses and divulgences from "disclosedTo"; fixes DivulgenceIT

* comment on filtering of lookupActiveContract

- suggested by @francesco-da; thanks

* semantic errors from parent

* scenario to test divulgence success

* submit line 6 as owner; disable divulgence test under SQL

* comment what else to reenable
2019-04-19 17:00:09 +00:00
Leonid Shlyapnikov
cf3227938c Release codegen front-end shaded binary, #615 (#617)
* Release codegen front-end shaded binary, #615

* Fix bazel formatting
2019-04-19 14:24:57 +00:00
Anup Kalburgi
cea0b72522 Adding snipped support for choice (#610) 2019-04-18 19:44:44 +00:00
Leonid Shlyapnikov
4458a81e83 Unify Scala and Java Codegen Inputs (#585)
* Extract codegen-common module, #166

* Scala Codegen Main using the same option parser as Java Codegen, #166

There is one important difference, Scala Codegen does not allow mapping
dars to different package names, all dars have to be mapped to the same
package name.

Replace Scala Codegen println's with scala logging, respecting the
configured codegen verbosity

* Fix bazel formatting

* Update the release dry run script

* Releasing codegen-common

* Improving Scala Codegen error reporting (code review)

* Addressing codereview comments

* Make it explicit that we skip not supported option
2019-04-18 19:04:57 +00:00
nickchapman-da
702c52bc25 generate Haskell from ledger-api protos (#607)
* first cut bazel rule to generate Haskell from ledger-api protos

* untabify

* formatting fixes
2019-04-18 17:56:26 +00:00
Moritz Kiefer
8834ac375b Build SDK release tarball on Windows (#597) 2019-04-18 17:22:12 +00:00
Gary Verhaegen
a150048697 run perf tests separately (#605) 2019-04-18 16:46:02 +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
Gary Verhaegen
0081fd6ea6 bump macOS builders to 10.14 Mojave (#600) 2019-04-18 15:22:10 +00:00
Robin Krom
d4b87897be language: fix: accidentally removed project database (#598)
This adds the local project database back to the checked package
database. It was accidentally removed in an earlier commit.
2019-04-18 14:27:54 +00:00
Leonid Shlyapnikov
f39b7a5d3f Update Scala Codegen SBT Example (#558)
* Update scala codegen sbt  example to use the latest codegen binaries

Use DAR to generate Scala code, no reason to unzip DALFs.

* Add support for `DA.sdkVersion` system property.

To override the default sdkVersion:
```
> sbt -DDA.sdkVersion=100.12.6 compile
```

* Simplify the way examples run
2019-04-18 13:49:53 +00:00
gleber
91843213bc Ledger API test tool (#496)
* ledger-api-test-tool: create with self-contained tests

Based on code by Tim Williams <tim.williams@digitalasset.com>

* ledger-api-test-tool: added an extract operation for resources

* api-server-damlonx: make ReferenceServer command-line-configurable.

This includes:
- port
- list of dars to load
- enable bad read service

* ledger-api-test-tool: Add test against Reference server.

* ledger-api-test-tool: allow all semantic tests.

* ledger-api-test-tool: move into //ledger/ledger-api-test-tool.

* ledger-api-test-tool: Add README

* ledger-api-test-tool: improve README according to the code review.

* ledger-api-test-tool: language and structure improvements to readme.

Based on review by bethaitman@digitalasset.com.
2019-04-18 13:06:02 +00:00
Jonas Chevalier
4184867916 bazel: move .bazelrc back to the repo root (#596)
It turns out that bazel still loads the .bazelrc file even if an
explicit --bazelrc argument is passed to it.
2019-04-18 12:04:23 +00:00
Jonas Chevalier
3b8ae1ff86 infra: add a VSTS windows agents (#368) 2019-04-18 11:20:57 +00:00
Andreas Herrmann
fbade2e815 Build //daml-assistant:daml on Windows (#595)
* haskell: windows: always link system libraries

Modifies the patch to rules_haskell so that Windows system library are
not only applied to grpc, but to all targets on Windows.

* windows: test //daml-assistant:daml on CI
2019-04-18 10:37:03 +00:00
Moritz Kiefer
6c06dbd730 Support package_app on windows (#594)
* Support package_app on windows

* Fix formatting
2019-04-18 09:26:41 +00:00
Gabor Aranyossy
879edf5911 running sandbox performance tests with SQL backend (#580)
* running sandbox performance tests with SQL backend

* adding docs
2019-04-18 07:45:42 +00:00
Shayne Fletcher
a30aab77de Integrate ghc-lib-0.20190417 (#588)
* Integrate ghc-lib-0.20190417.1

* update Desugar.daml, tests, and release notes
2019-04-18 00:11:23 +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
Nicolas Mattia
f57c74d706 Build and run damlc on Windows (#568)
* Fix network build on Windows

Some files were not added to the build, which led missing symbols at
link time.

* Drop dll.a files from Windows GHC bindist

Those files greatly confuse GHC when linking statically.

* Add some Windows system libraries

These libraries are needed when linking GRPC.

* Statically link pthread on Windows

Otherwise the executables fail at runtime because they cannot find the
shared object.

* Build and run damlc on CI

* Try to fix package_db/* nullglob error

* Fix powershell command

* Cleanup package db rule

* Make formatting ugly again
2019-04-17 20:37:35 +00:00
Anup Kalburgi
29123c7ec0 Adding more consuming pre-consuming and post consuming keywords (#586) 2019-04-17 19:38:47 +00:00
Shayne Fletcher
d1fd9b79d2 Implement post-consuming choices (#574)
* Implement postconsuming choices

* Update daml-foundations/daml-ghc/src/DA/Daml/GHC/Compiler/Convert.hs

Co-Authored-By: shayne-fletcher-da <shayne.fletcher@digitalasset.com>

* Update daml-foundations/daml-ghc/tests/ConsumingTests.daml

Co-Authored-By: shayne-fletcher-da <shayne.fletcher@digitalasset.com>

* incorporate review suggestions

* one or two more tests

* formatting tweak

* remove a comment that has been proven wrong

* reinstate lambda and comment
2019-04-17 18:46:17 +00:00
Anup Kalburgi
7afd2bc27c VS code extension - syntax highlighter dev guide (#555)
* VS code extenstion dev guide

* Adding annotated file

* Correcting the comment about scopes and the mention of the test file

* Pending tasks to github issues

* Blank lines are not needed

* Oerder is important

* adding copyright to daml test file

* Adding comment example
2019-04-17 18:21:07 +00:00
Martin Huschenbett
7d346e2299 Rename DA.Private.TextMap into DA.TextMap (#573)
* Rename DA.Private.TextMap into DA.TextMap

Also clean up the code a bit.

* Add Ord instance for TextMap back

* Fix language server test
2019-04-17 17:51:36 +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
Gabor Aranyossy
1b56d4385e Extracting large command test from TransactionServiceIT (#566)
* extracting large command test from TransactionServiceIT

* make `preprocessCommands` more performant (see comment)

* fix duplicated command generation in `preprocessCommands`

* enable in-memory test-fixture as well
2019-04-17 16:20:56 +00:00
Gary Verhaegen
1697e764bd
release 0.12.7 (#579) 2019-04-17 16:41:35 +01:00
Remy
de69ed61db
Leger Api. Simplify Ledger Api domain (#577)
* drop domain.Identifier in favor of Ref.Identifier
* drop domain.Party in favor of Ref.Party
2019-04-17 17:03:23 +02:00
Neil Mitchell
87d0330f50
Reorganize damlc to put the test stuff in a separate module (#569)
* Reorgnaise damlc to put the test stuff in a separate module

* Clean up now-redundant block comments

* HLint

* Fix a changed import
2019-04-17 15:14:31 +01:00
Gary Verhaegen
d1fd0c039b
strictify mergify (#576) 2019-04-17 14:25:36 +01:00