# Changelog¶

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

## 0.74.0 - 2021-02-18¶

• New types for working with calendars and time: Period, Year, Month, YearMonth, Date, Time, DateTime, ZonedDateTime and ZoneOffset.
• Added support for terminating contracts on Corda.
• Added support for the 1/1 day count convention.

### Fixed¶

• New implementation of the Actual/Actual ICMA day count convention
• Fixed bug in ExecuteOperationsFlow in Corda that allowed event applications on behalf of an agent who is not the proposer of the transaction when combined with contract instantiations.
• Fixed bug in RestContractOperations.execute where exceptions were not serialized correctly.
• Type checking in atomic operations.

### Changed¶

• The DateTime type has been renamed to Instant. There is still a DateTime type, but it is different from the old one.
• Simplified core representation of template definitions.
• Make use of explicit functions to construct a runtime representation from an entrypoint and a list of values instead of relying on building up a contract AST.
• Don’t store contract AST in DbLedger in the Contracts table.
• Made sidebar in the demo webapp scroll independently of the CSL editor.
• Changed instantiation arguments to be a single value instead of list
• EntryPoint, instantationArgument and instantationTime have been moved to instantationDetails in the Contract object of DeonAPI.

## 0.73.1 - 2021-02-15¶

### Fixed¶

• Fixed a bug that prevented applications to upload attachments to Corda nodes twice.
• Made the artifact produced by the Gradle sic plugin byte-for-byte reproducible.

### Changed¶

• Use compiled declarations for named reports instead of recompiling.

## 0.73.0 - 2021-01-20¶

• A CorDapp example showing integration between a CSL contract and the Corda Token SDK.
• Added support for terminating contracts on DBLedger, which disallows applying further events on the contract.
• Entrypoints must no longer be specified as a template. The form contract entrypoint main = ... is now accepted.

### Fixed¶

• Type checking of contract instantiations has been fixed on Corda. Templates with missing entrypoint were previously accepted but are now rejected. Entrypoints using the new contract lambdas for taking instantiation parameters were previously rejected, but are now accepted.

### Changed¶

• The Gradle sic plugin now has the plugin id com.deondigital.gradle-sic-plugin. This is the name that should be used in an apply plugin: section in a Gradle build script.
• The Gradle sic plugin no longer builds a fat jar that includes csl-cordapp and csl-contracts-states. Instead, only the generated code and AST are included in the built jar.
• The demo webapp now has a drop-down with all entrypoints in a CSL declaration. Each entrypoint has a set of input forms derived from its parameter types for setting instantiation arguments.
• All internal serialization has been changed from JSON to the binary MessagePack format. This improves serialization and deserialization of contract state by an order of magnitude.
• QueryMonitor now responds to contract authorization requests from the query service (e.g., instantiation) in a non-blocking fashion and using its own threadpool to prevent concurrency issues.

## 0.72.0 - 2020-11-24¶

• Added the functions Math::ceiling, Math::floor, and Math::round to the standard library.
• Added support for atomic execution to DbLedger.
• Added the conversion Float::toInt to the standard library.
• Templates can now specify contract parameters that are contract functions.

### Changed¶

• Guarded recursive contract definitions are now allowed.
• Template application now requires the contract-parameter list to be given. Previously, given template T x = ... you could apply T with T 42, omitting the empty list of contract arguments. Now, you have to write T[] 42.
• Integers are now 64 bits, extending their range to the interval [-9223372036854775808, 9223372036854775807].
• Subdivided the com.deondigital.cordapp package namespace into states, flows, services, resources, client subpackages.
• Optimized execution of Corda flow (ExecuteOperationsFlow) to minimize overhead of copying ledger state and parsing non-essential declarations.

## 0.71.0 - 2020-11-05¶

• Added a QueryMonitor class for handling contract instantiation requests in sic-generated Corda applications.
• The deon-project file format now allows single-line comments starting with #.
• You can now write contract-lambdas with pattern matching.

### Fixed¶

• Fixed a bug in the gradle-sic-plugin which made it impossible to fetch dependencies that it injected into projects.

### Changed¶

• Template expression parameter syntax changed from (a, b, c) to a b c. The current syntax is still valid but denotes a tuple parameter instead.

## 0.70.0 - 2020-10-16¶

• CordaLedger now supports specification of groups of operations (contract instantiations and event applications) atomically iff the operations span the same participants and notary.
• CordaLedger now supports both anonymous and non-anonymous participants in contracts.
• All contract instantiations in CordaLedger now require authorization by the client and are not automatically accepted as before.
• The sic gradle plugin now tracks changes to CSL files.
• sic can now open the “file” - which causes it to read from stdin.
• Added support for instantiating Sum and Record types to the webapp.
• Added support for empty tuples.
• Added the Unit type as an alias to the empty tuple.
• The DbLedger can now distribute events and contracts to other read-only “subscriber instances” of DbLedger.
• Added a new Maven package com.deondigital.sic which wraps the sic binary for easier use in JVM based projects.

### Fixed¶

