Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Scala codegen and ExerciseByKeyForum ↗

Scala codegen and ExerciseByKey

App Development7 posts379 views6 likesLast activity Jul 2020
OG
oggyOP
Jun 2020 1

If I run Scala Codegen on a template that has a key, how do I create an ExerciseByKeyCommand, i.e., of the form:
https://docs.daml.com/app-dev/grpc/proto-docs.html#com-daml-ledger-api-v1-exercisebykeycommand

Is this possible? I didn’t find anything in the codegen guide. A pointer to an example would be appreciated.

TA
Tamas_Kalcza
Jun 2020

In the Java codegen you can create it via static methods. For example:

MyTypeWithAKey.exerciseByKeyExampleChoice("Example argument");

Is this helpful or is the Scala codegen that different?

ST
stefanobaghino-da
Jun 2020

The Scala code generation unfortunately does not generate a method to exercise by key, as of 1.2.x.

OG
oggy
Jun 2020

Thanks, @Tamas_Kalcza and @stefanobaghino-da. Setting Java codegen up in addition to Scala is too much work for what I’m trying to do currently, so I’ll just convert the resulting gRPC ExerciseCommand into an ExerciseByKeyCommand by hand.

ST
Stephen
Jun 2020 1

Probably the best choice. I’ve added a GitHub issue as well.

ST
Stephen
Jul 2020 3

We’ve added this to Scala codegen, so it should appear in the next release.

GA
Gary_Verhaegen
Jul 2020 1

Note that this is not part of the current 1.3RC, so “next release” here probably means 1.4.

← Back to Discussions