Commit Graph

148 Commits

Author SHA1 Message Date
Stephen Compall
a51d0db8ff
set scalac -Xsource:2.13 -Ypartial-unification globally (#6469)
* add -Xsource:2.13, -Ypartial-unification to common_scalacopts

* add now-referenced scalaz-core where needed

* work around bad type signatures in scalatest Aggregating, Containing

* unused Any suppression

* work around bad partial-unification wrought by type alias

* remove unused Conversions import

- not required in 4f68cfc480 either, so unsure how it's survived this long

* work around Future.traverse; remove unused show import

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* remove unused bounds

* remove -Ypartial-unification and -Xsource:2.13 where they were explicitly passed

* longer comment on what the options do

- suggested by @stefanobaghino-da; thanks

* forget Future.traverse, just use scalaz, it knows how to do this
2020-06-24 16:51:24 -04:00
Remy
ec7d53eb59
LF-REPL: proper dev-mode (#6453)
We add a flag in LF-REPL to prevent usage of DAML-LF Dev and dev value/transaction version.

This PR advances #5164.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-23 17:08:37 +02:00
Remy
2a10a124d8
LF: Control transaction version inferrence. (#6365)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-18 19:11:33 +02:00
Remy
cbe423fc6c
LF: rename library transaction-scalacheck to transaction-test-lib (#6347)
* LF: rename library transaction-scalacheck to transaction-test-lib

CHANGELOG_BEGIN
CHANGELOG_END

* move files in com/daml

* missing change in release/artifacts.yaml

* remove 'com/dam' from the path
2020-06-17 10:52:40 -04:00
Remy
39ceac7a2c
LF: Change engine output from GenTransaction to VersionedTransaction (#6311)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-15 17:35:15 +02:00
Remy
3351dd8963
Address miklos' comments made in #5966 (#6315)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-12 16:33:52 +02:00
Remy
f487b051f9
Ledger: use standard transactions in the indexer (#6297)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-11 16:12:21 +02:00
Remy
da48be2be5
LF: Make VersionedTransaction a CidContainer (#6304)
plus some minor cleanup in CidContainer

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-11 14:49:33 +02:00
Remy
cb23eb2c29
Ledger: use EventId instead of LedgerString (#6278)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-11 09:49:12 +02:00
Remy
5ff15a8ef5
DAML-LF: discriminate submitted and committed transactions (#6143)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-09 09:05:15 +02:00
Remy
00972f38b5
DAML-LF: split com.daml.lf.types.Ledger (#6264)
We split the object  com.daml.lf.types.ledger in three:
- one part in `com.daml.lf.ledger.` (in //daml-lf/transaction) for the part relative to EventId (shares between scenario service and sandbox)
- one part in `com.daml.lf.ledger.` (in //daml-lf/interpreter) for the part common to Blinding and Scenario
- one part in `com.daml.lf.scenario.` (in //daml-lf/interpreter) for the part specific to Scenario

fixes #6260

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-08 17:29:10 +02:00
Remy
5e9490f1dc
Engine: Centralize the place where value version is inferred. (#6229)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-05 21:01:21 +02:00
Remy
bffc289868
DAML-LF: deprecate Transaction.TContractId (#6223)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-04 19:13:41 +02:00
Stephen Compall
39dc5aa88b
replace NodeExercises#controllers with controllersDifferFromActors boolean (#6073)
* replace NodeExercises#controllers with controllersDifferFromActors

* remove controllers from ActorMismatch and scenario service exercise

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* remove reserved ID #s in scenario-service grpc

As discussed, we don't need to worry about
version mismatches.

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-06-02 13:43:47 -04:00
Stephen Compall
ae9e3e2ec1
clean up Node map function (#6149)
* remove boilerplate from GenNode.map3

- There is no need to enumerate the unchanged fields, because if you
  miss one, you get a type error.  Unfortunately foreach3 cannot benefit
  from the same typechecking.

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-28 16:28:01 -04:00
Stephen Compall
15350a7bc2
disable warts.Any and remove most suppressions (#6132)
* disable Any wart

* first pass removal of Any suppressions for false positives

* second pass removal of Any suppressions for false positives

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* third pass removal of Any suppressions for false positives

* fourth pass removal of Any suppressions for false positives

* reformat newly single-suppressions into single lines

- suggested by @SamirTalwar-DA; thanks
2020-05-28 16:53:41 +00:00
Stephen Compall
78205afa0d
use 2.13-style collections library syntax in json-api (#6075)
* register scala-collection-compat with java deps list

* add scala-collection-compat to http-json deps

* remove breakOut throughout http-json, replaced with view/to or iterator/to

* use scala 2.13-style `to` calls in http-json

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* use 2.13-style to in lf-value-json

* some fused size comparisons

* remove low-hanging breakOuts in daml-lf

* regenerate maven_install.json for scala-collection-compat

* regenerate maven_install.json for scala-collection-compat

* regenerate maven_install.json for scala-collection-compat
2020-05-27 22:27:25 +00:00
Stephen Compall
1be6b3640f
equalz Scalatest matcher in new daml-lf/scalatest-tools library (#1200)
* equalz Scalatest matcher in new daml-lf/scalatest-tools library

* equalz typing tests

* a 'should' replacing design

* a 'MatcherFactory1' design

- this fails because the TC parameter should be a type member to avoid
  scala/bug#5075 but it is not

* MatcherFactory1 with chained Lub+Equal typeclass

- requires partial-unification at point of use, which is not great

* LubEqual's extra tparam is probably unneeded

* better LtEqual

* demonstrate that HK LubEqual's resolve with DMT should + MatcherFactory

* remove unneeded 3rd param from LubEqual, again

* update dependency specs and license headers

* allow use with should, shouldNot in some cases, preserving the shouldx/shouldNotx alternatives

* move Equalz to libs-scala/scalatest-utils

* rename bzl targets and place in com.daml.scalatest package

* add scalatest-utils to release

* move *SpecCheckLaws, Unnatural to scalatest-utils

* missed scalacheck dep in scalatest-utils

* downstreams of *SpecCheckLaws now get them from scalatest-utils

* test equal-types case as well

* update LF documentation

CHANGELOG_BEGIN
CHANGELOG_END

* whitespace error
2020-05-27 17:25:43 -04:00
Remy
3f29ac84f0
DAML-LF: cleanup last refs to Absolute Contract IDs (#6126)
follow up of #5991

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 18:05:48 +02:00
Remy
46bb942964
DAML-LF: restrict value versions (#6109)
advances #5164

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 15:51:56 +02:00
Remy
9e456a1016
DAML-LF: Kill RelativeContractId (#5991)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-25 22:30:45 +02:00
Remy
deedec9b9f
Engine: Remove optionality of contract ID Seeding. (#5966)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-13 20:29:14 +02:00
Remy
93a01f7e12
DAML-LF: enforce size limit for Contract ID suffixes. (#5913)
Following the Contract ID Specification, we limit the size of contract ID suffixes to 94.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-11 15:32:17 +02:00
Remy
1115b3916f
Engine: Add in-execution-order traversal for transactions. (#5867)
We add a new traversels to GenTransaction that visit all the nodes in execution order.
Exercise nodes are visited twice: when execution reaches them and when execution leaves their body.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-07 20:17:27 +02:00
Remy
be52a04934
Engine: Drop CidConsumer and make CidContaint foreachX iterator public. (#5865)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-07 10:42:28 +02:00
Remy
5d5fddbc0a
DAML-LF: Contract ID allocation scheme specification (#5784)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-06 18:07:41 +02:00
Remy
aed97a5d1f
Engine: Contract IDs collecter for values, transactions… (#5805)
We add a method to collect contract ID for value, transaction ...

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-06 10:52:40 +02:00
Stephen Compall
2b23b41391
JSON decoding support for GenMap (#5223)
* add GenMap to the "all types" test generators

* report bad GenMap format with DeserializationError, not MatchError

* document GenMap JSON

* notes on missing features

* enable -Xsource:2.13 in transaction

* make an Order instance for Value resolvable, but unimplemented

* use the skeleton from SValue ordering to make a Value ordering skeleton

* add Party Order

* add Order instance for SortedLookupList

* add Order for FrontStack, deriving everything

* factor the Order lookup, and tie a knot in the recursive Value instances

* we're going to need this Iterator thing again

* replacing Order#contramap with version that supports equalIsNatural

* use new equalBy, orderBy for FrontStack, SortedLookupList, ImmArray

* _2 comparator, upgrade Name Equal to an Order

* incorporate lookup for enums, variants into Value order; record/struct cases

* Enum/Variant comparison

* looking up the singleton implicitly won't work for non-`object`s, alas

* test Order laws for values of all primitive types

* test Order laws for record and variant types

* test Order laws for enum types

* test that enum strings are not compared

* use checkLaws for Value Equal as well

* test that enums match order to constructor rank

* factor genAddend and genAddendNoListMap

* reintroduce Order for TypedValueGenerators

* more addend order

* record, variant order cases

* record cons order

* deriving Order while decoding from JSON

* make ApiCodecCompressed's Cid codec based on the typeclass

* test how the Value ordering and the underlying projected value orderings line up

- hint: they don't, yet
- this is also a template for how we'll check the fidelity with SValue
  ordering

* test how the Value ordering and SValue ordering line up

- hint: they don't, yet

* typed Arbitrarys have access to Order

* produce proper ValueGenMap

* inj requires Order, sometimes

- we encode this as "all the time" but there is a type-level unification
  approach to remove this requirement in some cases

* make inj a function

* test that order doesn't matter for JSON decoder

* use Utf8 order for TVG text; don't pretend that base equal works

* sort JSON GenMaps, and check for duplicates

* make injarb use IntroCtx

* remove stray import

* Order instances for Bytes, Hash, AbsoluteContractId

* require Order[Cid] to decode JSON to LF values

* clean up map reordering test

* remove unused Instant instance

* fake Order instance no longer needed, valid instance defined

* test parity of global AbsoluteContractId order and SContractId order

* bazel fmt

* test AbsoluteContractId Order lawfulness

* test duplicate key detection

CHANGELOG_BEGIN
- [JSON API] Prepare full support for the planned GenMap primitive type.
  See `issue #5031 <https://github.com/digital-asset/daml/issues/5031>`_.
CHANGELOG_END
2020-05-05 10:27:37 -04:00
Stefano Baghino
0da6527961
Fix typo Fasle -> False in com.daml.value.Value (#5833)
changelog_begin
changelog_end
2020-05-05 08:43:33 +00:00
Oliver Seeliger
4c0ffdf4df
Upgrade scala compiler silencer to 1.6.0 (#5822)
* Upgrade scala compiler silencer to 1.6.0

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt build bazel file to new targets

* Switch to silencer plugin scala 2.12.11 per Samir's feedback

rather than 2.12.8

* Add missed bazel files

* Review feedback from Leo
2020-05-04 21:30:46 +00:00
Leonid Shlyapnikov
51d96a7d2e
Upgrading to scalac/runtime v2.12.11, we have been on v2.12.6 for too long (#5807)
https://github.com/scala/scala/releases/tag/v2.12.11

Fixing scalac deprecation and unused variable warnings

`/:` is deprecated, using foldLeft
`:\` is deprecated, using foldRight

Removing unused deps reported by bazel buildozer + scalafmt

changelog_begin
Upgraded Scala compiler and Scala runtime to v2.12.11.
See https://github.com/scala/scala/releases/tag/v2.12.11
changelog_end
2020-05-01 11:37:07 -04:00
Stephen Compall
57c08d4819
reduce GenMap key depth and container element size in random testing (#5788)
* resize elements of containers by 1/3 in TypedValueGenerators

- no explosions in 2m samples

* use Order.apply

* resize key types of GenMaps more vigorously

- At max 100, the default, max size of a key *type* is 10, key size 33

* revert most of "reduce test count for Ordering tests (#5741)" 00025a5337

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-30 15:40:28 -04:00
Stephen Compall
00025a5337
reduce test count for Ordering tests (#5741)
* reduce test count for Ordering tests

CHANGELOG_BEGIN
CHANGELOG_END

* changed the wrong one in ValueSpec; preserves base order is redundant for primitives
2020-04-27 14:31:37 -04:00
Stephen Compall
d4086080ea
proper GenMap Gen with key Value order (#5526)
* add Order instances to various types in LF data, transaction

* define scope-dependent Order for Value; test compatibility with SValue order

* support Order in TypedValueGenerators

* generate properly-ordered ValueGenMaps in TypedValueGenerators

* factor genAddend and genAddendNoListMap

* test Value.orderInstance fidelity with well-typed Orders

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* shrink Maps for better debugging

* line up base List and GenMap orders with svalue

* unhandled cases in custom comparator for ApiValueToLfValueConverter tests

- hazards of not using match2

* adapt to PureCompiledPackages changes
2020-04-24 17:57:12 -04:00
Remy
15354c3256
DAML-LF: remove submitter is in maintainer check (#5611)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 16:10:39 +02:00
Remy
48f6c790b8
Engine: keep track of the nodes that correspond to a "byKey" command (#5599)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-21 10:01:11 +02:00
Stefano Baghino
0c97fa44f1
Fix reference to com.daml.lf package in ValueCoder (#5617)
changelog_begin
changelog_end
2020-04-20 07:30:51 +00:00
Remy
e03bb85bac
Engine: Clean the output of interpretation loop. (#5597)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-17 10:31:45 +00:00
Remy
a178e3e3e9
DAML-LF: remove seed from node, move it to transaction meta data. (#5570)
* DAML-LF: remove seed from node, move it to transaction meta data.

+ redesign seeding to validate partial transaction.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-17 11:02:11 +02:00
Remy
0a295f8bd2
DAML-LF: add function to derive maintainer contract key UUID (#5566)
* DAML-LF: add function to derive maintainer contract key UUID

CHANGELOG_BEGIN
CHANGELOG_END

* rephrase
2020-04-15 15:12:37 +00:00
Gerolf Seitz
a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00
Gerolf Seitz
329320bad9
Organize maven coordinates (#5272)
* Use com.daml as groupId for all artifacts

CHANGELOG_BEGIN
[SDK] Changed the groupId for Maven artifacts to ``com.daml``.
CHANGELOG_END

* Add 2 additional maven related checks to the release binary

1. Check that all maven upload artifacts use com.daml as the groupId
2. Check that all maven upload artifacts have a unique artifactId

* Address @cocreature's comments in https://github.com/digital-asset/daml/pull/5272#pullrequestreview-385026181
2020-04-01 11:41:18 +02:00
Remy
5218b5f3e8
DAML-LF. method to suffix V1 cid (#5319)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-01 10:02:32 +02:00
Remy
0e1ca7df7c
Engine: ensure freshness of local cid discriminator (#5277)
* Engine: ensure freshness of local cid discriminator

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-31 18:06:18 +02:00
Remy
7185608f87
Engine: lf-repl uses to new contract ids (#5249)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-31 11:06:50 +02:00
Remy
3fc1175436
Engine: force recent version for serializing transactions and values. (#5232) 2020-03-30 16:29:18 +02:00
Stefano Baghino
746b774e82
Add canonical string representation for identifiers (#5270)
* Add canonical string representation for identifiers

An identifier is represented as a string as a package identifier and a qualified name separated by a colon.

changelog_begin
changelog_end

* Simplify explicit type signature for HexString

Thanks @remyhaemmerle-da

Co-Authored-By: Remy <remy.haemmerle@daml.com>

* Fix hashing test expected output

* Fix key hasher test expected output

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-03-30 12:55:11 +00:00
Remy
4cb3ea5c7c
Ledger: clean up contract id seeding (#5260)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-30 10:13:42 +02:00
Remy
1b37f6c482
DAML-LF: redesign absolute contract ids (#5207)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 19:07:42 +01:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00