• Improved performance of the internal cache representation of events in DbLedger.
• Corrected an issue with CSL project files not having trailing whitespace.
• Fixed a bug in sic/Kotlin that made it impossible to instantiate entrypoints inside a module.
• Fixed a bug in the automatically generated equality functions for types involving a typealias parameter.
• Fixed a bug in sic/Kotlin that caused the generated code to crash the Kotlin compiler when a sufficiently long CSL source text was embedded.

### Changed¶

• Renamed the built-in type Contract to ContractInstance.
• Going forward, .jar artifacts are no longer published with a prefixed v or -SNAPSHOT modifier.
• Published .jar artifacts have been moved from nexus.deondigital.com to the Gitlab package registry. This requires an update to all build credentials.

## 0.69.0 - 2020-09-18¶

• The DbLedger now maintains a hash-chain on all events it stores to make it less easy to tamper with the underlying database.

### Fixed¶

• Fixed a bug that caused the DbLedger to not persist participant IDs correctly.

## 0.68.0 - 2020-09-10¶

• The standard library now has String::isEmpty function.
• Built-in Set data type with accompanying standard library functions.
• A new API end point /contracts/{id}/residual has been added which can be used to examine the current state of a contract.
• EventPredicate now contain a residualContract and corresponding environment, describing the state of the contract after the event is applied.
• The Corda contract manager now supports changing the set of participants in a running contract. A flow for this purpose can be instantiated from the API.
• The type checker will now emit warnings on unused local val, contract, and template definitions.

### Fixed¶

• Fixed a bug where CordaLedger.contractId was not initialized with contracts that had one or more events applied.
• Fixed a bug in the runtime value type checker that made it not check Map values.
• Removed the tagOrNull override in the jsonCodec for ContractUpdate as it was dead code, after an update to the webapp which fixed an issue with needing a refresh after instantiating a contract.

## 0.67.0 - 2020-08-10¶

• Added methods for subscribing to contracts and events added on Corda.

### Changed¶

• Corda flows to collect signatures and generate new identities have been optimized to improve performance of contract instantiation and event application.
• ContractOperations.getInstance now returns null when no instance is found instead of throwing ContractInstanceNotFound and throws ContractInstanceWrongType when trying to get contract as type A when the instance is actually of some other type B.

## 0.66.0 - 2020-06-26¶

• sic-generated Kotlin classes for CSL datatypes now contain custom toString() methods.

### Changed¶

• DbLedger now supplies the triggering event in the contractUpdated callback.
• CordaLedger now caches contract ids so it will not fetch all initial states on each report.
• Corda contract manager: Corda was upgraded from 4.4 to 4.5.

### Fixed¶

• Fixed a bug where pagination errors appeared during contract event application when the number of contract instances in the ledger exceeded the default page size (200).

## 0.65.0 - 2020-06-19¶

### Fixed¶

• Fixed bug where the exception CannotApplyEvent only contained the message null instead of the list of errors. This makes log messages more useful.

### Changed¶

• Corda contract manager: Agents returned from reports are now identified by their well-known keys instead of their confidential (randomized, pseudonoymous) keys.
• Corda contract manager: Applications can now run reports in a mode where agents are compared by their well-known identities instead of their confidential keys.

## 0.64.0 - 2020-05-28¶

### Fixed¶

• Fixed bug where sic generated TypeScript would generate different CordaAgent type than used in api-client.

### Changed¶

• DBLedger no longer checks for visibility/existence of contract-id values in inputs to reports. This is consistent with the behaviour on Corda.
• The demo webapp now has UI components for creating CSL Maps. The UI components for CSL List and Bool have been improved.

## 0.63.0 - 2020-05-20¶

### Changed¶

• Contracts and events on the DBLedger are now only visible to peers that are participants of the contract.
• The REST API has been split up into an anonymous API with endpoints that do not need the identity of the caller, and an identified API that does need it.

### Fixed¶

• Fixed a bug where sic generated TypeScript would crash at runtime due to circular imports.
• Fixed a bug where SecureHash in CordaEntity was not serialized correctly. This broke contract validation for contracts containing contract ids.

## 0.62.0 - 2020-05-07¶

• sic generated TypeScript now includes a CordaAgent variant of Agent.

### Removed¶

• The “AST view” in the demonstration webapp has been removed.
• The /contracts/{id}/tree API endpoint has been removed.

### Changed¶

• sic now generates a structured Agent object for TypeScript instead of a string for CSL Agent.

### Fixed¶

• Fixed a bug related to Kryo serialization where a Corda node would crash while suspending a flow trying to persist the stack frame.

## 0.61.0 - 2020-04-29¶

• Support for fully validating contract manager on Corda that keeps the full contract state on the ledger and checks for event validity on every event application.
• Support for batched application of CSL commands (instantiation and event application). Currently only batched event application are exposed by flows.
• Support for versioning, indexing and querying on contract state fields.
• Internal integration tests in cordapps that test contract verification, flows, vault storage and querying.
• It is now possible to publish generated CorDapps locally to make the development process simpler.

### Removed¶

• Unused resources model.

### Changed¶

• cordapp-examples do not use relocation any more.
• Simplified the implementation of the caches, flows, vault storage and retrieval functionality.

