daml/daml-script/export
Moisés Ackerman 6ef040743f
Support interface choices in daml ledger export (#15189)
* Rename test //daml-script/export/integration-tests/golden:{export-=>}values

* Switch 'daml_ledger_export_test' to use 'run' instead of 'run-legacy-cli-config'

* Extract 'encodeImports' from 'encodeModuleHeader'

* Sort import list in 'daml ledger export'

* Add 'dev' argument to 'daml_ledger_export_test'

* Add interfaceId to ExercisedSelector

* Extract 'encodeExercisedEvent' from 'encodeCmd'

* Split 'encodeCid' into 'encodeCid{Expr,Pat}'

* 'CreatedContract' field 'tplId' now has type 'TemplateId'

* Specialize CreatedContract{=>WithPath}

* 'treeEventCreatedConsumedCids' returns Seq[SimpleCreatedContract] instead of Set[ContractId]

* Change type of 'SimpleCommand' field 'contractId' to 'SimpleCreatedContract'

* Coerce ContractIds to underlying template type

* Use interface ContractId in encodeExercisedEvent if present

* Add test //daml-script/export/integration-tests/golden:interface-choices

* Fix encoding of getAnyChoiceTemplateTypeRep in daml-script converter

* Set getAnyChoiceTemplateTypeRep to interfaceId if available

* fromExercised uses choice instead of templateId to find subtree

fromExercised uses exercised.argument.templateTypeRep instead of exercised.contractId.templateId

Previously it used exercised.contractId.templateId, but now it uses
exercised.argument.getAnyChoiceTemplateTypeRep, which corresponds
to the TemplateTypeRep of the {template,interface} that defined the choice.

* TestData.Exercised now takes a more flexible TestData.Choice argument

* Add unit tests for encoding of exercise of interface choice

* Apply code review suggestions

* sealed {trait=>abstract class} CreatedContract

* Use List instead of Seq

* Use ::= instead of :+= and ++=

changelog_begin
- [Daml export] Added support for interface choices (#15189)
- [Daml export] Export.daml imports are now sorted alphabetically
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-10-19 10:43:04 +02:00
..
integration-tests Support interface choices in daml ledger export (#15189) 2022-10-19 10:43:04 +02:00
src Support interface choices in daml ledger export (#15189) 2022-10-19 10:43:04 +02:00
transaction-eq update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
BUILD.bazel Replace silencer plugin with built-in warning configuration (#12543) 2022-01-24 15:01:35 +00:00