* 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>
* 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
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
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
* 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 #11930fixes#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>
* 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
* 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
* 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
* 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
* Generate security evidence by documenting security testcases.
CHANGELOG_BEGIN
CHANGELOG_END
* move generated file to root of repo, so links work
* formatError function instead of Show instance
* dont use Show instances for generating Markdown
* magic comment: SECURITY_TEST --> TEST_EVIDENCE
* use megaparsec and Data.Text
* remove redundant T.pack
* use: Text.Megaparsec.Char.space