Release 0.75.0
Split up of deon-language-runtime
maven package
The Maven package deon-language-runtime
has been split up slightly.
Concretely, the runtime value checker has been moved to deon-value-check
, and the functions for converting between API and syntax representations of CSL code are now located in deon-language-runtime-converters
.
Some entity types for ContractOperations
have been renamed
Old |
New |
---|---|
Agent.String |
StringAgent |
Agent.Corda |
CordaAgent |
ContractId.String |
StringContractId |
ContractId.Corda |
CordaContractId |
Additionally, Convertible
has been renamed to ToApiValue
.
fromValue
has ledger specific implementations
The fromValue
function has been packaged into the com.deondigital.sic.EntityFromValue
interface which has two implementations:
restEntityFromValue
cordaEntityFromValue
Replace:
Event.fromValue(value)
With:
with(restEntityFromValue) {
with(Event) {
fromValue(value)
}
}
Symbol
and QualifiedName
have moved to a different package
The Kotlin types Symbol
and QualifiedName
and moved from com.deondigital.api
to com.deondigital.core.types
.
Kotlin code generated by sic
uses library for providing ContractOperations
Relevant for Kotlin projects that use sic
-generated code.
The decision of which ContractOperations
implementation to use with sic
is no longer made when invoking it (possibly via the Gradle plugin).
Instead, the code that sic
generates is parameterised in such a way that client code can choose one particular implementation of ContractOperations
, depending on the intended target.
We currently provide the RESTContractOperations
(via package com.deondigital:sic-rest-operations
) and CordaContractOperations
(via package com.deondigital:sic-corda-operations
).
Steps to migrate
Instead of using the previously generated
RESTContractOperations
/CordaContractOperations
classes, use the ones provided by one of the packagescom.deondigital:sic-rest-operations
orcom.deondigital:sic-corda-operations
. You need to add dependencies as appropriate:
dependencies {
implementation "com.deondigital:sic-rest-operations:${deon_version}"
// and/or:
implementation "com.deondigital:sic-corda-operations:${deon_version}"
}
Update the use-sites in your application code where you instantiate the code. For
RESTContractOperations
, go from this:
// Here, RESTContractOperations is generated and lives with the generated code.
val ops = org.foo.myContract.RESTContractOperations(restApiClient!!)
to this:
// Here, RESTContractOperations comes from the dependency
// com.deondigital:sic-rest-operations.
// The MyContractModule() is generated in org.foo.myContract.
val ops = com.deondigital.sic.RESTContractOperations(restApiClient, MyContractModule())
For
CordaContractOperations
it’s the same. Go from this:
val ops = org.foo.myContract.CordaContractOperations(
cordaRPCOps!!,
cordaContractHandler!!
)
to this:
val ops com.deondigital.sic.CordaContractOperations(
cordaRPCOps!!,
cordaContractHandler!!,
contractModule = MyContractModule()
)