daml/language-support/scala/bindings-akka
Samir Talwar e1af564bcc
Switch from @silent to @nowarn. (#9498)
* Switch from `@silent` to `@nowarn`.

This annotation is native to Scala 2.12.13+ and 2.13.2+. It replaces
most usages of `@silent`.

I had to get creative about a couple of use cases that didn't work.
Specifically:

  1.  Suppressing deprecation warnings works, but Scala 2.12 erroneously
      complains that the `@nowarn` is unnecessary.  I had to suppress
      this warning too with `-Ywarn-unused:-nowarn`.
  2.  I can't seem to suppress the warning, "The outer reference in this
      type test cannot be checked at run time." Instead, I have
      refactored the code to remove the warning.

We still need to use the silencer plugin to suppress some warnings about
unused imports (because of compatibility between Scala 2.12 and 2.13),
but this means we no longer need the library, and therefore it is not a
transitive dependency that downstream consumers need to worry about.

CHANGELOG_BEGIN
CHANGELOG_END

* Add some comments around `@nowarn` support.

* language-support/scala: Fix a warning suppression.

* Revert to the default warnings.

Compatibility was complaining.
2021-04-26 19:46:14 +00:00
..
src Switch from @silent to @nowarn. (#9498) 2021-04-26 19:46:14 +00:00
BUILD.bazel Switch from @silent to @nowarn. (#9498) 2021-04-26 19:46:14 +00:00
README.md open-sourcing daml 2019-04-04 09:33:38 +01:00

Ledger Client Binding

This module contains the glue code between nanobot-framework, scala-codegen and prototype-client (Scala binding for the ledger API). The gRPC API provided by prototype-client as it is is not type-safe. The incomming Transactions from LedgerClient is routed to DomainTransactionMapper, which will:

  • convert the data in Transaction to type-safe types coming from api-refinements
  • call the EventDecoder provided by scala-codegen for created events
  • verify that the messages contain all the neccessary fields, and remove Optional wrappers

The result of this will be the Domain* classes.

In the other directions (for the commands coming out from the nanobots) the 'CompositeCommandAdapter' will be used to transform back to the gRPC interface (SubmitRequest). After the command submission, the outcoming Completion will be used to check the result, and based on that the CommandRetryFlow can decide wether the command should be retried or an error should be reported.