Commit Graph

51 Commits

Author SHA1 Message Date
Stephen Compall
f4d603757e
split AbstractHttpServiceIntegrationTest into two files (#13685)
* move AbstractHttpServiceIntegrationTestFuns to separate file
* security evidence moved

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-25 15:25:23 -04:00
Stephen Compall
7c33a02d44
test and document error when querying with a pruned offset argument (#13633)
* pruning test successful, shows the real error
* document current pruning failure

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-20 10:57:33 -04:00
Stephen Compall
9cafd894c1
nicer party throwaway literals in tests (#13619)
* replace NoCid with Aux
* xmap on ValueAddend, a way to e.g. let users "pun" on scalars
* nicer party specifications
- suggested by @realvictorprm; thanks

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-19 09:54:50 -04:00
Robin Krom
fcd3b6622b
ifaces:support exercising by required interface (#13554)
* ifaces:support exercising by required interface

This adds support to exercise an interface choice on a contract ID,
where the interface is required by one of the implemented interfaces of
the contract template.

Fixes #13434.

CHANGELOG_BEGIN
CHANGELOG_END

* some improvements based on review

* added a test plus a bugfix

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/PhaseOne.scala

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* 2 more interface tests for the command preprocessor

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2022-04-12 18:15:29 +00:00
Stephen Compall
f6fed6eaed
use matchers for trigger service test assertions (#13567)
* remove boolean usage of assertTriggerStatus
* remove CompatAssertion

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-11 19:07:17 +00:00
Stephen Compall
289e1c3692
use matchers for auth middleware test assertions (#13565)
* use OptionValues instead of Option#get

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-11 14:47:57 -04:00
Remy
3d7c54f814
LF: separate test between API and Replay command (#13526)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-11 11:53:29 +02:00
Remy
4e51194041
LF: Drop byInterface field from Transaction Nodes (#13520)
part of #13491

CHANGELOG_BEGIN
CHANGELOG_END
2022-04-07 11:06:17 +02:00
Victor Peter Rouven Müller
ad4ed5c4b2
Add security evidence for auth middleware (#13424)
changelog_begin
changelog_end
2022-04-05 11:25:56 +02:00
Stephen Compall
4bf0de8901
better errors when querying by interface ID (#13406)
- double the resolveTemplateId interface and use the "contract type" for
  exercise-by-id only
- lookup for template ID only
- 400 + error message test
- move query test to also run on PG/oracle

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-31 15:53:39 +00:00
Robin Krom
f7ae70ce5a
ifaces:evaluation order tests for create_interface (#13477)
This adds evaluation order tests for dalm-lf for `create_interface`.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-31 16:08:38 +02:00
Robin Krom
b2e7981b73
ifaces:evaluation order tests for fetch by iface (#13443)
This adds evaluation order tests for fetch_interface in the daml-lf
execution.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 11:19:34 +00:00
Robin Krom
609cd12392
interface evaluation tests (#13432)
* ifaces: more evaluation order tests

This adds more evaluation order tests for the execution of daml-lf
during exercise_interface.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/EvaluationOrderTest.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-03-28 14:24:04 +00:00
Robin Krom
537cfdb11b
ifaces:additional interface evaluation order tests (#13425)
This adds additional interface daml-lf evaluation order tests.

Part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-28 13:08:08 +02:00
Moisés Ackerman
b47fa3ba92
interface conversion primitives test cases (#13416)
* Add LF ParsersSpec cases for conversion primitives

* Add LF TypingSpec cases for conversion primitives

* Add LF DecodeV1Spec cases for conversion primitives

* Add LF EncodeV1Spec cases for conversion primitives

* update security-evidence.md

* Add missing cases in daml-lf encoder

* Add missing cases in EncodeV1Spec

* Add InterfaceMod in DamlLfEncoderTest

changelog_begin
changelog_end
2022-03-25 16:08:31 +00:00
Robin Krom
a43d7c5e1f
ifaces: new evaluation order tests (#13419)
This adds a new evaluation order test for the execution of daml-lf for
interfaces.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 14:09:59 +00:00
Robin Krom
3a4939d3d5
ifaces: one more evaluation order test (#13400)
This adds another evaluation order test for the execution of daml-lf for
interfaces.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-25 13:40:25 +01:00
Stephen Compall
467b8fbbe7
shorter Value expressions in json-api tests (#13358)
* template ID variables
* remove duplicate function

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:51:55 +00:00
Robin Krom
ff333c8f07
ifaces: evaluation order tests for exercise/fetch (#13396)
This add a first test for evaluation order of exercise_interface and
fetch_interface. More tests will come in the following PR's.

This is part of #12697.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-24 15:49:01 +01:00
Victor Peter Rouven Müller
dcd726e113
Add security evidence to the simple trigger tests (#13231)
changelog_begin
changelog_end
2022-03-22 17:01:35 +00:00
Victor Peter Rouven Müller
1d2c01d2ca
Fix main build (#13352)
just runs the formatter again which fixes the diff in security-evidence.md

changelog_begin
changelog_end
2022-03-21 15:41:10 +00:00
Victor Peter Rouven Müller
8e6493b02a
Add security evidence about the failure tests from the json api (#13229)
changelog_begin
changelog_end
2022-03-21 15:58:59 +01:00
Victor Peter Rouven Müller
47ca2cb953
Add security evidence annotations to the integration tests of the json api (#13225)
changelog_begin
changelog_end
2022-03-21 15:58:23 +01:00
Victor Peter Rouven Müller
31366b939c
Add test evidence annotation to unit test of the json api (#13219)
changelog_begin
changelog_end
2022-03-21 15:57:59 +01:00
Remy
f7d1901a5c
LF: split Command into ApiCommand and ReplayCommand (#13323)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-21 14:07:41 +01:00
Robin Krom
f7a73c5a87
ifaces: more tests for requires (#13309)
This adds tests for circular and non-closed requires in interfaces on
the daml-lf side.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-16 18:15:26 +01:00
Robin Krom
93c53da3df
requires checks (#13300)
* interfaces: tests for requires typing

We add tests for the correct typing of the interface requires field.

CHANGELOG_BEGIN
CHANGELOG_END

* security evidence
2022-03-16 12:05:30 +00:00
Sofia Faro
1feb4d25eb
Drop typerep argument from ExerciseInterface. (#13284)
* ifaces: Remove typerep arg from UExerciseInterface

changelog_begin
changelog_end

* Drop typerep argument in protobuf and haskell ast

changelog_begin
changelog_end

* scalafmt

* fix ExprParser

* fix PhaseOneTest

* fix validation test

* update evidencing security
2022-03-15 13:53:06 +00:00
Remy
d5471076ad
Speedy: Factorize fetch part between fetch by template and by itnerface (#13148)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-07 20:32:47 +01:00
Remy
3e3fccacfd
LF: Make exceptions in choice's controller/obervser uncatchable (#13106)
fixes #13099

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-03 18:37:12 +01:00
Robin Krom
adaddde058
speedy: short circuit precondition checking (#12984)
* speedy: short circuit precondition checking

Instead of evaluating all preconditions of templates and interfaces we
evaluate preconditions one by one and throw an exception as soon as we
find a failing one.

This implemented via a lazy SBCheckPrecond builtin and a foldleft
expression over the list of preconditions.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Update daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/SBuiltin.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* fix SUnit -> Unit

* tests

Co-authored-by: Remy <remy.haemmerle@daml.com>
2022-02-22 14:24:06 +00:00
Remy
ac3d9a4647
LF: Add LoggingContext to Speedy Machine (#12976)
This advances the state of #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-21 13:34:46 +01:00
Moisés Ackerman
7f6e1f08d4
Interface primitives continued (#12795)
* Extend daml lf parser to support new interface primitives

* Test parser on new interface primitives

* Add daml lf decoding test cases for new interface primitives

* Add TypingSpec test cases for new interface primitives

* add SBuiltinTest test cases for interface primitives

changelog_begin
changelog_end
2022-02-08 16:02:20 +01:00
Remy
aa2494f11a
Speedy: check contract type after checking if they are consumed (#12691)
Missed in #12527.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-01 15:36:40 +00:00
Remy
ebf7908007
LF: check contracts are consumed when found them in the cache (#12527)
fixes #11874

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-25 13:33:54 +00:00
Remy
3ea8aded13
LF: Test evaluation order of exercise and exercise_by_key (#12519)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-24 12:23:31 +00:00
Moritz Kiefer
688f1e1e0b
Drop v0 contract ids (#12464)
* Drop v0 contract ids

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-20 15:28:27 +00:00
Remy
36536fabfa
LF: Test evaluation order of lookup_by_key (#12494)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-20 12:04:18 +00:00
Remy
3159d60444
LF: more tests for evaluation order of fetch (#12471)
addresses remaining points of the review of #12411.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-19 17:45:58 +00:00
Remy
25ddfcdcb4
LF: Add tests for evaluation order on fetches (#12411)
As for creates, these tests somewhat ignore ordering on on-cachable
errors relative to each other since those only change error messages.

changelog_begin
changelog_end
2022-01-18 11:21:30 +01:00
Remy
ea2d4bc7de
LF: factorize typeAndCompile in Speedy tests (#12402)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-13 17:23:27 +00:00
Moritz Kiefer
e01fcdf143
Add exhaustive tests for evaluation order on creates (#11957)
As mentioned in the comment, I view these tests as a way to guard us
against bricking ledgers on upgrades so they somewhat deliberately
ignore ordering of non-cachable errors relative to each other since
those only change error messages.

changelog_begin
changelog_end
2021-12-06 13:06:46 +01:00
Moritz Kiefer
8179c73763
Drop support for Daml-LF party literals from the Scala side (#11922)
* Drop support for Daml-LF party literals from the Scala side

This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST. Haskell side is in #11930

fixes #11581

changelog_begin
changelog_end

* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Revert "Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala"

This reverts commit 55e542ce4e3a7fd15544ee703de3277ffc309b17.

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-12-01 10:37:42 +00:00
Sofia Faro
1d7bca801e
Add optional typerep argument in UExerciseInterface. (#11910)
* Add type rep argument for interface exercises.

(Still WIP.)

Part of #11703. Fixes the order in which errors are raised ("wrong type"
takes priority over "does not implement interface"). This PR also simplifies
ExerciseInterface by making the guard mandatory, otherwise there's too
many variations. We can revisit that later if we want.

changelog_begin
changelog_end

* haskell side

* dont throw exception in checkTemplateId

* scalafmt

* evidence security

* fix TypingSpec test
2021-11-30 15:10:33 +00:00
Remy
86da6e8eef
LF: Test scala interface type checking (#11833)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-24 15:58:45 +00:00
Remy
f33486154f
LF: Simplify LF Syntax (#11795)
- Do not wrapped choices in `choices { ... }`
- use sytematic `;` after choice component instead of ',`

CHANGELOG_BEGIN
CHANGELOG_END
2021-11-19 17:23:36 +01:00
Remy
92181161cc
LF: Abstract VersionedValue and VersionedContractInstance (#11533)
* LF: Abstract VersionedValue and VersionedContractInstance

CHANGELOG_BEGIN
CHANGELOG_END

* formatting
2021-11-09 23:22:38 +00:00
Sofia Faro
cbc3c8c686
Add by_interface field in Create, Fetch, & Exercise transaction nodes. (#11576)
* Add by_interface field in tx nodes.

This PR adds an optional `by_interface` field in the Create, Fetch,
and Exercise nodes, as part of #10915. It also updates TransactionCoder
to support these fields.

Setting these fields (in the LF interpreter) is left to a separate PR.

changelog_begin
changelog_end

* update security-evidence.md

* Add version checks in TransactionCoder
2021-11-08 16:33:02 +00:00
nickchapman-da
b5540a9c3b
Evidence for contract-key testing (#11479)
* Split contract-key tests from engine tests, and mark for evidence.

CHANGELOG_BEGIN
CHANGELOG_END

* remove contract key tests from their original location

* evidence for unique/non-unique contract keys
2021-11-01 16:38:26 +00:00
nickchapman-da
68f44325a6
Improve evidence of testing (#11428)
* fine grained test evidence for authorization

* fine grained test evidence for privacy

* fine grained test evidence for input-validation (typing)

* fix exit code of security/update.sh script (set -euo pipefail)

* add security evidence test category: Input Validation

* regenerate security-evidence.md

CHANGELOG_BEGIN
CHANGELOG_END

* fix bug in securoty evidence generation (must sort before group, or else we loose lines)

* evidence for input validation of commands

* address comments

* cleanup: remove backticks from evidence free text
2021-10-28 09:24:52 +00:00