### Fixed¶

• Corrected a bug in the gradle-sic-plugin that caused it to fail when project files lacked a trailing newline.
• Corrected a bug in the gradle-sic-plugin that caused it to deadlock sometimes on MacOS.

## 0.60.0 - 2020-04-15¶

### Changed¶

• Upgraded Corda target platform from 4.0 to 4.4.
• TypeScript code generated by sic no longer adds equals/hashCode methods on Object.prototype.
• Significant performance improvements to the evaluator and contract executor. Tail-recursive contracts no longer get slower over time.

### Fixed¶

• Fixed a bug related to Kryo deserialization where a Corda node would crash if resuming a flow from a persisted snapshot.
• Fixed a bug in the derivation of derived equality functions that caused runtime exceptions when one derived an equality function for a constructor with fixed type parameters.

## 0.59.0 - 2020-03-27¶

### Changed¶

• The TypeScript code generated by sic now has better support for the immutable-js data structures, in particular the immutable.Map that CSL maps are represented as.
• sic generated contract operations for DbLedger now returns tags when applying events.
• Event agents are now validated against contract participants on DbLedger.

### Fixed¶

• The automatically generated equality functions do not depend on the standard library anymore.

## 0.58.0 - 2020-03-09¶

• sic now generates TypeScript classes for template entrypoints, including a static instantiate method.

### Changed¶

• CSL reports that are called externally (with, e.g., sic) must be marked with the new report keyword.
• Contract templates that are used as entrypoints (from, e.g., sic) must be marked with the new entrypoint keyword.
• Event application on the DbLedger through the API now always return a tag. Previously it was only when a tag was included in the input.

### Fixed¶

• Corrected a substitution bug the in report query language that caused wrong results whenever a variable unified with a term which itself contained variables.
• Corrected an issue in DbLedger that caused wrong external symbols to be used in event application.

## 0.57.0 - 2020-02-21¶

• The deondigital/vitznauerstock Docker image now includes drivers for PostgreSQL.
• sic now exposes a field instantiationTime on ContractInstance objects.
• The TypeScript code generated by sic now contains copy methods with named parameters for classes which represent CSL records.
• Built-in Map data type with accompanying standard library functions.
• sic now generates Kotlin classes for template entrypoints, including a static instantiate method.

### Changed¶

• The performance and disk usage of the DbLedger backend has been improved.

## 0.56.0 - 2020-02-10¶

• The Deon webservice now has the endpoint /declaration/{id}/namedReport for invoking a report in a declaration by its qualified name and a list of value arguments.

### Changed¶

• sic now reports a ContractInstanceNotFound instead of a general exception if a non-existing contract id is used in getContractInstance.
• the sic type ContractInstance now includes a function for retrieving nextEvents for a contract.
• nextEvents now include the event predicate and agent as an Exp type.

### Fixed¶

• Corrected a bug in the type checker that caused it to fail to reject = on records that contained fields for which we cannot use =.
• Corrected a bug that caused lists that are returned from queries to be wrongly encoded, thereby causing runtime errors.

## 0.55.0 - 2020-01-28¶

• Signature backend to sic that emits as JSON the types of all top-level declarations.

### Changed¶

• The API endpoints for running reports have been moved from /contracts/{id}/report (/contracts/report) to /declarations/{id}/report (/declarations/report), reflecting the fact that running a report requires just the declaration, not an instantiated contract.
• The object that represents an instantiated contract now includes the peers that were specified on instantiation.

### Fixed¶

• Fixed a bug that caused the surface-to-core translation to crash if one used = on a type alias for a built-in type.

## 0.54.0 - 2020-01-15¶

• sic and the gradle-sic-plugin now support deon-project for Corda and Kotlin.

### Changed¶

• The equality operator = now works on any closed type that does not contain function or Signed types.

### Removed¶

• The standard library functions Int::equals, Float::equals, String::equals, and DateTime::equals have all been removed.

## 0.53.0 - 2020-01-09¶

• New asynchronous API client.

### Changed¶

• Update the RESTContractOperations generated by sic to use the asynchronous API client.
• Reports and contract entrypoints that can be called from the outside must have monomorphic types.

### Fixed¶

• It is now possible to pass record values that are subtypes of the expected argument value to reports and template instantiations.

## 0.52.0 - 2019-12-03¶

• CSL now supports type annotations on top-level val declarations: val x : Int = 42.

### Changed¶

• The sic emitters for Kotlin and Corda now generate wrapper classes for the ledger-specific representations of Agent and ContractId to make it possible to use the same code on top of both DBLedger and Corda.
• The API type Contract now contains the fields entryPoint and instantiationArguments.
• The sic emitters for Kotlin and Corda generate the ContractOperations interface and RESTContractOperations/CordaContractOperations implementations which can be used to interact with the sic-generated contract API in a ledger-agnostic way.

## 0.51.0 - 2019-11-22¶

• The TypeScript code generated by sic now contain factory methods for creating objects with named parameters.
• The Kotlin code generated by sic now contains copy methods with named parameters for classes which represent CSL records.
• CSL now supports type aliases: typealias MyType a = Tuple a Int.

