Commit Graph

478 Commits

Author SHA1 Message Date
Gerolf Seitz
32a61b275f Java Codegen now supports parametrized ContractIds. (#2621)
Fixes #2258
2019-08-22 12:01:22 +00:00
Moritz Kiefer
49b2ec1558
Refactor gRPC request cancellation support in gRPC-haskell (#2626)
* Refactor gRPC request cancellation support in gRPC-haskell

Previously, we had a separate constructor that took an additional
callback that had access to the client call so that we could use that
for cancellation. This PR removes the separate constructor and instead
changes the callback accepted by ClientReaderRequest (and for
consistency also the one accepted by ClientBiDiRequest) to pass the
client call.

This seems like a simpler solution so I’m more hopeful that we will be
able to upstream this change (this is the only API breaking change we
made afaik). There are two caveats here:

1. This will break existing consumers that use ClientReaderRequest. At
this stage in gRPC-haskell this is very reasonable and upstream
doesn’t seem to try very hard to avoid those.

2. The callback is called slightly later than the custom callback we
added before so you have to wait a bit longer until you can cancel
things. At least on our test suite that doesn’t seem to make a
difference.
2019-08-22 12:53:30 +02:00
Bernhard Elsner
d9298c8744 Various improvements to make hs-bindings usable outside repo (#2583) 2019-08-19 16:44:45 +00:00
Bártfai Tamás
a76f82d088 Fix log level for errors in Bot.java (#2581) 2019-08-17 19:42:54 +02:00
Moritz Kiefer
6a0ebc9f5e Go back to building grpc-haskell-core using c2hs (#2574)
* Go back to building grpc-haskell-core using c2hs

This should hopefully avoid issues like the CSize vs CULong issue we
had a while back and might fix some of the issues we have been seeing
on CI.

I’m marking the Haskell ledger bindings as non-flaky for now so we can
see if the issues reappear.

* Fix path

* Fix c2hs runfiles

* s/basedir/dirname/

* Fix varname

* Remove fixme \o/

* Mark hs ledger bindings flaky again
2019-08-16 14:17:11 +00:00
Moritz Kiefer
f3f2d3311b
Remove dependency on isolated sandboxes from HS ledger bindings tests (#2554)
The only tests that relied on this, were the ones for package
management and party management but we can fairly easily remove that
dependency by only checking the diff in packages and thereby folding
the listKnown* and uploadParty/uploadDar file into a combined test.

I’ve also bumped one timeout that I’ve seen fail on CI and managed to
get to fail locally under load.

I am unable to get the tests to fail now locally so I’ve marked them
as non-flaky on everything but Windows (we’ve seen weird segfaults
there).
2019-08-15 11:50:51 +02:00
Moritz Kiefer
ef635ea301
Mark tests that use Haskell gRPC bindings as flaky (#2521)
I’m hoping to investigate this soon but for now this should hopefully
result in less time spend restarting tests.
2019-08-13 20:38:51 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Moritz Kiefer
8f587dc456
Use per-test parties in HS ledger bindings tests (#2481)
* 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
2019-08-12 12:56:18 +02:00
nickchapman-da
5ebc5e4d19
Hlb apps package discovery (#2455)
* suggested tiny code simplifications

* fix package discovery for Nim/Chat ledger apps
2019-08-08 16:50:17 +01:00
Remy
5dd7f1afcf java-codegen: fix broken language-support/java/codegen/src/it/dar/integration-tests-model-1.0.dar (#2443) 2019-08-07 13:56:36 +00:00
nickchapman-da
8f9a781750
hlb, use Int64 / Fixed E10 as appropriate (#2440) 2019-08-07 13:27:58 +01:00
nickchapman-da
2b1204ceac
hlb, fix bug where sandbox is not being run on a dynamically allocated port (#2428) 2019-08-07 11:16:53 +01:00
nickchapman-da
f5688bdc25
hlb, cleanup daml used for tests (#2370) 2019-08-01 22:24:54 +01:00
nickchapman-da
1c12354f38
hlb, reformat all the types (#2369) 2019-08-01 22:24:28 +01:00
nickchapman-da
662361ac47
hlb, convert all the values (#2368) 2019-08-01 15:27:14 +01:00
Gary Verhaegen
568403210b
hs-bindings readme: fix link (#2349) 2019-07-31 14:22:01 +01:00
Gary Verhaegen
0b8933627c record Nick's comments on hs ledger bindings (#2340) 2019-07-30 16:25:19 +00:00
nickchapman-da
8b5cd613f4
hlb, no wildcard record construction (#2332)
* remove: type Status = LL.Status

* no {..} in record construction
2019-07-30 13:47:09 +01:00
Moritz Kiefer
50a04397e4
Supporting producing sdist tarballs for the HS ledger bindings (#2336)
* Supporting producing sdist tarballs for the HS ledger bindings

The README.md has an explanation for how you can use this.

This should hopefully allow others to experiment with the bindings.
2019-07-30 14:34:16 +02:00
Stefano Baghino
340a4eb6a4
Read stakeholders through the active contract service (#2316)
* Read stakeholders through the active contract service

Fixes #2070

Also standardizes the use of American English spelling for `serialize`
and `deserialize`. Standardize. Serialize. Americanize.

* Remove Haskell bindings test workaround

* Address https://github.com/digital-asset/daml/pull/2316#discussion_r308193661
2019-07-30 10:40:45 +02:00
nickchapman-da
53eed132db
fix missing Status info in Completion (#2321) 2019-07-30 09:23:54 +01:00
nickchapman-da
b90862ebec
improve haskell module hierarchy to be more consistent (#2319) 2019-07-29 15:55:55 +01:00
Gerolf Seitz
136f6d1c08
Remove ExercisedEvent#contract_creating_event_id. (#2262)
This is a breaking change on the ledger api. So far we could rely on the
assumption that contractId == eventId. This assumption doesn't hold
anymore in a daml-on-x setting, where the eventId is created by the
api server, but the absolute contractId is created by the ledger
implementation.

Instead of going through weird contortions to store the relevant data in
the existing database schema, it is more viable in the long term to
remove that field and instead provide facilities to lookup transactions
by contractId.

Contributes to #2068.
2019-07-29 11:30:01 +02:00
Gerolf Seitz
c1608604ae
Add all packages in bindings-(rx)java to the javadoc (#2284)
Fixes #2280
2019-07-29 09:54:13 +02:00
nickchapman-da
77ed83b5b7
assert the reset service has worked as expected (#2305)
* assert the reset service has worked as expected

* flipping hlint
2019-07-26 18:46:52 +01:00
nickchapman-da
7064953a13
hlb, support: PartyManagementService (#2300)
* small refactorings in response to previous PR

* hlb, support: PartyManagementService
2019-07-26 16:47:01 +01:00
Michał Majcherski
37a921516b
Upgrade gRPC JVM libs (#2276)
* Haskell ledger bindings tests setup fix - use --port-file to obtain sandbox's port

* Update gRPC JVM libs

* Add missing gRPC core dependency

* Redirect sandbox's stdout and stderr to /dev/null

* Amend ledger's NettyServerBuilder settings after gRPC upgrade
2019-07-26 14:44:59 +02:00
nickchapman-da
7d7ee965d9
fix retry handling for issue #2260 (#2294) 2019-07-26 13:44:40 +01:00
nickchapman-da
49e21660f1
support --host option for daml deploy command (#2285) 2019-07-25 12:26:07 +01:00
nickchapman-da
b30228ab95
{-# LANGUAGE OverloadedStrings #-} is now on by default (#2270) 2019-07-24 08:09:26 +01:00
Remy
53de5edbc1 ledger-api: Kill legacy identifier (#2211)
* ledger-api: drop support for legacy identifier

* address scala-codegen: Stephen's comments

* language support: fix test
2019-07-23 20:34:52 +00:00
nickchapman-da
d306814193
hlb, support: CommandService, all 4 RPCs (#2267) 2019-07-23 17:29:30 +01:00
nickchapman-da
dd09c42210
hlb, support: RPC ListKnownPackages (#2261) 2019-07-23 14:09:58 +01:00
nickchapman-da
eec0333c73
support TimeService RPCs in haskell ledger bindings (#2247) 2019-07-23 09:42:36 +01:00
nickchapman-da
a31d5f04e1
go all-in on RecordWildcard syntax: {..} (#2212) 2019-07-18 12:36:45 +01:00
nickchapman-da
83e01d42eb
cleanup and refactor code structure for nim/chat ledger apps (#2210) 2019-07-18 12:36:19 +01:00
Michał Majcherski
76f877e71d
Haskell ledger bindings - multiple reset test (#2185) 2019-07-17 17:17:29 +02:00
Andreas Herrmann
63b46304eb
Base DA.Bazel.Runfiles on bazel-runfiles (#2147)
* DA.Bazel.Runfiles based on bazel-runfiles

* locateRunfilesMb -> locateRunfiles

* .exe extension on Windows

* Add docstring to locateRunfiles

* bazel-runfiles: Normalize on Windows
2019-07-17 09:48:44 +02:00
nickchapman-da
102cca04cd
haskell ledger bindings, support uploadDarFile (#2146)
* support uploadDarFile

* comment

* move uploadDarFileGetPid into test code
2019-07-15 16:06:41 +01:00
Remy
7c8bb0257d java-codegen: add integration tests for lf 1.5 (#2143)
* java-codegen: add integration tests for lf 1.5

* formatting

* java-codegen: add README abotu tests organization
2019-07-15 14:35:35 +00:00
nickchapman-da
63dd57ab19
fix nim/chat apps (#2120) 2019-07-15 08:57:43 +01:00
Remy
e7bbf87692 Freeze DAML-LF version 1.6 (#1937)
* daml-lf: cosmetic

* daml-lf: release V1.6

* daml-lf: update spec

* update unreleased.rst

* Address Martin's comments

* damlc: active daml-lf-target 1.6

* lf-encoder: fix testing dar generation

* daml-lf spec: simplify 1.dev description

* daml-lf: fix engine test

* daml-lf: fix version timeline

* extractor: fix test

* Address Stephen's comments

* Add more meat to the release notes

* java-codegen: update docs

* damlc: set 1.6 as default output version

* java-codegen update integration tests

* undo replicating typo

* release notes

* scala-codegen: update test

* java-codegen: fix doc

* extractor: fix  test

* address Gerolf's comments

* realse-notes: cleanup unreleased.rst

* Address last comment from Stephen

+ cosmetic cleanup

* formatting
2019-07-12 19:06:44 +00:00
nickchapman-da
4909ee1f01
refactor Stream -> StreamCore/StreamExtra (#2114) 2019-07-11 18:52:50 +01:00
nickchapman-da
a183df6585
haskell ledger bindings: improve thread handling (#2096)
* no forkIO

* mask_ body of asyncStreamGen

* reinstate flaky = True

* use: MonadUnliftIO

* thank you HLint
2019-07-11 17:25:02 +01:00
Gabor Aranyossy
33c746fe9b loading Dars from ZipInputStreams (#2005)
* loading Dars from ZipInputStreams

formatting and cleanup

fixing DarReaderTest not compiling

fmt

using IOUtils to read the ZipInputStream

fixing CodeGen

fixing broken legacy DAR loading

fixed v2 ReferenceServer

cleanup

* fixing rebase conflicts

* introduced a fromFile method to avoid having to do boiler-plating where the input is a File

* addressing leaking resources

* cleanup

* inlining closures

* closing the darStream
2019-07-11 15:37:21 +00:00
nickchapman-da
c41aca5b64
haskell ledger bindings -- LedgerConfigurationService (#2075)
* support: LedgerConfigurationService

* add da_haskell_repl target for haskell legdger bindings build

* address review comments

* fmt
2019-07-10 11:35:46 +01:00
nickchapman-da
5296f0253e
support: ActiveContractsService (#2067) 2019-07-09 15:09:55 +01:00
nickchapman-da
7a981d0e33
preserve [Transaction] per stream element in getTransactions rpc-wrapper, matching the .proto definition (#2054) 2019-07-09 10:35:34 +01:00
nickchapman-da
85a5222a28
Hlb address review comments (#2034)
* inline Convert.lowerList

* newtype Verbosity

* generalize type for raiseMap, and add comment
2019-07-08 16:28:07 +01:00
nickchapman-da
74b684ee0a
Hlb transaction service (#2029)
* support rpc: GetFlatTransactionByEventId

* support rpc: GetFlatTransactionById

* test: GetTransactions

* support rpc: GetTransactionTrees, and types: TransactionTree,TreeEvent

* reorder TransactionService.hs to match .proto

* rpcs: GetTransactionByEventId, GetTransactionById
2019-07-05 17:20:08 +01:00
Gary Verhaegen
acbc5de820 remove some build warnings (#2012) 2019-07-04 22:07:49 +00:00
Brian Healey
ecbe0b15b5 resolve daml warnings for language-support (#1995)
* resolve daml warnings for language-support

* resolve warnings for generated very large archive daml
2019-07-03 17:48:42 +00:00
nickchapman-da
f3ae835d30
Hlb optional offset in command completion (#1989)
* dont drop error info when not StatusOk

* CommandCompletionService supports optional offset; adapt tests
2019-07-03 14:32:46 +01:00
Stefano Baghino
4774e75eb8 The completion stream RPC defaults to the ledger end as offset (#1961)
* The completion stream RPC defaults to the ledger end as offset

Fixes #1913

Relevant changes are propagated to the Java bindings (including
deprecating a method that would now return a nullable ledger end).

* Refactor completionStream method

* Address review comments

- ignore command creation results
(https://github.com/digital-asset/daml/pull/1961#discussion_r299089539)
- avoid re-connecting to the client for every command
(https://github.com/digital-asset/daml/pull/1961#discussion_r299092328)
- move offset field optionality to domain object
(https://github.com/digital-asset/daml/pull/1961#discussion_r299090451)

* Improve tests
2019-07-02 10:02:43 +00:00
Gabor Aranyossy
709112e92b fixing issue of returning inclusive ledger offsets with completions (#1932)
* fixing issue of returning inclusive ledger offsets with completions

* changelog update

* removed TODO

* fixing haskell tests
2019-07-01 07:45:26 +00:00
Stefano Baghino
3dc0c02766
Add contract key support to Scala bindings and navigator (#1950)
* Expose the contract key in the Scala bindings

* Expose contract keys on the navigator

* Update release notes

* Remove ui-backend.conf file from navigator scenario

Addresses https://github.com/digital-asset/daml/pull/1950#discussion_r298814223

* Fix broken docstring reference to DamlLfDefRef

Addresses https://github.com/digital-asset/daml/pull/1950#discussion_r298814301
2019-06-30 20:57:55 +02:00
Michał Majcherski
2afefb7883
windows: root build (#1894)
* windows: root build

* windows: fixed haskell bindings tests

* windows: disable client_server_test test

* windows: marking daml_test flaky due to #1907

* windows: removing da-hs-damlc-app run from build.ps1

* windows: disable hie-core alias of currently disabled target
2019-06-28 12:55:31 +02:00
Stefano Baghino
2f319315a9 Mark Haskell bindings tests as flaky until #1927 is fixed (#1928) 2019-06-28 08:37:06 +00:00
nickchapman-da
0473734359
Hlb wrap more services (#1904)
* support: CommandCompletionService.completionEnd

* support checkpoints from: CommandCompletionService.completionStream

* address review comments

* add type for LedgerOffset; prefer AbsOffset when known

* extend submit/complete testcase
2019-06-27 15:30:47 +01:00
Remy
6cd3f93d2e scala-codegen: add support for enum type (#1833)
* scala-codege: add support for enum type

* formatting

* first part of Stephen comments

* Address Stephen's comments
2019-06-26 17:50:37 +00:00
Stefano Baghino
f8bebffb4e Expose signatories and observers throughout the platform (#1814)
* Add signatories and observers to Ledger API

Cascade fixes deriving from compilation and test errors.

* Add signatories and observers to Java bindings and codegen

* Add signatories and observers to Scala bindings and codegen

* Add signatories and observers to navigator

* Add signatories and observers to the Haskell bindings

* Add integration test

* Comply with formatting standard

* Add release notes

* Apply edits from CI feedback and self-review

* Fix wrong input on test case for observers sorting

Co-Authored-By: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* Read JSON as strings from DB, parse them as parties

Address https://github.com/digital-asset/daml/pull/1814#discussion_r296405252

* Change parties rendering and observer display condition

Address https://github.com/digital-asset/daml/pull/1814#discussion_r296390104

* Fix sorting tests, implement sorting by agreement

Address https://github.com/digital-asset/daml/pull/1814#discussion_r296397390

FIXME notes have been added for suspicious test cases

* Prevent any mutation of CreatedEvent arguments

Address https://github.com/digital-asset/daml/pull/1814#discussion_r296572639

* Comply with formatting standard

* Stakeholders are filtered up to the witnesses

Addresses https://github.com/digital-asset/daml/pull/1814#discussion_r297102521
2019-06-26 14:02:59 +00:00
Remy
41574d33f7 java-codegen: Add support for enum types (#1648)
* java-codegen: add support for Enum

* Address Stefano's comment
2019-06-26 11:50:25 +00:00
nickchapman-da
eba9af48ac
Hlb review comments (#1881)
* Define LedgerService using ReaderT to avoid boilerplate
* re-export TimeoutSeconds from GRPC.HighLevel.Client, instead of defining as a newtype
* rename: Valuable -> IsLedgerValue
2019-06-26 11:02:12 +01:00
nickchapman-da
4432a79407
refactor (#1865) 2019-06-26 08:09:08 +01:00
Gerolf Seitz
b0a465784e
Add grpc-netty as dep for bindings-java. publish daml-lf-archive (#1798)
We add a dependency in bindings-java to grpc-netty, so it is
automatically available in the classpath for users. Otherwise they get
an error like [0] if they don't add it explicitly.

We also publish daml-lf-archive-java to maven central.

[0] io.grpc.ManagedChannelProvider$ProviderNotFoundException: No
functional channel service provider found. Try adding a dependency
on the grpc-okhttp, grpc-netty, or grpc-netty-shaded artifact
2019-06-24 08:16:31 +02:00
Moritz Kiefer
c5cce0b22c [hs-ledger-bindings tests] Read the main dalf from the DAR manifest (#1803)
Previously, we got the package id by listing all packages and taking
the first. That is not a valid assumption and broke with a PR. This PR
changes the tests to use the DAR reader that we already used for
visualization (now factored into a separate library) and reads the
main dalf using that.
2019-06-21 15:32:40 +00:00
Robert Autenrieth
c14b909c71 Implement package management API in the sandbox (#1610)
* store archive size in `DarReader`

* rename `SandboxTemplateStore` to `SandboxPackageStore`

* store package info in `SandboxPackageStore`

* introduce package upload / read to write / index services

not tested yet, just a ton of plumbing

* WIP test the package service

* Fix build errors after rebase

* Move packages service to v2

* Ledger API client uses ledger API types

* Fix ReflectionIT

* Correctly handle uploading invalid dar files

* Fix reading DAR entry file sizes

* Improve package management IT

* Improve handling of duplicate packages

* Fix language-support build

* Use unique party and command names

* Rename lfpackage to language

* Rename SandboxPackageStore to InMemoryPackageStore

* Remove getCurrentTime ledger method

* Improve package management IT

* Move InMemoryActiveContracts and InMemoryPackageStore

* Use case object for UploadDarResult.Ok

* Address review comments

* Update release notes

Fixes #1311

* Use BazelRunfiles in test
2019-06-19 12:31:53 +00:00
Stefano Baghino
656e456b78 Add ExerciseByKey command to Ledger API (#1724)
Fixes #1366

Also adds support for the new command to the Java bindings and codegen
2019-06-19 09:11:52 +00:00
Stefano Baghino
02e950394d Support generic types as contract keys in codegen (#1743)
Fixes #1728
2019-06-18 14:54:23 +00:00
Nick Smith
0c0e4231f3
Fixes #1204: Release bindings and codegens to Maven Central. (#1205)
* Fixes #1204: Release bindings and codegens to Maven Central.

Upload the Java and Scala Bindings with the respective code
generator binaries to Sonatype Open Source Repository
Host for synchronization with Maven Central.
2019-06-17 15:37:49 +02:00
nickchapman-da
8cd1bc738c
GroupChat, take 2 (#1671)
* GroupChat, take 2
* GroupChat, last member may leave
* Add origin field into Group to support the group identity
2019-06-17 10:01:25 +01:00
nickchapman-da
fab80b7813
remove duplicate grpc example (#1679) 2019-06-17 09:56:03 +01:00
Stefano Baghino
ee3dae56e2
Add contract key support for created events to Haskell bindings (#1689)
Fixes #1688
2019-06-17 10:52:31 +02:00
Stefano Baghino
6ba26f4e1f Add contract keys to created events in the Ledger API (#1586)
* Add contract keys to created events in the Ledger API

Fixes #1268

* Update ledger/ledger-api-integration-tests/src/test/itsuite/scala/com/digitalasset/platform/tests/integration/ledger/api/TransactionServiceIT.scala

Co-Authored-By: Stephen Compall <scompall@nocandysw.com>

* Update language-support/java/bindings-rxjava/src/test/scala/com/daml/ledger/rxjava/grpc/helpers/TransactionGenerator.scala

Co-Authored-By: Stephen Compall <scompall@nocandysw.com>

* Update ledger/ledger-api-integration-tests/src/test/itsuite/scala/com/digitalasset/platform/tests/integration/ledger/api/TransactionServiceIT.scala

Co-Authored-By: Stephen Compall <scompall@nocandysw.com>

* Add run suffix to transaction service integration tests

Addresses https://github.com/digital-asset/daml/pull/1586#discussion_r293233810
Addresses https://github.com/digital-asset/daml/pull/1586#discussion_r293233886

* Re-introduce unused bindings

Addresses https://github.com/digital-asset/daml/pull/1586#discussion_r293056685
Addresses https://github.com/digital-asset/daml/pull/1586#discussion_r293056741

* Update ledger/ledger-api-common/src/main/scala/com/digitalasset/platform/participant/util/LfEngineToApi.scala

Co-Authored-By: Stephen Compall <scompall@nocandysw.com>

* Use newly introduce assertOrRuntimeEx method

Applies the suggestion introduced by 7cc5c3eb71

* Contract keys to be typed after generated types

Also adds support in daml-lf/interface for contract keys

Addresses https://github.com/digital-asset/daml/pull/1586#pullrequestreview-249431707

* Address https://github.com/digital-asset/daml/pull/1586#discussion_r293773427

* Fix compilation error from previous commit

* Fix compilation errors in navigator
2019-06-14 16:45:12 +00:00
nickchapman-da
106e90e8a6
Group chat daml model (#1618)
Nim:
* fix index numbering in demo.md
* add in game "help" command to show available commands
* small code simplification for code review

GroupChat:
* DAML chat-room model, with support for multiple chat-groups with entry by invitation
* simplify: pass Invitation
* fix bug spotted by Bernhard -- Gain access to a Group without a valid invite
2019-06-13 11:06:49 +01:00
Remy
0591075187 cleanup daml-lf scala packages (#1581)
* cleanup daml-lf scala packages

* Address Stephen's Comments

* update maven coordinates of language package
2019-06-12 15:55:48 +00:00
Leonid Shlyapnikov
3eab89e6c6
Custom bindings doc + iou-no-codegen scala example (#1569)
* Custom bindings doc + iou-no-codegen scala example

* Fixing formatting

* Review suggestion

Co-Authored-By: Stephen Compall <scompall@nocandysw.com>

* Adding bazel build for `language-support/scala/examples/iou-no-codegen`

* Review suggestions

* Final touches + addressing review comments

* Adding notes about codegen alternatives

* Removing detectedOs lazy val
2019-06-12 09:26:54 -04:00
Nick Smith
7575f8cb0e
Buildsystem scala sources improvements (#1602)
* Fixes #1600. Improve Bazel Scala source JAR generation.

Include sources from JAR files defined as 'sources' to a Bazel Scala
target. The improvement will allow inclusion of generated source targets
in sources JARs of dependencies.

* Use temporary directory in the dar_to_scala() rule.

Place the output of the Scala code generator in a temporary
directory instead of a directory at the 'primary' output path as Bazel
rules should never have directory dependencies.
2019-06-12 14:45:54 +02:00
Jost Berthold
b0b3e29c49
language-support/scala: add support for specifying dependency roots explicitly (#1210)
* language-support/scala: add support for specifying roots explicitly

By default, code-gen will use all templates in the given package as roots, and
generate code for all types used. This patch adds the ability to specify roots
explicitly via a set of regex.es to match the (fully qualified) template names.

This is an experiment, tests and UI need to be adjusted later.

* scala codegen rootfilter: move filtering to envIFace handling

* doc for --root option

* scalafmt

* test filterTemplatesBy

* release note for --root Scala codegen option
2019-06-12 11:10:23 +10:00
Stephen Compall
cc21c78be2
Scala ecosystem: discourage Identifier name in scala primitive (#1570)
* Primitive.LegacyTemplateId replaces 2-tuple TemplateId.unapply; 3-tuple variant introduced

* ensure the suggested replacements are well-typed and behaved

* suggest LegacyTemplateId for 2-valued form
2019-06-11 17:31:28 -04:00
Leonid Shlyapnikov
8ed703e14d Removing damlc dependency (#1588)
quickstart-scala example does not buld DAR from SBT
2019-06-11 18:17:51 +00:00
Beth Aitman
e6c1d1e414 Suggestions for demo instructions (#1580) 2019-06-11 11:25:27 +01:00
nickchapman-da
19449affb5
Ledger App Demos (#1572)
* chat ledger-app, first cut

* pre-demo improvements to nim-console

* Valuable instance for Text

* nim-console/demo.md
2019-06-10 15:08:57 +01:00
Michał Majcherski
9b5f152f18
windows: better language-support build / test coverage (#1548) 2019-06-07 17:29:07 +02:00
Michał Majcherski
90c854f3bf
windows: language-support java codegen tests (#1542) 2019-06-06 16:19:39 +02:00
Martin Huschenbett
5396f42b3a
Drop support for DAML-LF 1.3 from damlc (#1445)
* Drop support for DAML-LF 1.3 from damlc

This means `damlc` now only supports versions allowing arbitrary expressions
as contract keys. This is very helpful for the upcoming new template
de/re-sugaring underpinning generic templates.

* Unpin a few DAML-LF target versions in tests

* Fix golden tests

* Adapt changelog to rebase

* Rename DAML-LF scenario tests to 1.dev

* Update tests to --target 1.dev

* Fix release notes
2019-06-03 14:00:25 -04:00
nickchapman-da
47e6d9ab05
Haskell ledger bindings (#1460)
* use with syntax in Daml

* attend to code review comments

* move ledger services implementation to own sub-module

* use ledger reset service when running tests for haskell-ledger-bindings

* expose LL.ClientCall in high level interface

* cancel streaming gRPC calls when attached stream is closed

* fix modification to gRPC-haskell so existing interface in preserved

* ClientCall and clientCallcancel were already available on HighLevel interface
2019-05-30 15:00:42 +01:00
Remy
f84e7d79d2 Add enum type to daml-lf (#1397)
* add enum type to daml-lf dev

* Address Francesco's comments

* Address Martin's comments

* fix daml-lf proto version history
2019-05-29 12:15:01 +00:00
Gerolf Seitz
82f81a7588 Test codegen against the latest DAML-LF version (#1446)
I'm refurbishing the DAML-LF 1.3 specific tests to run against the
latest DAML-LF version (by removing the explicit target version in the
daml_compile target).
Going forward we only "reify" specific DAML LF versions when breaking
changes or new features are introduced, and we need to test the old
behavior specifically (just like we did for DAML LF 1.0 and 1.1).
2019-05-29 11:30:38 +00:00
Martin Huschenbett
6cb8c3bc94
Add back the Java codegen integration tests for DAML-LF 1.0 (#1418)
I accidentally deleted them at some point and nobody noticed.
2019-05-28 12:36:03 +02:00
Martin Huschenbett
34d436d77d Drop support for DAML-LF 1.1 from damlc (#1231)
* Drop support for DAML-LF 1.1 from damlc

Part of #853.

* Fix docs test

* Add show party test back

* Update release notes

* Remove target version from Java codegen test
2019-05-27 16:07:35 +00:00
Gabor Aranyossy
be0a8110a9
using LedgerId domain type (#1403)
* getting a compiler SOE

* /ledger/... compiles

* all compiles

* fmt
2019-05-27 17:01:17 +02:00
Martin Huschenbett
a25a641c35
Check in DAR file for Java codegen test against DAML-LF 1.1 (#1406)
This is a prerequisite for dropping DAML-LF 1.1 support from the compiler.
2019-05-27 16:33:31 +02:00
Nick Smith
54cfc6d316
Fixes #1340 - Add Scaladocs generation to the Bazel rules. (#1341)
* Fixes #1340 - Add Scaladocs generation to the Bazel rules.
2019-05-27 12:59:19 +02:00
Stephen Compall
aa6bbe8de6 compile Scala codegen output removing ContractId tparam constraints (#1350)
* ValuePrimitiveEncoding.Mapped, mixin for the "axiom" parts of mapped and xmapped

* remove ValuePrimitiveEncoding.mapped

- it was okay with 1 inductive case, but now there will be 4, so just
  mixin Mapped instead

* mark members of ValuePrimitiveEncoding.Mapped final

- mixins are easier to get right if you mark everything final

* add Maps to random tests

* replace <: Template[A] with : TC in ValuePrimitiveEncoding#valueContractId

- no current subclass uses this context bound, but it may be useful for
  encodings that wish to make ContractId encodings dependent on the type
  parameter

* replace : TC with no bound in ValuePrimitiveEncoding#valueContractId

- fixes #1325
- can reintroduce : TC with #822

* stub test for generating with #1315's liberated contract IDs

- commented out because we still want to test codegen with stable LF
  only

* undo useless changes

* ContractId#apply is unbounded
2019-05-24 18:01:32 +00:00
Gabor Aranyossy
ff088efd94
porting API services to used Index Service v2 (#1362)
* moving to index service v2

* damlonx does not depend on v2 index service anymore

* leger -> ledger

* transacion id fix
2019-05-24 19:18:51 +02:00
Remy
294abecf5d daml-lf remove LedgerIdString (#1376) 2019-05-24 12:08:28 +00:00
Remy
4f18b1afa7 DAML-LF internal type safety (#1192)
* Rename Value's ContractId to VContractId

* daml-lf: a bit more about PartyId

* daml-lf: Concatenable MatchingStringModule

* daml-lf make clear type used for Scenarios only

* daml-lf create ContractId, LedgerId, TransactionId

* sandbox-sql conversion util

* LedgerName -> LedgerString

* futher type cleanup in the sandbox

* daml-lf add test for LedgerString

* fixing tests

* a bit more safety in the DB

* Address Stephen's comments

* fix rebase

* More fixes for StringModule

* change length of LedgerString (256 -> 255)
2019-05-24 09:53:29 +00:00
nickchapman-da
7ee7931407
nim-console Ledger App (#1342)
* Use closable Stream in Haskell ledger bindings

* move PastAndFuture abstraction into ledger interface code

* distinguish past/future transactions in return of Ledger.getTransactionsPF

* first cut: nim-console running against a ledger

* remove flaky failing test
2019-05-23 15:56:12 +01:00
Leonid Shlyapnikov
67da43cff5
Document the meaning of Option in Contract#agreementText (#1319)
* Documenting `agreementText`

* Code review suggestion

Co-Authored-By: Francesco Mazzoli <f@mazzo.li>
2019-05-23 08:00:42 -04:00
gaborh-da
4259ad28bc Expose a testable ledger view (#1236) 2019-05-21 12:29:07 +02:00
Leonid Shlyapnikov
4c6ea2875d Add test cases to validate the received agreement text, #1159 (#1259) 2019-05-21 08:09:20 +00:00
Leonid Shlyapnikov
3d91ac6734 Compile codegen-sbt-example as part of the bazel build, #1254 (#1261)
Fix codegen-sbt-example compilation, sandbox API changed.
2019-05-21 07:13:03 +00:00
Leonid Shlyapnikov
f31980c18f Add Scala codegen bazel rule: dar_to_scala (#1202)
* Removing unused/broken daml.bzl rules, adding Scala codegen rule

Scala codegen rule: dar_to_scala follows the same approach
as dar_to_java with a few differences:
- dar_to_scala supports multiple dars as an input
- dar_to_scala does not try to compile the generated scala (separation
  of responsibilities)

* Using dar_to_scala to compile quickstart-scala example

* Fixing formatting

* Add dependency to examples-quickstart-scala-bin

So if example does not compile, it can't be published.

* Fixing the path to the jar executable

* Changing scala codegen rule to rely on zipper instead of jar

JDK's jar creates srcjar with timestamped files, zipper doesn't
timestamp files. This means we can create reproducible/deterministic/
cacheable srcjars

* Addressing code review comments, wrong var name
2019-05-20 14:13:30 +00:00
Stephen Compall
53058001e6 add createAnd syntax to prepare CreateAndExercise commands from Scala codegen contracts (#1197)
* add createAnd syntax to prepare CreateAndExercise commands from Scala codegen contracts

* open-style ExerciseOn typeclass

* GADT-style ExerciseOn works perfectly well, so let's go with that instead

* testing implicit conversion + ExerciseOn TC lookup

* use scalatest-style typesafe === to avoid Anys

* many more ExerciseOn tests

* support ExerciseOn polymorphism in Primitive.exercise

* generate ExerciseOn references in Scala codegen, permitting `createAnd` to combine with exercise* methods

* refactor testCreateContractAndReceiveEvent to support other commands

* compare create and createAnd's command generation behavior in a simple test

* bazel style

* test CreateAndExercise from Scala codegen against sandbox

* release note for Scala codegen create-and-exercise support
2019-05-20 07:43:08 +00:00
Gerolf Seitz
c645348ca1
Expose a contract's agreement text on the Ledger API (#1151)
* Added agreement_text field to the CreatedEvent in Ledger API.
* Changed java bindings + java codegen
* Changed utilities for scala codegen
* Made necessary changes in Sandbox to propagate the agreement text from ContractInst to the CreatedEvent
* Made changes to the navigator to show the agreement text in the contract details page when it is set and not empty

Fixes #1110
2019-05-17 11:22:05 +02:00
Gabor Aranyossy
f48b7c764e introducing WriteService in Sandbox (#1193)
* introdocing WriteService in Sandbox

* changing submit to return java CompletableStage

* introduced TimeModelChecker interface

* removing whitespaces

* doc updates

* dependency order fix
2019-05-17 08:59:19 +00:00
Leonid Shlyapnikov
b5dec5aa3b Remove //language-support/scala/sandbox-control and references, #950 (#1203)
the class referring to sandbox-control has not been used itself.
2019-05-17 07:27:11 +00:00
Andreas Herrmann
a6809310e8
Update to Bazel 0.24 (#567)
* bazel: 0.23.1 -> 0.24

* bazel-deps: Fix for Bazel 0.24.0

* bazel no longer supports + on dicts

Replace by dict.update.

* Fix junit classpath issue

* azure: Update MacOS image to Mojave

* Windows: --noincompatible_windows_escape_jvm_flags

* rules_scala: Support escape_jvmflags

* rules_scala: separate jvm_flags by TAB

* Document --noincompatible_windows_escape_jvm_flags
2019-05-16 18:04:30 +02:00
nickchapman-da
8510e6afc5
Haskell ledger bindings (#1181)
* Bindings & tests for more ledger services

* fix hardcoded package id in test

* language-support/hs/bindings/examples/nim-console

* make hlint happy

* headers & format

* README

* increase timeouts; track location of GPRC Deadline Exceeded.

* Update language-support/hs/bindings/examples/nim-console/README.md

Co-Authored-By: Neil Mitchell <35463327+neil-da@users.noreply.github.com>

* rename: Mes --> Logger, mes --> log, tagMes --> tagLog (etc)

* replace isOpen with ==Open

* Avoid fragile hardcoded PackageId in testcase
2019-05-16 16:45:54 +01:00
Leonid Shlyapnikov
b57246642c
Build quickstart-scala as part of the bazel build cycle, #675 (#1138)
Set up exports instead of loading `variables.bzl` with transitive deps
2019-05-16 10:21:52 -04:00
Gabor Aranyossy
e70cbfe65c eliminating some mutable state (#1130)
* no var no problem

further refactor

introduced InfraState

a bit less vars

encapsulating closes

SandboxServer starts automatically

rebase fixup

collecting state into a single object

some cleanup

removing exposed materializer

LedgerBackend is closed in SandboxServer

changed ownership of Ledger

fixing perf tests

fixing some compile errors

formatting

removing unused method

fixing integration test to use correct dar file

fixing issue with PostgresFixture and SandboxResource

Fix integration tests on Windows

* fixing rebase artifacts
2019-05-16 08:52:14 +00:00
Leonid Shlyapnikov
3cb958f656 Changes recommended by @jost.berthold (#1168) 2019-05-15 22:59:18 +00:00
gleber
3eb6f83b3a
ledger-api-intgration-tests: Cleanup ledger ID handling. (#1129)
* ledger-api-intgration-tests: Cleanup ledger ID handling.

This changes nothing in the logic of tests. It is a preparation for moving of
most of the tests to use Dynamic ledger ID mode for tests, which is a
preparation for running these tests against remote Ledger API endpoints.

* sandbox: Rework LedgerIdMode and move it up into common.
2019-05-15 17:05:16 +02:00
Leonid Shlyapnikov
90c2a11c30
Scala ecosystem SDK doc (#1025)
* Scala ecosystem SDK doc (#675)

* Improving quickstart-scala error handling, #675
2019-05-15 10:09:33 -04:00
Gerolf Seitz
a5cf706040 Less logging in tests (#1145)
* Less DEBUG logging in java codegen tests

* Add logback-test.xml for ledger/sandbox tests
2019-05-15 08:58:08 +00:00
Nick Smith
6f6f3337c7
Fixes 895: Improve DA Bazel rules for building javadocs. (#896)
* Fixes 895: Improve DA Bazel rules for building javadocs.

Extend the da_java_library Bazel macro to also build the Javadoc for the
target. Add the Javadoc artefacts to the release procedure.
2019-05-14 09:40:30 +02:00
Neil Mitchell
ed431b4717
Move Tuple and Either types to DA.Types (#1099)
* Add a helper function to qualify things with respect to a module

* Supress some warnings I saw when building

* Move Tuple* and Either to daml-prim:DA.Types, so they have a nice name for Java users (instead of GHC.Tuple or DA.Internal.Prelude)

* Add copyright header

* Update daml-foundations/daml-ghc/daml-prim-src/DA/Types.daml

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update daml-foundations/daml-ghc/daml-prim-src/DA/Types.daml

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update the daml-lf translation of tuple types

* Fix up the scala bindings for how to use types

* Clarify what action people need to take following the release notes

* Fix an expected test

* Clarify the changelogs even more

* Run ScalaFmt

* Clean up the release notes a bit

* Use the changelog from Beth

* Update the release notes again

* Update docs/source/support/release-notes.rst

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix up the scenario error messages
2019-05-13 16:36:21 +01:00
Gerolf Seitz
17df4e78e1
Java Codegen: generate methods for CreateAndExerciseCommand (#1107)
The Java Codegen now generates methods for creating a
CreateAndExerciseCommand for a particular choice given a template.

Contributes to #1092.
2019-05-13 16:11:10 +02:00
Gerolf Seitz
8158269b7d
Remove ExercisedEvent in Event oneof. (#1067)
* Remove ExercisedEvent in Event oneof.

The Event message is only used in the Transaction message. Flat
transactions do not contain exercised events, but only created and
archived events. Therefore we can remove the ExercisedEvent from the
Event oneof, without breaking transport compatibility.

HOWEVER: The Java Bindings used to use the data.Event class for both flat
transactions and transaction trees. To properly represent the actual
event types in the two transaction structures,
1) Event is now and interface and is only used in the Transaction class.
2) there is a new interface TreeEvent, which is used in the TransactionTree class.

* CreatedEvent implements Event and TreeEvent
* ExercisedEvent implements TreeEvent
* ArchivedEvent implements Event

Some "pathological" cases where an occurrence of an exercised event
would have resulted only in an exception, are now removed (see change in
LedgerApiV1.scala).

Fixes #960.
2019-05-13 14:36:13 +02:00
Remy
2e3a87934b Daml lf type safty (ChoiceName, VarName, FieldName, ConstructorName) (#983)
* daml-lf: make DefinitionRef more typesafe

* daml-lf: Identifier -> DefinitionRef

* daml-lf: remove unsafe apply and copy methods from DottedName

* daml-lf: create identifier

* daml-lf: make ChoiceNames Identifiers

* daml-lf: cleanup TVar

* daml-lf: FieldNames & VariantConstructors -> Identifiers

* bazel fmt

* daml-lf: VarName -> Identifier

* daml-lf: drop return inside Ref.scala

* daml-lf Identifier -> Name

* daml-lf DefinitionRef -> Identifier

* daml-lf make iface more type safe
+ address Francesco's comments

* daml-lf: remove unsafe unapply from MatchingStringModule

* fix navigator

* Address Stephen's Comments
2019-05-13 11:17:12 +00:00
nickchapman-da
c1de0abcd6 haskell-ledger-bindings, test connect against sandbox (#1023)
* haskell-ledger-bindings, test connect with sandbox

* use System.Time.Extra.timeout instead of rolling own

* fix module name to match hierachical path

* increase timeout to 10s, fix macOS CI?

* delete-trailing-whitespace

* dont specify daml version for daml_compile rule

* unalign module imports

* replace xxx with undefined
2019-05-09 17:31:06 +00:00
Michał Majcherski
9610d74b50
windows: back to official rules_scala repo (#1040) 2019-05-09 13:53:47 +02:00
Moritz Kiefer
90550cc801
Remove broken timestamp test (#1026)
This test only worked by chance since in older JDK versions
java.time.Instant.now() didn’t have nanoseconds precision. As
evidenced by the test after this, nanoseconds are lost during a
roundtrip so this test breaks on newer JDK versions that increased the
precision. See https://bugs.openjdk.java.net/browse/JDK-8068730 for
more information.
2019-05-09 11:17:46 +02:00
Leonid Shlyapnikov
0ca414f09c
quickstart-scala daml assistant template cleanup (#614) (#1007) 2019-05-08 11:18:22 -04:00
Leonid Shlyapnikov
6cc9e685e5 Add quickstart-scala template to DAML Assistant (#991)
* Add quickstart-scala template to DAML Assistant , #614

Removing the rule to create a quickstart-scala.tar.gz, it is not needed

* Return non-zero error code if failures detected, #614

* Reading project name from `daml.yaml`, #614

Removing Versions.scala.template
2019-05-08 06:57:15 +00:00
Leonid Shlyapnikov
8534e2837f
quickstart-scala DAML Assistant template (#745)
* Add quickstart-scala IOU example, DAML Assistant template, #614

* Move all scala examples under language-support/scala/examples

* Removing target dirs which don't get excluded by the glob, #614
2019-05-07 11:41:29 -04:00
Gerolf Seitz
bac5c4a6f4 Java Bindings: Properly convert CreateAndExerciseCommand (#982)
The conversion of the CreateAndExerciseCommand in the Command base class
was missing. This also adds a missing test for that.

Fixes #979.
2019-05-07 17:04:48 +02:00
Gerolf Seitz
6ac1e5cf28
Java Codegen: Removing some dead/unused code (#971) 2019-05-07 14:59:20 +02:00
Gerolf Seitz
2c04e1fd6d
Java Codegen: Generate types with multiple name components (#946)
If a variant itself is not serializable, but the synthesized record for
one of its constructors is, then said record is returned by the
interface reader in the set of type declarations, when the variant type
itself is not.
When constructing the InterfaceTree in preparation of the codegen, we
previously rejected such a situation.

We now generate Java code for such a synthesized record, as it is a more
generally correct way of interpreting DAML LF (i.e. the DAML compiler
could decide tomorrow to create such multi-component record names for
regular records).

In any case, we consider this to be an edge case, as the synthesized
record for the variant constructor cannot be used directly either from
DAML or the Ledger API.
2019-05-07 11:12:42 +02:00
Remy
0489c6e0a5
Daml lf type safty (Party & PackageId) (#761)
* daml-lf: split SimpleString into Party and PackageId

* daml-lf remove parameter from DefinitionRef
2019-05-06 20:40:43 +02:00
Martin Huschenbett
1af740ced8 Remove a useless dependency on daml-prim from a sandbox-control test (#948) 2019-05-06 18:57:25 +02:00
Nick Smith
d725d50be9 add result of exercise to transaction -- fixes #479 (#583)
Modify the DAML Engine, Ledger API and Sandbox to pass the result of the
exercise as a field of the transactions.
2019-05-06 14:33:44 +02:00
Gerolf Seitz
b38ac29532
Attempt at fixing flaky CodegenLedgerTest (#929)
* Increase call timeout to 40 seconds
* Run test exclusively
* Add logback-test.xml and set level to DEBUG

Contributes to #808.
2019-05-06 12:48:20 +02:00
Martin Huschenbett
f098b0e4be
Remove a deprecated package database build rule (#913)
The rule was used in only in one place and that place can be updated
to a newer rule.
2019-05-04 15:32:05 +02:00
Gerolf Seitz
ecf6ece8c4
CommandService returns useful data for successful submissions (#875)
Submitting a command via the CommandService now returns either the
transaction id (SubmitAndWaitForTransactionId), the flat transaction
(SubmitAndWaitForTransactionResponse), or the transaction tree
(SubmitAndWaitForTransactionTreeResponse).

This means that users don't have to wade through the transaction stream
to retrieve the resulting transaction. This is particularly useful in
combination with #479.

Fixes #406
2019-05-03 16:01:41 +02:00
nickchapman-da
549cf086e1 Haskell ledger bindings (#879)
* HL types for Ledger API. Command Submission & Completion services.

* whitespace

* remove renamed file that came back after bad merge

* delint

* adapt to change in transaction_service.proto
2019-05-03 10:37:08 +00:00
Gerolf Seitz
f4d8e134e3
Add TransactionService methods for looking up flat transactions (#830)
This change is needed in preparation of #406, where we want to return a
transaction tree and flat transaction after a SubmitAndWaitForTransaction(Tree).
2019-05-03 09:03:12 +02: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
nickchapman-da
15ea5ef8b4 haskell-ledger-bindings: TransactionService, GetTransactions (#816)
* haskell-ledger-bindings: TransactionService, GetTransactions

* passify linter

* passify humans linters!

* format!
2019-05-01 14:29:23 +00:00
Stephen Compall
157fab963b
daml-lf: move EnvironmentInterface from Scala codegen to interface library (#781)
Also move Interface and InterfaceType out of the reader subpackage; they
belong with the rest of the data model at the iface root.

The specific mechanics of reading a Dar all the way to producing an
EnvironmentInterface are left to Scala codegen's Codegen and Java
codegen's CodeGenRunner; there's no consensus or great stability on the
best way to tie these pieces together, but all the pieces might as well
be available in the interface library at least.

Inspired by a query on Slack by @leonelag regarding reading the
codegen-relevant parts of dalfs and dars; thanks!

* daml-lf: move EnvironmentInterface to interface library from Scala codegen

* daml-lf: move Interface out of reader subpackage

* language-support/java: deal with moving Interface out of reader subpackage

* document Interface and EnvironmentInterface

* missed copyright header in reader package.scala

* extractor: deal with moving Interface out of reader subpackage

* navigator: deal with moving Interface out of reader subpackage
2019-04-29 17:01:01 -04:00
nickchapman-da
b2e8df5c6a haskell-ledger-bindings, LedgerIdentity (#755)
* haskell-ledger-bindings, LedgerIdentity

* copyright headers

* address review comments

* format

* fix haskell indentation
2019-04-29 14:02:25 +00:00
Stephen Compall
0ba1e5b386 increase ledger-api IT timeout; daml-lf, language-support/scala: remove long-deprecated symbols (#741)
* remove long-deprecated symbols from daml-lf and language-support scala libraries

* remove useless usage of 2-parameter TemplateId constructor

* grow ledger-api-integration-tests to account for usual 300s-ish runtime

* buildifier
2019-04-26 21:05:26 +00: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
nickchapman-da
43abaee299
example of using haskell-grpc (#700)
example of using haskell-grpc
2019-04-25 18:23:32 +01:00
Francesco Mazzoli
14f6728219
parametrize iface types only by type... (#678)
...rather than by "field with type". in preparation to enums (#105)
2019-04-25 17:25:23 +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
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
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
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
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
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
Remy
e6dbb07921
language-support: fix ScalaCodeGenIT test (#425) 2019-04-16 19:03:15 +02:00
Leonid Shlyapnikov
d0d691765b
Remove compiler option that turned off fatal-warnings (#549)
* Remove compiler option that turned off fatal-warnings

The deprecated calls have been already addressed by someone
else.

* Remove `-deprecation` it is enforced throught common_scalacopts
2019-04-16 12:27:39 -04: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
Leonid Shlyapnikov
bdb5160403
Multiple fat DARs scala/codegen support, #109 (#366)
Add Dar Traverse and Equal, replace manually written test cases with
scalaz law checks;
Add test case for multiple DARs support;
Enforcing non empty list of input files
2019-04-15 17:12:07 -04:00
moritzkiefer-da
ec46b8cec5 Add codegen to integration tests (#494) 2019-04-15 17:53:05 +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
moritzkiefer-da
fa4067ad1b
Move POM file generation to Bazel rules (#374)
* Move POM file generation to Bazel rules
2019-04-11 11:24:52 +02:00
Remy
07858455c1
Fix DAML runtime for the new DAML-LF type Map (#204)
* add a test for daml-lf/interface
* fix scala code gen
* fix extractor
* fix navigator backend/frontend
* key of Map are strings in proto/json
2019-04-10 21:30:33 +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
Stefano Baghino
7467925aa1
Fetch status.proto from remote, simplify JS gRPC codegen (#285)
* Fetch status.proto from remote, simplify JS gRPC codegen

Fetch the `status.proto` file (part of the standard gRPC distribution)
from a distribution channel. _Moreover_, use the recently introduced
`proto_gen` rule to simplify how the gRPC code for the Node.js bindings
are generated (and remove the need to have `google/rpc/status.proto`
locally in the repository.

* Add plugin_runfiles option to proto_gen

This allows use to add additional files to the bazel sandbox so that
plugins can refer to them. This will subsequently be used by the
protoc-gen-doc plugin.

Also, pass the plugin options via --name_opt parameter.

* Add missing status.proto dependency /language-support/java and /ledger

* Build proto docs using the proto_gen rule

To make this work, I had to turn on the bazel build flag
`--protocopt=--include_source_info` because we cannot turn enable this
flag only for specific build rules.

* Make /ledger-api/grpc-definitions:docs public again

* Revert to the old style of passing plugin arguments to --name_out=options:path

* Suppress output of unzipping

* Fix link for google.rpc.Status in proto-docs
2019-04-09 10:30:01 +02:00
Leonid Shlyapnikov
0aea22a507
delete scala/codegen-sql-support and all related tests (#294) 2019-04-08 12:41:09 -04:00
Nick Smith
098120e7a9
Fixes #257 java-codegen: Reorganize Java Codegen ITs (#258)
* Fixes #257 java-codegen: Reorganize Java Codegen ITs
2019-04-08 16:26:34 +02:00
Gerolf Seitz
7e1c6a3565
Use DarReader for fat-dar reading in java-codegen (#261)
Now that the DarReader supports reading fat-dars (#220), we ought to
make use of it and remove our custom code.
2019-04-08 11:46:20 +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
Robin Krom
a8b2d30b3d
Stdlib package (#229)
language: ship daml-stdlib as a package
2019-04-05 18:11:13 +02:00
Nick Smith
3183973ab9
Fixes #226 java-codegen: Exapnd List integration tests (#244) 2019-04-05 12:50:31 +02:00
Neil Mitchell
5c2680afbe
Merge pull request #234 from digital-asset/HOTFIX-remove-changelogs
Issue #233 remove changelogs
2019-04-05 10:21:13 +01: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
Stefano Baghino
da93a86104 Document IDE support for language-support/js
Closes #67
2019-04-05 14:00:33 +11:00
Brian Healey
55fb9a9baf #233 remove changelogs from bazel files 2019-04-04 16:51:56 -04:00
Brian Healey
0205a1a932 #233 remove changelogs 2019-04-04 16:08:52 -04:00
Francesco Mazzoli
9c7357c7de update all references of old repo to new repo 2019-04-04 16:20:07 +02:00
Gabor Aranyossy
ab72aab696 fixes inconsistent help about Sandbox port
changing ports to use 6865 everywhere

no need for default ports

addressing missed outdated ports

changed more ports from 7600 to 6865

dealt with more 8080s
2019-04-04 13:03:48 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00