Commit Graph

158 Commits

Author SHA1 Message Date
Remy
a156880dc2 engine: cleanup environment (#2480) 2019-08-09 19:53:40 +00:00
Remy
55c573f29d Based the interface reader on the archive decoder. (#2441)
* daml-lf: base interface reader on archive decoder

* fix call to InterfaceReader.readInterface

+ cosmetic changes

* daml-lf: decoder can process only serializable data
2019-08-09 18:15:46 +00:00
Stefano Baghino
afa4659292
New Ledger API test tool (#2282)
* New acceptance test tool prototype

* Fix transaction filter helper

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308081386

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308082432

Moreover, creates specific helpers for test DAML code.

* Move helpers from session to context

Remove a circular dependency between session and context, and limits the
usage of implicits.

* Run tests with ledgers out of process

* Prepare for drop in

* Temporary timeout increase

* Move bulk of the logic to the test runner

* Have a map of tests for CLI integration

* Timeout per-test, runner uses context, renaming

* Allow usage of time service, integrate semantic tests

* Integrate CLI SSL configuration

* Integrate failure expectation CLI option

* Integrate with failure output verbosity CLI option

* Integrate with test listing and picking CLI options

* Integrate with timeout scaling CLI option

* Integrate with command TTL CLI option

* Review CODEOWNERS

* Drop previously unimplemented CLI parameters

* Expand test todo list to encompass latest additions

* Deduplicate some testing infrastructure, swap in new test tool

* Remove unused rule

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311045444

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311051974

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311035287

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311055290

* WIP

* Make gRPC thread factory spawn non-deamon threads

* Remove debug prints, complete divulgence test (missing assertion messages)

* Try to detect assertion failure line number

* Add Sandbox binary that starts an ephemeral postgres instance

This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.

Fixes #1543

* Add Sandbox binary that starts an ephemeral postgres instance

This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.

Fixes #1543

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311400695

* Remove TlsConfiguration duplicate, move original to commons

* Make assertion more readable

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

* Fix build errors introduced in previous commit

- exclude time service tests from reference-v2
- add copyright header to TlsConfiguration

* Complete divulgence test and address review comments

Restores comments from original divulgence tests and strives to be as
close to them as possible.

- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311429169
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431156
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431913

* Delete old divulgence tests

* Restore methods to fetch contracts by template identifier

* Run conformance tests on in-memory sandbox

* Run conformance tests on the persistent sandbox

* Remove workflow identifier workaround

* New contract keys test (#2452)

* Set channel type for LedgerSession

* Add ContractKeysIT

* Run tests against reference-server v2

* Removed the old ContractKeysIT. However, ...

... I cannot remove ContractKeysChecks completely, because we have
another test path for DARs created prior to DAML-LF 1.6, which doesn't
have the submitter == maintainer restriction for contract keys.

* Use codegen instead of custom code

* Add missing copyright headers

* Drop sandbox conformance test suite (seems to not work on Windows CI)

* Make time simpler

* Test tool tests to run only semantic tests

* Make CI behave more consistently

* Add missing files to run tests on Postrgres

* Fix flaky divulgence test, introduce readable identifiers

* Increase sandbox conformance tests timeout

* Address https://github.com/digital-asset/daml/pull/2282#discussion_r312363246

* Reintroduce test resource extraction

* Read semantic tests from the classpath rather than Bazel

* Use codegen types for ContractKeys integration test

allocateParty returns Primitive.Party and create and exercise also
accept Primitive.Party. This way we don't have to keep a String and
Primitive.Party representation around.

* Bump timeout for sandbox conformance tests

* Remove dependency on Bazel runfiles
2019-08-09 17:00:37 +02:00
Stephen Compall
92f2dbf2eb
lf-value-json: don't hardcode String cids; more consistent test runtimes, with special cases called out (#2374)
* use Arbitrary for TypedValueGenerators to get existing 'sized' uses

* test Option[Option[Long]] specifically

* derive Arbitrary ValueMap solely by implicit means, for the sized

* make ApiCodecCompressed Cid-generic

* first sample JSON tests

* navigator adaptation to Cid genericity

* scalafmt

* Table-ify JSON tests

* more navigator adaptation

* adapt http-json to Cid-agnostic JSON codec

* stem the tide of namespace pollution wrought by the "mixin to import" style

* show line # of failed JSON cases

* naturally limit the nesting factor of generated types

* move SortedLookupList generation to data-scalacheck library

* more sample JSON cases from design doc

* add more parameters to ApiCodecCompressed

- AbsoluteContractId seems like it will give rise to incoherence
- and there are going to be two parameters
- so we might as well just parameterize the whole codec

* test canonical and equivalent encoded forms

* test lists

* test very very nested optionals

* many more optional-related tests
2019-08-08 09:02:05 -04:00
Remy
2d1d5fc5af daml-lf: update release notes with archive protobuf change (#2334) 2019-08-02 19:40:37 +00:00
Stephen Compall
8625d2e81b
dedupe specification of LF value, transaction versions in Scala (#2372)
* daml-lf: dedupe specification of value, transaction versions in Scala

- also test that some language Dev is in the last entry

* adapt LfVersionsSpec
2019-08-01 16:48:11 -04:00
Stephen Compall
52efc0966c
daml-lf: new data-scalacheck library for ImmArray, FrontStack, et al (#2342)
* new data-scalacheck library for ImmArray, FrontStack, et al

* add checkLaws functions as library to data-scalacheck

* make checkLaws more configurable at use points
2019-08-01 11:10:56 -04:00
Martin Huschenbett
92b8eb0eb2 Make Fran my backup for DAML-LF governance (#2363) 2019-08-01 11:09:05 -04:00
Martin Huschenbett
680b00a8fb Fix typos in DAML-LF specification (#2335) 2019-07-31 19:04:20 +00:00
Rohan Jacob-Rao
e6a4d8b251
New template desugaring (#2178)
* Update ghc-libs to use new template desugaring
* Replace old template typeclasses with generic-friendly ones
* New template desugaring doc
* Fix tests
* Fix damldoc tests regarding Archive choice
* Update visualisation code to not traverse master dictionary
* Additional class method stubs to template instance declaration for upgrades
* Increase stack limit for bond trading compilation test
* Update hlint version
2019-07-30 19:49:33 -04: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
Leonid Shlyapnikov
b940951a76
HTTP JSON API first version (#1994)
* Cleanup

* WIP

* first integration test + fixture

* minor cleanup

* Implementing ContractService.lookup

* Reverting back to endpoints.all (all2 did not work)

* Cleanup

* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT

* porting rest of navigator to LF Value ADT

* Command Service WIP

* CommandService WIP

* porting more of navigator to LF Value ADT

* last error, not first

* rename ApiValueImplicits file

* special conversion features for ImmArray and FrontStack

- just .to[ImmArray] or .to[FrontStack] any random collection

* finish porting most of navigator main code

* use numeric indices for record field name fallback when pretty-printing

* tuples are not serializable

* use numeric indices for label fallback in JSON verbose encoding

* make traverseEitherStrictly more likely to preserve the seq's class

* to shortcut for ImmArraySeq .to[ImmArraySeq]

* compiling, passing navigator backend tests

* test traverseEitherStrictly more, er, strictly

* pass scalacopts through to scaladoc

* deal with unused warning

* remove unneeded function

* simpler error reporting, more private functions in ApiCodecCompressed

* move slowApply to FrontStack, test it so it actually works

* remove unneeded toStrings; better error from impossible ValueTuple case

* scalafmt FrontStackSpec

* support alternative, label-free record JSON encoding

* Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record

* CommandService.create should be done... need to test it

* TODO added

* Cleanup

* move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package

* Using tagged TemplateId type instead of Identifier + exercise command WIP

* adapt navigator to moved pieces

* start defining scalacheck extension to ApiCodecCompressedSpec

* CommandService.exercise + introducing CommandMeta

* Adding command endpoints, can't test them yet, need lf value json formats

* fuse some list operations

- suggested by @stefanobaghino-da; thanks

* blue error message

* Minor fixes after merging librify-navigator-json-compressed, #2136

* experiment with an inductive case in TypedValueGenerators

* finish a List case for TypedValueGenerators; it's revealing

* Introducing API value to LF value converter,

CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver

* cleanup

* remove accidentally readded duplicate aliases

* start tying knots in TypedValueGenerators

* verbatim copy ApiCodecCompressedSpec to lf-value-json

* shift some tests from navigator to lf-value-json

* test Optional and Map for ApiCodecCompressed

* heavier random testing of ApiCodecCompressed

* remove unused dependencies from lf-value-json

* adding value json writer

* cleanup

* Revert "cleanup"

This reverts commit 2e4d153f

* fixing the build

* cleanup

* cleaning up imports

* JsValue to API value is done, needs a test

* cleanup

* use scalac -Ypartial-unification in http-json

* simplify some Traverse instances

* factor CreateCommand and ExerciseCommand traverse instances

* Command create integration test WIP

* Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly

* Extracting DomainJsonDecoder and DomainJsonEncoder

* LfV refactoring

* Create command serialize/deserialize test works

* cleanup

* resolving conflicts

* More json encode/decode tests

* logging

* command/create passes integration test now

* Adding readme

* grammar

* TODO added

* GetActiveContractsResponse encoding

* ideintifier conversion renaming

* PackageService resolveTemplateId returns domain.TemplateId now

* Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding

* cleaning up a bit

* daml-lf: show type in TypedValueGenerators-driven errors

* exercise command json encoding/decoding works

* command/exercise IOU_Transfer integration test passes now

* avoid filter for Gens; makes many contract ID gens not fail

* test ApiCodecCompressed against 100 random types, 20 random values each

* Updating README instructions

* improving error handling, failed futures, get logged and reported to the user now as 500

* [ROUTING DSL] Removing routing DSL, it did not work

* getting rid of HttpEntity.Strict match + cleanup

* fixing the merge conflict

* updating README

* use Show.shows instead of new Show

* List(_) isn't checked, but Seq(_) is slightly safer

* improving test assertions

* Adding /contracts/lookup implementation

* http-json: use ImmArraySeq instead of List; use toRightDisjuction

* http-json: .toList.toSet is shorter than fold

* http-json: replace .leftMap.map with .bimap

* http-json: use subst instead of reimplementing JsonFormat

* http-json: remove unused ExceptionHandler

* http-json: safer == comparison

* Adding two test cases for expected errors

* Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies

* http-json: import, not extend
2019-07-29 16:49:57 -04:00
Remy
0ffe5945b8 DAML-LF: Prepare archive proto for Numeric (#2298)
* daml-lf: prepare archive proto for Numeric

* replace DECIMAL by NUMERIC in messages and fields
* add nat kind and nat type
* add builtins CAST_NUMERIC and SHIFT_NUMERIC

* daml-lf: remove new builtins from archive proto

* daml-lf: some more doc about numeric

* daml-lf: fix spec
2019-07-29 18:33:52 +00:00
Jussi Mäki
3724a5789e
Contract keys for kvutils (#2304)
* Support for contract keys to kvutils

* Fix handling of CreateEvents with contract keys in semantic tester

* Add ContractKeysIT to tests and fix issues related to fetchByKey

* Address code review
2019-07-29 16:45:24 +02:00
Stephen Compall
5a707960d2
navigator: replace Value<->ledger-api conversion with ledger-api-common functions (#2292)
* ledger: refactor validateValue from CommandsValidator to new ValueValidator

* daml-lf: add a matchable class for leaf Values except ValueContractId

* ledger: use IdentifierResolverLike for CommandsValidator

* daml-lf: add Traverse[FrontStack]

* navigator: define readRecordArgument and readArgument in terms of ledger-api-common ValueValidator

* navigator: clean up fillInVariantTI

* navigator: replace ledger-api Value writer with LfEngineToApi from ledger-api-common

* navigator: use traverse

* navigator: remove dead sequenceMap

* navigator: adapt to new ValueValidator structure

* ledger: dealias validateValue call

* navigator: a good use case for traverseEitherStrictly
2019-07-26 14:24:34 -04: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
Stephen Compall
9367d6658f
Move navigator's ApiCodecCompressed to new lf-value-json library (#2136)
* move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package

* adapt navigator to moved pieces

* start defining scalacheck extension to ApiCodecCompressedSpec

* experiment with an inductive case in TypedValueGenerators

* finish a List case for TypedValueGenerators; it's revealing

* remove accidentally readded duplicate aliases

* start tying knots in TypedValueGenerators

* verbatim copy ApiCodecCompressedSpec to lf-value-json

* shift some tests from navigator to lf-value-json

* test Optional and Map for ApiCodecCompressed

* heavier random testing of ApiCodecCompressed

* remove unused dependencies from lf-value-json
2019-07-16 16:38:33 -04:00
Stephen Compall
1a93db264d
navigator: Use LF Value ADT in place of ApiValue ADT (#2053)
* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT

* porting rest of navigator to LF Value ADT

* porting more of navigator to LF Value ADT

* last error, not first

* rename ApiValueImplicits file

* special conversion features for ImmArray and FrontStack

- just .to[ImmArray] or .to[FrontStack] any random collection

* finish porting most of navigator main code

* use numeric indices for record field name fallback when pretty-printing

* tuples are not serializable

* use numeric indices for label fallback in JSON verbose encoding

* make traverseEitherStrictly more likely to preserve the seq's class

* to shortcut for ImmArraySeq .to[ImmArraySeq]

* compiling, passing navigator backend tests

* test traverseEitherStrictly more, er, strictly

* pass scalacopts through to scaladoc

* deal with unused warning

* remove unneeded function

* simpler error reporting, more private functions in ApiCodecCompressed

* move slowApply to FrontStack, test it so it actually works

* remove unneeded toStrings; better error from impossible ValueTuple case

* scalafmt FrontStackSpec

* support alternative, label-free record JSON encoding

* fuse some list operations

- suggested by @stefanobaghino-da; thanks

* blue error message
2019-07-16 10:53:17 -04:00
Remy
f57e437b80 daml-lf-repl: drop ad-hoc parser (#2104)
* daml-lf-repl: drop ad-hoc parser

* formatting

* Address Stefano's comment
2019-07-15 12:06:23 +00: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
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
Stephen Compall
096e4c02ef
shortcut to ImmArray#map from ImmArraySeq#map (#2076) 2019-07-10 11:54:39 -04:00
Gerolf Seitz
840ee94bf6 Improve logic for building daml-lf-archive-java (#2059)
daml-lf-archive-java is put together from the proto sources with the
compiled java classes. However, the logic that picks the java classes
was dependent on the output of $(locations :daml_lf_proto_lib_java),
because it always would pick the first item.

The new logic filters by name rather than position.

Fixes #2058.
2019-07-09 11:44:35 +00:00
Moritz Kiefer
bb3a98bf61
Move code in daml-tools outside of daml-foundations (#2033) 2019-07-08 11:40:48 +02:00
Francesco Mazzoli
ca5d045e62 check that submitter is in maintainers for lookup by key (#1967)
* check that submitter is in maintainers when looking up keys

Fixes #1866. Note that this limitation applies both for `lookupByKey`
and `fetchByKey` -- anything involving retrieving a key is affected.

* add UNTIL-LF to run tests up to a certain version of DAML-LF

* name targets for DAML tests better

* add notes about DAML-LF changes

* commit Test.daml with DAML-LF 1.5 rather than compiling it on the fly

* add scenario tests for #1866

* add warnings about future key behavior in docs

* use flag rather than version when executing
2019-07-05 09:34:26 +00:00
Gary Verhaegen
acbc5de820 remove some build warnings (#2012) 2019-07-04 22:07:49 +00:00
Francesco Mazzoli
6cc5510dae purge all Map#mapValues from daml-lf codebase (#1864)
fixes #1861.
2019-07-04 15:08:43 +00:00
Leonid Shlyapnikov
d06191e85d
Defining first endpoints for ledger-service/http-json (#1749) 2019-07-03 12:01:46 -04:00
Martin Huschenbett
3ffa2232a9 Allow shadowing of type variables in DAML and DAML-LF (#1962)
* Allow shadowing of type variables in DAML and DAML-LF

We relax the DAML-LF type checker to allow for shadowing of type variables.
This does not need big changes since the substitution we use already avoids
name capture. The test for alpha equivalence converts to de Bruijn indices
on the fly and is hence not a problem either.

We inline type synonyms during the conversion from GHC Core to DAML-LF. This
requires alpha renaming. The cheapest way to get this, is to use the unique
names of type variables instead of their surface names.

This fixes #1915.

* Fix Scala test

* Relax memory constraints for bond-trading test
2019-07-03 08:57:43 +00:00
Remy
f100750386 daml-lf: create value version 5 for enum types (#1917)
* lf-encoder: minor fix for let expression

* extractor: add test for enum types

* navigator: a small test for enum type

* daml-lf: create value version 5 for enums

* formatting

* daml-lf: fix version timeline

* extractor: fix enum support
2019-07-03 07:16:52 +00:00
Andreas Herrmann
93d8e01db2
Update rules_haskell and static GHC (#1515)
* Update rules_haskell and static GHC

Remove patches that have been upstreamed or are no longer required.
Update still required patches to match the new rules_haskell version.

Previously we patched rules_haskell to coerce GHC into using static
Haskell libraries in most places. In particular we moved hs-libraries
entries into extra-libraries entries in the package configuration files.
A much cleaner approach is to compile GHC with a static RTS, then GHC
will by itself choose to load static Haskell libraries.

* Remove haskell_cc_import

* da-hs-daml-cli -> daml-cli

* da-hs-damlc-app -> damlc-app
2019-07-01 13:26:19 +02:00
Ognjen Maric
54cf2ee836
Retain fetch actors during reinterpretation (#1414)
DAMLe: add submitters and retain fetch node actors in reinterpretation

Co-Authored-By: Francesco Mazzoli <f@mazzo.li>
2019-06-28 15:40:52 +02:00
Remy
c412d4e3d2 Add pretty C# namespaces in archive and leger-api protos (#1911)
* add nice C# namespace for in leger-api proto

fixes #1901

* add pretty C# namespace for archive protos

fix #1900
2019-06-27 11:39:33 +00:00
Remy
3f1b5d7761 daml-lf: Update spec for daml-lf 1.dev (#1899)
* daml-lf: Update spec for daml-lf 1.dev

* daml-lf: more details on interned package IDs in spec

* daml-lf: more comments in daml_lf_1.proto
2019-06-27 10:36:34 +00:00
Jussi Mäki
c23af0eaa0
Introduce contract key to exercise node (#1783)
* Introduce contract key to exercise node

Track the contract key in NodeExercises. This is in
preparation for adding the key into exercise events, and
for support for contract keys in kvutils, where we need
to be able to compute the outputs of the submission, e.g.
the contract key that would be unset by a consuming exercise.

This introduces transaction version 8.

* Move release note on contract keys in exercises to unreleased.rst

* Address Stephen's review

- Drop changelog entry for this change as it is not user facing
- Add info on version 8 to transaction.rst. Fix typo in version 7.
- Reorder VersionTimeline as per review
- Only compare the NodeExercise 'key' if it is set in the original
  transaction (in order to compare transactions in a backwards
  compatible manner)

* Unbork unreleased.rst
2019-06-27 09:57:40 +02: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
Remy
383888169d daml-lf: fix lf decoder (#1879) 2019-06-26 15:12:46 +00:00
Stephen Compall
7311dc8381 Refine, replace LF governors (#1892)
* Bring @gerolf-da and @hurryabit into LF governance, in place of @bitonic

* Add vacation backups to language CODEOWNERS
2019-06-26 16:37:50 +02: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
Moritz Kiefer
8e701cd229 Fix release process (#1878)
This PR adds a check that all artifacts that will be uploaded to Maven
central actually exists and fixes the artifacts for
daml_lf_archive_java.
2019-06-26 09:19:08 +00:00
Stephen Compall
9bcc925a40
intern package IDs in LF (#1614)
* specify the new fields for interning package IDs

* percolating intern tables

* crawl packages for package IDs as a pre-phase: generic prep

* stub case for interned_id in Scala packageref reader

* HasPackageRefs instances for the rest of the ast

* make intern table and use when encoding PackageRefs in v1

* don't need where

* stub out decode for interned package IDs

* no benefit to using uint32 instead of uint64

* percolate in encode one step

* interned case for decoding PackageRefs

* naming details

* intern table decoder

* finish propagating the intern table in encoder

* encode the package ID table

* document the vital assumption of encodeInternedPackageIds

* propagate the intern table through the LF decoder

- done by stacking ReaderT on top of Decode internally,
  as discussed with @hurryabit

* daml-lf-proto requires mtl

* stub out interned case in Scala LF decoder

* stub interface decoder function

* get the interned table to most places in InterfaceReader

* support for interned package IDs in Scala decoder

* use ImmArraySeq instead of Vector for Scala intern decode table

* adding that ghc extension didn't make sense

* implement interned ID decoding for InterfaceReader

* scenario service won't have interned package IDs

* test the interned ID resolution in Scala by examining the proto -> AST in detail

* proper precondition for the dev phase of interned IDs testing

* better error reporting for malformed DALFs in intern test

* just import Data.Int

- suggested by @neil-da; thanks

* pass around the lookup function instead of the vector in decoder

- suggested by @neil-da; thanks

* remove derivations for types deleted in e63b012d2d

* rename VersionAware to EncodeCtx

- suggested by @hurryabit; thanks

* rename MDecode to MonadDecode

- suggested by @hurryabit; thanks

* pass a function through the encoder instead of a set

- based on suggestions by @hurryabit and @neil-da; thanks

* daml-ghc test that interned IDs are generated

- suggested by @hurryabit; thanks

* adapt to 5b480c99ec #1844
2019-06-26 11:15:24 +02:00
Moritz Kiefer
37ada7e770
Build javadoc for daml-lf-archive (#1867)
This is required for uploading to Maven.

The rational for needing our custom javadoc_library rule is documneted
in the file itself.
2019-06-25 21:12:25 +02:00
Martin Huschenbett
19b2d5c86c Rename none and some to optional_none and optional_some in DAML-LF (#1810)
This fixes #95.
2019-06-25 12:47:38 +00:00
Stephen Compall
5b480c99ec
Decode modules abstractely in scenario-service server (#1844)
* add scenario Module decoding to Decode.OfPackage

* use purely data-driven decoding in scenario service in Scala

- decouples scenario service from LF decoder implementation

* make DecodeV1 companion private

* make extension to LFv2 more obvious
2019-06-25 09:49:04 +02:00
Remy
267ec7cb63 daml-lf: encoder generates dar files (#1769)
* encoder generate dar

* empty enum are non-serializable

* Address Stephen's comments

* address snd round of Stephen's comments
2019-06-21 18:15:39 +00:00
Martin Huschenbett
ca3ca745fb
Rename DAML-LF primitives for conversion between Text and code points (#1777)
I find the current names very confusing and unintuitive.

I'm aware that there are other primitives called `TO_TEXT_X`. But there the
`X` is meant to be a type index to `TO_TEXT`. This doesn't make much sense in
the context of `TO_TEXT_CODE_POINTS` though since there's no type named
`CodePoints`.
2019-06-20 16:03:11 +02:00
Remy
8f006e2714 minor fix for scala typecheck (#1764)
* daml-lf: fix typecheck bug with template type

* address Martin's comment
2019-06-19 16:21:59 +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