Commit Graph

122 Commits

Author SHA1 Message Date
Jussi Mäki
4ecf070860
kvutils: Authorization and config submissions (#2433)
* Initial version for configuration submissions and authorization

* Refactor config submission based on review. Add tests.

* Cleanup test output and comments

* kvutils test-suite

- Add unit tests for kvutils
- Thread the input state into Commit monad
- Fix a bug in handling rejected transactions (from previous refactoring)

* Address PR review

- Add submissionId to configuration changes.
- Revert the dedup of the ParticipantNotAuthorized message. This did not buy much
  and we need to duplicate it anyway when modularizing kvutils.
2019-08-21 18:24:16 +02:00
Remy
daf10bf247
daml-lf: make LF parser numeric compatible (#2587) 2019-08-19 16:31:33 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01: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
Francesco Mazzoli
6cc5510dae purge all Map#mapValues from daml-lf codebase (#1864)
fixes #1861.
2019-07-04 15:08:43 +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
11b602da03 Scala Daml-lf encoder (#1715)
* encode ast in protobuf

* daml-lf parser: make defaultPackageId and languageVersion parametric

* daml-lf rewritting of AST

* test ast encoder

* copyright

* test function type encoding

* daml-lf add parameter to parser implicits

* damlfl-as stands for "damllf assembler"

* move encoder in its own private package
2019-06-18 17:32:21 +00: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
Remy
bf5309b42e daml-lf: add enum pattern matching (#1506)
* daml-lf: add enum pattern matching

* daml-lf: add test for interpreter pattern matching
2019-06-04 22:25:22 +00:00
Remy
0d25b73d1f daml-lf add builtin to (un)pack string in code points (#1480)
, namely

* FROM_TEXT_CODE_POINTS: Text -> [Int64]
* TO_TEXT_CODE_POINTS: [Int64] -> Text
2019-06-04 14:06:25 +00:00
Remy
439613bee8 daml-lf: add FROM_TEXT_INT64 and FROM_TEXT_DECIMAL (#1407)
* daml-lf: add FROM_TEXT_INT64 and FROM_TEXT_DECIMAL

* Fix typos in Haskell

* cosmetic change

* Fix DAML-LF type checker

* Fix merging fallout
2019-05-27 17:19:01 +00:00
Martin Huschenbett
c30ec0fc03
Make the actors optional in DAML-LF's exercise instruction (#1377)
* Make the actors optional in DAML-LF's exercise instruction

If they are not present, the controllers will be filled in. Surface DAML
does this currenty anyway by fetching the contract and computing the
choice controllers before each `exercise`. This change will allow for
getting rid of the additional `fetch` preceding each `exercise`.

The compiler does not use the new form yet. I will do this in a separate
PR together with tests for the new behaviour.

This fixes #1347.

* Fix DAML-LF type checker test

* Check presence of actors for old DAML-LF versions in decoder
2019-05-24 15:01:56 +02: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
Martin Huschenbett
b09cbd037b
Add coerce for contract ids to DAML-LF (#1346)
* Add coerce for contract ids to DAML-LF

This is needed for our implementation plan for generic templates.

Fixes #1277.

* Reformat Scala
2019-05-24 09:08:15 +02:00
Remy
c7df212d42 Daml lf type safty (Decimal) (#1098)
* daml-lf: make Decimal type safe

* daml-lf: create Utf8String type

* daml-lf: cleanup in data package

* Address Stephen Comments

* daml-lf: remove UTF8String
2019-05-14 18:10:45 +00: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
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
Remy
433184626d Ledger Api: drop ledger api domain values in favor of LF-values (#649) 2019-04-25 23:15:12 +00:00
Remy
680239b5cf daml-lf fix and cleanup Decimal.fromString (#606) 2019-04-25 00:22:45 +00:00
Jussi Mäki
1f2246c822 Do not divulge contracts to observers in nonconsuming exercises (#325)
* Do not divulge contracts to observers in nonconsuming exercises

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

Re-enables test_divulgence_of_token in sandbox semantic tests.

Fixes #157.

* purge LedgerFlags entirely...

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

* updated release notes
2019-04-11 14:41:35 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00