Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.
[Here][1] is s a blog post by the Scala team about it.
Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.
Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.
changelog_begin
changelog_end
[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.
I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.
CHANGELOG_BEGIN
CHANGELOG_END
* TransactionNodesStatistics.stats now returns case class of same name
changelog_begin
changelog_end
* Rename TransactionNodesStats to Detail and make inner class
* Rename TransactionNodesStatistics.stats to apply
* Rename TransactionNodesStatistics to TransactionNodeStatistics
* Reformat
* Remove rollback from statistic action count
* Update with review comments
* Update with review comments
* Update TODOs to outdated issues.
In particular update a lot of defunct interface TODOs to the LF 1.15
issue (or add the LF 1.15 issue if it's also relevant).
changelog_begin
changelog_end
* typo
* remove numeric/bignumeric todo
* scalafmt!!
* drop choice observer TODO
This is part of #11691
This PR allows to limits:
- the number of signatories,
- the number of observers,
- the number of controllers,
- the number of inputContracts,
CHANGELOG_BEGIN
CHANGELOG_END
* Add a guard when exercising by interface.
This fixes part of #11703, when exercising an inherited choice by
interface and you know the template id, via the command preprocessor.
It does this by inserting a "guard" in between the interface fetch and
the exercise body. The guard is a function Interface -> Bool, which
is general enough to check the template id, without complicating too
much in speedy. And can be generalized in the future to check more,
like signatories, etc.
I added the guard as an optional argument to UExerciseByInterface.
This isn't hooked up to the protobuf AST yet (or Haskell side for
that matter) -- but I'll do it in the next PR! For now you can invoke
the guarded exercise via the command preprocessor, so I can enable the
approprate engine tests. (There's still some failing fetch tests left,
but I decided to leave this for later. Fetch can be a lot simpler than
guarded choices, since you always add a fetch node. No need for fancy
continuations.)
changelog_begin
changelog_end
* scalafmt
* Feedback and fix matches
* Update comments, we are always going to abort the transaction
* Raise WronglyTypedContract in SBGuardTemplateId.
* rebase and fix parser
* restore ANF
* scalafmt
We revert #11626, and just change the way transaction version is
computed:
- As before, Node version is calculated from the
package of the template ID action.
- Transaction version is the max of the version of all the nodes,
instead of the root nodes.
CHANGELOG_BEGIN
CHANGELOG_END
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.
changelog_begin
changelog_end
* LF: Reintroduce TransactionVersion.asVersionedTransaction
This have been drop in #11626, but canton is using it.
CHANGELOG_BEGIN
CHANGELOG_END
* cosmetic
* cosmetic
Because a bug in the scala compiler deprecated pattern matching are
not detected (See https://github.com/scala/bug/issues/12493).
Hence some deprecated usage of Node aliases have been forgotten in
CHANGELOG_BEGIN
CHANGELOG_END
Following up #10827 and #10921, we drop type parameter to
KeyWithMaintainers, and use the `Versioned` wrapper introduced in
CHANGELOG_BEGIN
CHANGELOG_END
* LF: Rename GenTransaction to Transaction
Following up #10827 and #10921 that drop type parameters from GenNode,
we rename GenTransaction to Transaction.
CHANGELOG_BEGIN
CHANGELOG_END
* fix
* a bit more fixes
* 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
After #10827 that drops type parameters in Value, `CidContainer`'s
`ensureNoCid` and `assertNoCid` loose their interest.
To check a value does not contain Contract Ids one should use
`foreachCid` or `cids` methods instead.
CHANGELOG_BEGIN
CHANGELOG_END
After dropping type parameter from GenTransaction we do not
com.daml.lf.transaction.Transaction.Transaction type alias. We use
instead directly com.daml.lf.transaction.VersionedTransaction, wich is
anyway more informative.
CHANGELOG_BEGIN
CHANGELOG_END
In #11419 we drop the implicit call that convert ContractInstance in
CidContainer. Thie is used by Canton and should be restore.
Note that now ContractInstance is not polymorphic anymore, hence we
can inherite CidContainer instead of defining an implicit.
CHANGELOG_BEGIN
CHANGELOG_END
* Add NonUnitStatements warning in daml-lf/transaction & fix using discard or similar.
CHANGELOG_BEGIN
CHANGELOG_END
* address comment
* prefer parens to braces for single statement map/foreach bodies
99% of our usecases use Value[ContractId] so this PR just fixes it.
The few other usescases are:
1. Value[Nothing] which we use for keys. This is technically more
precise but we benefit very little from it.
2. Value[String] mostly because in a few places we are lazy.
We don’t have any code which benefits from being polymorphic in the
contract id type.
changelog_begin
changelog_end
Following #10763, we drop the ad-hoc builders for `FrontStack`.
* Building a `Fronstack` from individuals elements should be done with
standard scala buidler.
* Building a `Fronstack` from a `TraversableOne` should be done with
the scala 2.13 `.to(FrontStack)` methd
* Building a `Fronstack` from a `ImmArray` should be done with the
`toImmArray` method.
CHANGELOG_BEGIN
CHANGELOG_END
Since we switch to scala 2.13, ImmArray companion object extends
`Factory`. Hence:
- the `apply` methods of `ImmArray` override the one from `Factory`
- we can use the notation `.to(ImmArray)` to convert an `Iterable` to
`ImmArray`
This PR drops those `apply` ImmArray. Conversion from Iterable to
`ImmArray` should use the `.to(ImmArray)`.
CHANGELOG_BEGIN
CHANGELOG_END
Create normalized TXs when a partial TX is finalised.
Except in limited cases! (i.e for scenario-runner, sandbox)
CHANGELOG_BEGIN
CHANGELOG_END
normalize values in the engine as they are converted from speedy-values
fix 2.12 build
backout redundant change
ensure byKey field is correctly normalized when constructed by engine
rename flag: valueNormalization -> transactionNormalization
improve comment
delete commented-out code
rename: toValueNorm --> toNormalizedValue
rename: (SValue.) toValue --> toUnNormalizedValue
revert changes to ptx so that the interface to insertCreate() etc is Value-based (not SValue-based)
improve comments
respell: toUnNormalizedValue --> toUnnormalizedValue
fix build
This PR enforces that LF Comparisons (both Ordering and Equality)
fails at runtime if comparing local vs global CID.
This corresponds to the second task of #10504.
CHANGELOG_BEGIN
CHANGELOG_END
* build correctly versioned empty tx
* dont call normalizeTx from Engine.validate
* dont recalc the tx-version in normalizeTx; just assume it is correct
CHANGELOG_BEGIN
CHANGELOG_END
* Normalize transactions & values as a separate pass. Use for simpler defintiion of isReplayedBy.
CHANGELOG_BEGIN
CHANGELOG_END
normalize transaction version
* remove stray import from bad merge which breaks scala 2_12 build
* change isReplayedBy to only norm its RIGHT (replay) argument
* add forgotton normalization for ValueEmum
* switch to use existing value normalization code (remove my newly coded duplicate code)
* normalize submittedTransaction before calling engine.validate
* dont call normalizeTx from Engine.validate
* *do* call normalizeTx from Engine.validate
* Upgrade Scalatest to v3.2.9.
Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.
The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.
As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.
CHANGELOG_BEGIN
CHANGELOG_END
* http-json-oracle: Fix a Scalatest dependency.
* ledger-api-client: Fix a Scalatest dependency.