Releases: onflow/cadence
v0.12.0
β Features
- Add
getType
function (#493): It is now possible to get the run-time type of a value - Flush the cache of the storage before querying the used storage amount (#480)
- Structured type identifiers (#477)
- Allow host environment to predeclare values, predicated on location (#472)
- Add a visitor for interpreter values (#449)
- Add support for imports in WASM writer and reader (#368)
- Add support for coverage reports (#465)
- Add storage fields to accounts (#439)
- Implement
fmt.Stringer
forcadence.Value
(#434) - Add a function to parse a literal with a given target type (#417)
π Improvements
- Extend event parameter types and dictionary key types (#497)
- Optimize composite and interface static types (#489)
- Optimize composite values (#488)
- Fix the export of static types (#487)
- Improve error pretty printing (#481)
- Improve fixed-point multiplication and division (#490)
- Improve error messages for contract deployment name argument checks (#475)
- Add a test for decoding a struct with an address location without name (#469)
- Refactor address locations, make composite decoding backwards-compatible (#457)
- Improve error message when there are constructor argument (#455)
- Make AST thread-safe (#440)
- Add position information to interpreter errors (#424)
π Bug Fixes
- Declare new contract's nested values before evaluating initializer (#504)
- Infer address location name from type ID for static types (#468)
- Fix optional value's type function (#458)
- Don't use the cache when deploying or updating account code (#447)
- Properly handle unspecified variable kind (#441)
- Prevent resource loss in failable downcasts (#426)
π₯ Breaking Changes
This release contains no source-breaking changes for Cadence programs, but the following breaking changes when embedding Cadence:
π Documentation
v0.10.4
v0.10.3
v0.11.2
v0.10.2
v0.9.3
v0.11.1
v0.10.1
v0.11.0
π₯ Breaking Changes
Typed Paths (#403)
Paths are now typed. Paths in the storage domain have type StoragePath
, in the private domain PrivatePath
, and in the public domain PublicPath
. PrivatePath
and PublicPath
are subtypes of CapabilityPath
. Both StoragePath
and CapabilityPath
are subtypes of Path
.
Path | |||
CapabilityPath | StoragePath | ||
PrivatePath | PublicPath |
Storage API (#403)
With paths being typed, it was possible to make the Storage API type-safer and easier to use: It is now statically checked if the correct type of path is given to a function, instead of at run-time, and therefore capability return types can now be non-optional.
The changes are as follows:
For PublicAccount
:
-
old:
fun getCapability<T>(_ path: Path): Capability<T>?
new:fun getCapability<T>(_ path: PublicPath): Capability<T>
-
old:
fun getLinkTarget(_ path: Path): Path?
new:fun getLinkTarget(_ path: CapabilityPath): Path?
For AuthAccount
:
-
old:
fun save<T>(_ value: T, to: Path)
new:fun save<T>(_ value: T, to: StoragePath)
-
old:
fun load<T>(from: Path): T?
new:fun load<T>(from: StoragePath): T?
-
old:
fun copy<T: AnyStruct>(from: Path): T?
new:fun copy<T: AnyStruct>(from: StoragePath): T?
-
old:
fun borrow<T: &Any>(from: Path): T?
new:fun borrow<T: &Any>(from: StoragePath): T?
-
old:
fun link<T: &Any>(_ newCapabilityPath: Path, target: Path): Capability<T>?
new:fun link<T: &Any>(_ newCapabilityPath: CapabilityPath, target: Path): Capability<T>?
-
old:
fun getCapability<T>(_ path: Path): Capability<T>?
new:fun getCapability<T>(_ path: CapabilityPath): Capability<T>
-
old:
fun getLinkTarget(_ path: Path): Path?
new:fun getLinkTarget(_ path: CapabilityPath): Path?
-
old:
fun unlink(_ path: Path)
new:fun unlink(_ path: CapabilityPath)
β Features
-
Add a hash function to the crypto contract (#379)
-
Added npm packages for components of Cadence. This eases the development of developer tools for Cadence:
cadence-language-server
: The Cadence Language Servermonaco-languageclient-cadence
: Language Server Protocol client for the the Monaco editorcadence-parser
: The Cadence parser
In addition, there are also examples for the language server and the parser that demonstrate the use of the packages.
-
Add a command to the language server that allows getting the entry point (transaction or script) parameters (#406)
π Improvements
- Allow references to be returned from from scripts (#400)
- Panic with a dedicated error for out of bounds array index (#396)
π Documentation
π¦ Dependencies
- The changes to the CBOR library have been merged, so the
replace
statement that was necessary in the last release must be removed.