### Changed¶

• Ontology backend to sic was changed to output only type definitions instead of the internal contract descriptors of sic.
• Code generated by sic now inspects API values for their actual types when deserializing, instead of statically deserializing values to their indicated type. This means that a record MyEvent can be correctly deserialized from a value that is statically typed as Event but dynamically tagged as MyEvent.
• The gradle-sic-plugin has been updated to better handle multiproject builds.

## 0.50.0 - 2019-11-08¶

### Changed¶

• The csl-plugin has been removed. It is superseded by the new gradle plugin gradle-sic-plugin.
• sic output is now available when using --info with the gradle plugin.

### Fixed¶

• sic no longer generates optional parameters for the TypeScript target which caused problems when mixing optional and required parameters.

## 0.49.0 - 2019-10-29¶

• New record extension syntax for carrying over some of the fields of an existing record into a new one: R { use x with a = 1, b = 2 }.

### Fixed¶

• Corrected a bug that prevented instantiation of contracts with sic generated code on Corda nodes.

## 0.48.0 - 2019-10-24¶

• DateTime::dayCountFraction can now handle the Act/Act ICMA convention.

### Fixed¶

• Corrected a bug in toContractAST that caused a crash when working with nullable or branches.

### Changed¶

• The concept of “pseudo value” has been removed in favor of “external objects”. Bound names are no longer to be specified for agents, contracts, etc. represented as CSL values.
• The DateTime::dayCountFraction function now only takes one parameter. The usual from and to parameters should now be applied to the convention constructor. I.e. DateTime::dayCountFraction (DateTime::ActActISDA #2007-12-28# #2008-12-28#).

## 0.47.0 - 2019-10-10¶

### Fixed¶

• Corrected a bug in DayCountFraction calculations that occurred when start and end dates are in the same year.
• Fixed a bug in sic that caused it to not generate code for reports and entry points that use one of the built-in types as input or output types:
• Ordering,
• DateTime::DayOfWeek, DateTime::Components, DateTime::DayCountFraction,
• Event,
• Duration::Components,
• RuntimeError.

## 0.46.0 - 2019-09-27¶

### Removed¶

• The sic-maven-plugin has been removed. It is superseded by the gradle plugin csl-plugin.
• The standard library function getEvents has been removed.

## 0.45.0 - 2019-09-03¶

### Fixed¶

• Corrected a bug in DateTime::dayCountFraction.

### Changed¶

• Renamed DateTime::dayCountFraction convention Thirty360ISMA to Thirty360ICMA.

• A list of past events was added to the contract view in the webapp.

## 0.44.0 - 2019-09-03¶

• Added the standard library function DateTime::dayCountFraction that calculates Day Count Fraction for a number of conventions.

### Changed¶

• The sic “JSON” emitter has been renamed to “CoreAST”.

### Fixed¶

• Corrected a bug in the publication settings for one of the JAR dependencies which caused the generated CorDapps to break.

## 0.43.0 - 2019-08-19¶

• Ontology backend to sic that emits as JSON the intermediate contract descriptor used by the sic emitters.

### Changed¶

• The sic-generated Kotlin code does not generate an interface with *Impl class implementations, but just the class implementations directly without the *Impl suffix.
• The structure in multi-file deon-projects is now more closely reflected in sic-generated TypeScript/Kotlin code.
• Both the TypeScript and Kotlin code generated by sic introduces an addDeclaration function for putting a CSL declaration on the ledger. The instantiation classes now require a declaration id in their constructors.
• When sic outputs the JSON-representation of an AST to standard out it does not include the separator strings that are invalid JSON.

### Fixed¶

• Corrected a bug in the build setup that rendered the Maven-published JAR of deon-api-client unusable.

## 0.42.0 - 2019-08-05¶

• The LSP server now supports go to definition.
• Added an endpoint contracts/<contractID>/events to get the event that have been applied to a contract.

### Changed¶

• sic now writes multiple files instead of merging everything into one file. Dependencies on sic generated files will have to be updated accordingly: For TypeScript, the files are renamed; and for Kotlin projects, the generated namespace has changed.
• The helper functions for serialisation/deserialisation generated by TypeScript backend in sic have been refactored, so sic users will need to make a few changes to their TypeScript code. Instead of mkXValue and getX there are now methods X.toValue and X.fromValue. Also getAgent has been replaced by Agent.fromValue.

### Fixed¶

• Corrected the code that converts StateTree based residual contracts to their abstract syntax form.

## 0.41.0 - 2019-07-10¶

• The Visual Studio Code plugin now shows type information on mouse hover.

### Fixed¶

• Made sure the Gradle plugin for generating CorDapps includes everything needed to generate them correctly.
• Fixed a bug in the TypeScript emitter of sic where records using TypeScript keywords as field names would not function properly.

## 0.40.0 - 2019-06-28¶

• Initial version of the new Datalog-inspired query language.
• Gradle plugin to generate self-contained CorDapps directly from CSL code.
• A new backend to sic that emits parsed and compiled CSL syntax as a JSON-file.

### Changed¶

• Upgraded Kotlin runtime to 1.2.

### Removed¶

• The generic Corda ledger backend has been removed.
• The Hyperledger Fabric ledger backend has been removed.
• The special treatment of Evidence records has been removed from the Corda backend.
• The example oracle implementations have been deleted.
• The InMemory backend has been removed. It’s superseded by the DbLedger backend.

### Fixed¶

• Fixed an issue where the service would fail in an unexpected way when fed with certain invalid DateTimes.
• Fixed an issue where in some cases the type checker would not report error messages in expressions involving records.

## 0.39.0 - 2019-04-26¶

### Changed¶

• Added support for simple simplifications of contracts. The simplifications are used for the contracts presented in the webapp in the “Actions” and “Viewer” tab.

### Fixed¶

• Fixed an issue where lists in events (records) constructed from the webapp would not be handled correctly.
• Fixed an issue where the type checker would allow complex patterns at top-level. This is no longer allowed as it was in the old type checker.

## 0.38.0 - 2019-04-11¶

### Fixed¶

• Fixed an issue with floating point equality where numbers were not normalized.
• Functions can now be serialized which makes it possible to call templates with functions as arguments.

### Changed¶

• Contracts are now represented more efficiently on the ledger.
• The evaluator uses a new approach with a global environment instead of closures.

## 0.37.0 - 2019-04-10¶

### Fixed¶

• Fixed an issue with floating point arithmetic operations where they would not use decimal128 rounding.

## 0.36.0 - 2019-04-09¶

### Fixed¶

• Fixed an issue where the type checker would crash instead of reporting an error when a constructor pattern missed an argument.
• Fixed an issue where the language server would report errors in the wrong file.

### Changed¶

• The underlying representation of floating point numbers was changed to decimal128 from binary64, allowing more exact financial calculations.

## 0.35.0 - 2019-04-05¶

### Fixed¶

• Fixed an issue where a unary minus was not pretty printed correctly.
• Fixed an issue with applying events to contracts with inner lets

### Changed¶

• sic for TypeScript now generates classes instead of type aliases for records.

### Removed¶

• Removed the corda-light ledger backend. It was not being used and was obstructing further developments and randomly failing CI.

## 0.34.0 - 2019-03-21¶

### Fixed¶

• Fixed an issue in the new type checker where record projection, upcast and type case did not work as expected in certain cases.

## 0.33.0 - 2019-03-21¶

### Changed¶

• The type checker was replaced. It reports multiple error messages and returns an AST annotated with types.

## 0.32.0 - 2019-03-15¶

### Changed¶

• The sic tool now shows warnings on the console when it cannot generate entrypoints.
• We now disallow shadowing of names in CSL. Shadowing is only disallowed within each name kind. That means value expression names cannot shadow other value expression names but contracts and values can still use the same name.

## 0.31.0 - 2019-03-12¶

### Fixed¶

• Fixed a bug that caused a significant slowdown when evaluating some reports.

### Changed¶

• Record types in sic-generated code implements the subtyping hierarchy of the CSL source with native target language constructs.

## 0.30.0 - 2019-03-07¶

### Fixed¶

• Fixed an issue that caused the project structure of deon-project files to not be respected in some scenarios.
• Fixed a bug in the webapp where it would crash when adding a boolean argument to a report.
• Fixed an issue in the webapp where the wrong declarations were used for instantiating contracts in certain cases.

### Changed¶

• The contract composer in the webapp has a new layout.

## 0.29.0 - 2019-02-26¶

• Added sic-support for deon-project files.

### Fixed¶

• Fixed a bug that caused type errors in sic-generated TypeScript code with tuples.
• Fixed a bug that caused /simplify to crash on certain combinations of contract-parameters and pseudo-syntactic values.
• Fixed a bug in the agent matching algorithm that made it problematic to have agents with numbers in their name, such as agent1 and agent2.
• Fixed a bug in the webapp that prevented instantiation of contracts with multiple contract ID parameters.
• Fixed a bug in the webapp that made it crash when attempting to provide a DateTime argument to a report.
• Fixed a bug in the webapp where the contents of AST nodes could overflow if it was too large - now the full content will only be visible when the mouse is hovering over the node.

### Changed¶

• Declarations are identified by content hashes (SHA-256) instead of UUIDs.
• Upgraded Fabric to version 1.4.
• The data model for check errors (type errors, parse errors, etc.) has changed. See OpenAPI specification for the new model.

## 0.28.0 - 2019-01-15¶

• Add support for heterogeneous tuple values in CSL.
• Added support for event tags in sic. Kotlin sic users will need small adjustments to their code.

### Fixed¶

• Fixed an issue with serialization of websocket values.
• Fixed a performance issue in the /contracts endpoint that caused it to compute a lot of unnecessary data.

### Changed¶

• Updated the cache policy for static resources such as documentation and examples to prevent browsers from showing outdated versions.
• Updated webapp to react 16.7.0
• Changed default database backend from H2 to SQLite for the DBLedger.

## 0.27.0 - 2018-12-13¶

### Fixed¶

• Fixed duplications of agents on agent list on Fabric.
• Fixed too liberal type checking of signed data.

### Changed¶

• Upgraded Corda to version 3.3.
• Removed dependency on Jackson and improved performance of JSON serialization.

## 0.26.0 - 2018-12-03¶

• Added support for signing of structured data.

### Fixed¶

• Fixed an issue with instantiation with pseudo-syntactic values in records or lists.

### Changed¶

• Updated API specification to OpenAPI 3 format. The specification endpoint is changed from /v2/api-docs to /openapi.json.

## 0.25.1 - 2018-11-23¶

### Fixed¶

• Fixed a rendering issue with contract ids in the instantiation UI.

## 0.25.0 - 2018-11-22¶

• Added the power and square root functions; Math::pow and Math::sqrt to the standard library.

### Fixed¶

• sic: Fixed a bug in the conversion of values in the TypeScript backend.
• Fixed broken link to PDF language guide in the HTML language guide.
• Corrected an error in the UI Actions tab.

## 0.24.0 - 2018-11-19¶

### Changed¶

• sic: It is no longer necessary to wrap contract ids in the Kotlin interface for reports and event application.
• Changed layout of instantiation screen to handle templates with many arguments in the UI.

### Fixed¶

• Fixed a bug that caused the Kotlin API client to break when it was initialized with a request timeout.
• Fixed a bug when serializing durations with jackson.

## 0.23.0 - 2018-11-07¶

### Changed¶

• sic: Event application functions in Kotlin and TypeScript are no longer lower-cased but follow the capitalization of their CSL types.

### Fixed¶

• Fixed a bug in the TypeScript backend to sic that caused reports that return Pair or Maybe values to fail at runtime.
• Fixed a bug with event application that would sometimes cause a “variable not found in environment” error.
• Fixed a bug in the Kotlin backend to sic where the result would not compile when agents were compared.

### Removed¶

• The “Apply Event as Text” button has been removed from the webapp because it is no longer possible to construct an event value within the syntax of the language.

## 0.22.0 - 2018-10-10¶

• A new instantiation argument which resolves to the id of the instantiated contract has been added.
• The Visual Studio Code extension now supports projects spanning multiple CSL files (see the plugin’s README for more information).
• Tutorial section about the tool sic to the language guide.

### Fixed¶

• Fixed a bug that caused Corda nodes to fail when using lists in events.

### Changed¶

• Agents in contracts are no longer strings, but are abstract values issued by the ledger. Use the new /agents API to retrieve the available agent values.
• It is no longer possible to use the special variable events to refer to the events of the contract instance; use getEvents instead.
• Contracts::getEvents has been renamed to getEvents.
• It is no longer possible to redeclare top-level value bindings.
• Contract ids are no longer strings but instead abstract values of the type ContractId that cannot be constructed in syntax.

## 0.21.0 - 2018-09-21¶

• Web UI: Contract ID selector in “Reports” tab.
• It is now possible to specify a separate peers list for each contract instantiation in the code generated by sic.

### Fixed¶

• Fixed a bug where the webapp could not apply events containing data with qualified sum types.
• Fixed a bug in sic that caused empty CSL records to be handled wrong.

## 0.20.0 - 2018-09-14¶

• Lightweight implementation of Corda adapter where the notary is only used to ensure consensus on the ordering of events for contracts and not validity of the sequence of events.
• Added ISO 8601 compliant syntax for duration literals.
• Added built-ins and standard library functions for working with durations.

### Fixed¶

• Cucumber: ContractIDs are replaced in the expected results of Report tests.
• Fixed a bug in the scoping of event bindings in prefix expressions.

## 0.19.0 - 2018-08-31¶

• TypeScript backend to sic.
• Upgraded Corda to version 3.2.
• Upgraded Fabric to version 1.2.
• Added support for Fabric in deployment-tool.
• Support for batching in Kotlin-client.

### Changed¶

• It is now only possible to query Contracts::getEvents on contracts that are instantiated from the same declaration ID as the caller.
• Updated the formatting and structure of the CSL language guide and reference.

### Fixed¶

• Fixed a bug where agents represented by variables could be shadowed by bound event names.
• Fixed a bug in the serialization of contracts.
• Fixed a bug in sic that caused Kotlin code generated from CSL that used Floats to break.
• Fixed a bug in sic that caused it to generate invalid code due to keyword name clashes.
• Fixed a bug in the corda-adapter that could break the client-to-node communication under high load

## 0.18.0 - 2018-08-13¶

• Deployment tool.
• The code generation tool sic for automatically generating a Kotlin interface for a CSL contract.

### Changed¶

• Upgraded Corda to version 3.1.

### Fixed¶

• Fixed a bug that crashed the UI if the residual contract could not be computed.
• Fixed a bug where lists of events could not be converted from the internal to the external representation in some cases (like List::append events events).
• Fixed a bug in the web UI where events could not be applied as raw text.

## 0.17.0 - 2018-06-25¶

• The API methods /contracts and /contracts/{id} now return the instantiation time of the contract.
• The standard library now has a Maybe::bind function. See the documentation for details.
• A built-in function error : RuntimeError -> a has been added.

### Changed¶

• The API methods /contracts/report and /contracts/{id}/report now accept an optional list of Values that can be used as arguments for reports that take parameters.

### Removed¶

• The REST API clients have been moved to GitHub.

### Fixed¶

• A bug which caused the type checker to refuse references to previously declared templates from locally defined templates has been fixed.
• A bug where the simplifier would cause run-time errors to disappear has been fixed.
• Corrected a bug where server side errors could break the UI.

## 0.16.0 - 2018-06-05¶

### Changed¶

• The syntax for declaring contracts, templates and values has been changed. Recursive contract templates now have to be explicitly marked as so, and mutually recursive templates must be declared together. See the language guide for more information.
• The Add event button has been removed from the Viewer menu as it duplicates the functionality on Actions. Events can be added as raw text from Actions now.
• Removed the API method /parse-value that was equivalent to /report in taking an expression as string and returning a Value.
• Renamed the /contract/{id}/simplified endpoint to /contract/{id}/src endpoint and added an optional parameter simplified such that /contract/{id}/src?simplified=true returns the simplified residual contract and /contract/{id}/src returns the non-simplified residual contract.

### Fixed¶

• Fixed an issue in the (Kotlin) implementation of apply that could result in a crash from a stack overflow.

## 0.15.0 - 2018-05-28¶

• The UI now displays the current version number.

### Changed¶

• Performance of the CSL parser has been improved.
• Performance of report and expression evaluation has been improved.
• The endpoints /check, /check-expression, and /parse-value will now run type check on successfully parsed declaration parts even if there is a parse error later.

### Fixed¶

• Fixed a bug where the Visual Studio Code plugin was not in contact with the parser and type checker.

## 0.14.0 - 2018-05-17¶

• The standard library now has List::isEmpty function.

### Fixed¶

• The in-memory ledger and database-backed ledger backend now correctly handle tagged event application.

### Changed¶

• The Node.JS and web REST clients now support optional tags for applyEvent.
• Performance of the /checkEvent endpoint has been improved.

## 0.13.0 - 2018-05-14¶

• Events are now type checked before being applied to contracts.
• The web editor now supports comment toggling with Cmd-/ or Ctrl-/.
• Standard library function DateTime::dayOfWeek that gives the day of week (DateTime::DayOfWeek) for a DateTime.

## 0.12.0 - 2018-05-07¶

• The ontology for a CSL program now includes sum types in addition to record types.
• New event input form in “Actions” tab.
• New database-backed ledger backend with support for H2 and SQLite.
• Node.js REST client.
• Added new endpoints to submit contracts and events in batches for faster execution
• Convenience function to JavaScript SDK for handling Value objects as JSON data.

### Fixed¶

• Fixed a bug where applying many events to a contract could cause an exception.
• Fixed some bugs where a couple of endpoints in the API client NPM package did not work.
• Fixed bug where contract instantiation would result in an illegal contract due to a bug in the implementation of scoping.

### Changed¶

• Moved endpoint to simulate events, and added the possibility to simulate events across multiple contracts.
• When running reports, the optional parameter for declaration id is now an optional path parameter. The client SDK has been updated to reflect this.

## 0.11.0 - 2018-04-24¶

• Shorthand syntax for DateTime literals in CSL. The following all denote the same point in time: #2018#, #2018-01#, #2018-01-01#, #2018-01-01T00#, #2018-01-01T00:00#, #2018-01-01T00:00:00#, and #2018-01-01T00:00:00Z#.
• Added “guardedness check” to ensure that contracts do not contain infinite recursion.
• Support for unary minus.

### Fixed¶

• Fixed a bug where the UI’s pretty printing of DateTime values were not syntactically valid.
• Fixed bug where contract instances in the web app AST view were not simplified.
• Fixed bug where the order of arguments to constructors were reversed when converting from value to expression.

## 0.10.0 - 2018-04-18¶

• Contract abbreviations can now be defined in let blocks and top-level definitions.
• Contract templates with no contract parameters can now also be defined using the template keyword.
• CSL extension to Visual Studio Code.
• Node.js package with an API client.
• Contract examples are now available in the UI.
• Report examples in the language guide.
• Added type checking to contract instantiation, preventing you from passing illegal arguments to contracts.
• Added the possibility to run a simulation of event application without modifying a contract on the ledger.

### Fixed¶

• Fixed an issue where contract names and module names could be in conflict, thus causing bugs when applying events to those contracts.
• Changed the parser such that ranges of tokens don’t include trailing whitespace.

### Changed¶

• It is no longer possible to do comparison of strings like "a" > "b".
• Locations in error messages have been improved to be more specific.

## 0.9.0 - 2018-03-21¶

• Standard library extended with Int::toString function.

### Changed¶

• The /contracts/{id}/next-events and /contracts/{id}/tree endpoints will no longer surround agent matcher with < and >.

### Fixed¶

• Fixed an issue where result values from report evaluation were not rendered correctly.
• Fixed an issue where cross origin resource sharing (CORS) headers were not included in the webservice HTTP responses.
• Local contract and template declarations would not overwrite global ones in the type checker.

## 0.8.0 - 2018-03-13¶

• The UI now has a link to the OpenAPI (Swagger) documentation for the webservice API.
• Added GET /declarations/{id} endpoint to the webservice API.
• Reports and values are now type checked.
• Evaluation of reports independently of specific contract instances:
• Added POST /contracts/report endpoint to the webservice API for evaluating reports.
• “Reports” tab in UI has been updated with option to evaluate reports independently.
• The standard library now has String::append function.

### Changed¶

• The webservice API has been refactored and documented:
• Input/output models have new names, e.g. Declaration and Contract instead of NamedCSL and NamedContract.
• Contracts can only be instantiated with a declaration ID - not with a CSL string.
• Contract AST are now retrieved through /contracts/{id}/tree.
• Next events for contracts are now retrieved through /contracts/{id}/next-events.
• Endpoints now return HTTP codes 4XX when the input is invalid, e.g., 404 for invalid ID’s, 400 for failed type checking, etc.
• Input bodies are always objects with named fields.
• /templates endpoints are now /declarations endpoints.
• /peers and /ledgerInfo have been merged to /node-info.
• /csl is now /csl/check.
• /parseReport is now /csl/check-expression.
• /value is now /csl/parse-value.
• /{id}/ontology is now /declarations/{id}/ontology.
• /contract/{id}/report is now /contracts/{id}/report.
• OpenAPI (Swagger) documentation has been updated with examples and data models.
• Qualified named for Records, Lists, types are now sent as structured objects instead of strings, e.g. A::a is now {qualifier: ["A"], name: "a"}.
• The UI now refers to “declarations” instead of “templates”.

### Removed¶

• The DELETE endpoints /contracts/{id} and /templates/{id} have been removed from the webservice API.

### Fixed¶

• Fixed an issue where a contract could not be instantiated if a type with the same name is present.
• Fixed an encoding issue where some characters could not be used in CSL.
• Fixed a bug in the type checker where sum type constructors inside modules where globally scoped.

## 0.7.1 - 2018-03-12¶

### Fixed¶

• Fixed concurrency issue in InMemory-ledger.

## 0.7.0 - 2018-03-06¶

• Structural equality relations for lists of base types added to standard library.
• List shorthand: [1,2,3] is shorthand for Cons 1 (Cons 2 (Cons 3 Nil)).
• Upcast annotation (:>) for records, telling the type checker to consider a record expression as a super record, e.g. DeliveryEvent {...} :> Event.

### Fixed¶

• Fixed issues in relation to expansion of templates. template[c] Foo() = (<*> E then success) then c would not work as expected.
• Fixed issue where ((<*> E then success) or success) then C would accept C and become ((<*> E then success) or success) then success but it should have become simply success.

## 0.6.0 - 2018-02-23¶

• The UI now has a link to the language guide.
• The UI now has a link to the change log (this document).
• The language guide now contains a grammar for CSL.

### Changed¶

• Changed keyword fail to failure for consistency with success. Both success and failure are nouns.
• Prefix contracts do not include the then keyword. Therefore, the following two are now equivalent <*> E and <*> E then success.

### Fixed¶

• Fix a serialization issue between FabricLedgerService and chaincode.
• Removed argument field names at instantiation.

## 0.5.0 - 2018-02-13¶

• Support for the submission of event subtypes from the web UI if the contract’s ontology specifies them.
• Added new ledger service FabricLedgerService that supports CSL runtime on Hyperledger Fabric.
• Serve language-guide with webservice (http://webservice:8080/docs/guide.html).
• Parse and type errors are now highlighted in the web UI.

### Changed¶

• The Order type in the standard library has been renamed to Ordering.

### Fixed¶

• Significantly improve the speed with which contract source code is printed (roughly ~100x). This should improve the performance of cucumber tests.
• Fix a bug that made it impossible to instantiate contracts with DateTime parameters in the web UI.

## 0.4.0 - 2018-02-06¶

### Changed¶

• Updated the CSL standard library to version 0.2, with the following changes:
• Renamed module Time to DateTime, and Time::TimeComponents to DateTime::Components.
• Added DateTime::addDays.
• Added general combinators: id, const, flip.
• Added Pair, and projection functions fst, snd.
• Added Maybe with functions maybe, fromMaybe, Maybe::map, Maybe::isDefined, Maybe::any, Maybe::all.
• Added compareInt, compareFloat, and compareDateTime.
• Added the following functions to List module: head, headOrDefault, tail, length, map, mapMaybe, filter, zipWith, any, all, first, last, append, concat, reverse, take, drop.
• Indentation and formatting.
• The value parser now uses CSL2 syntax. This means events should be entered in CSL2 syntax with uppercase constructors e.g. True False Nil and Cons.

### Removed¶

• The CSL1 language level.

### Fixed¶

• Fix a bug that caused the ontology viewer to not be shown when a record type explicitly specified Record as its parent.

## 0.3.0 - 2018-02-05¶

• In com.deondigital.api a ConstructorValue is now available to create and read CSL-constructors applied to argument values.
• The reports tab would report an error when the result of a report contained any constructor which was not True, False, Nil or Cons.