Skip to content

Releases: onflow/cadence

v0.10.3

04 Dec 17:15
Compare
Choose a tag to compare

⭐ Features

  • Add storage fields to accounts (#485)

πŸ›  Improvements

  • Flush the cache of the storage before querying the used storage amount (#486)

v0.11.2

30 Nov 18:33
Compare
Choose a tag to compare

⭐ Features

  • Extended debug (#464)

πŸ›  Improvements

  • Refactor address locations, make composite decoding backwards-compatible (#461)

v0.10.2

23 Nov 20:37
922f49a
Compare
Choose a tag to compare

⭐ Features

  • Extended debug (#463)

πŸ›  Improvements

  • Refactor address locations, make composite decoding backwards-compatible (#460)

v0.9.3

19 Nov 17:27
Compare
Choose a tag to compare

⭐ Features

  • Wrap errors to provide additional information (#451)

v0.11.1

09 Nov 18:18
Compare
Choose a tag to compare

🐞 Bug Fixes

  • Don't use the cache when deploying or updating account code (#447)

v0.10.1

06 Nov 18:14
Compare
Choose a tag to compare

🐞 Bug Fixes

  • Don't use the cache when deploying or updating account code (#447)

v0.11.0

13 Oct 23:10
Compare
Choose a tag to compare

πŸ’₯ 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 Server
    • monaco-languageclient-cadence: Language Server Protocol client for the the Monaco editor
    • cadence-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

  • Document resource identifiers (#394)
  • Document iteration over dictionary entries (#399)

πŸ“¦ Dependencies

v0.9.2

06 Oct 16:33
Compare
Choose a tag to compare

πŸ› οΈ Improvements

  • Panic with a dedicated error for array out of bounds access (#396)

v0.10.0

01 Oct 21:46
e0e3f92
Compare
Choose a tag to compare

πŸ’₯ Breaking Changes

Contract Deployment

This release adds support for deploying multiple contracts per account.
The API for deploying has changed:

⭐ Features

Enumerations

This release adds support for enumerations (#344).

For example, a days-of-the-week enum can be declared though:

enum Day: UInt8 {
    case Monday
    case Tuesday
    case Wednesday
    case Thursday
    case Friday
    case Saturday
    case Sunday
}

See the documentation for further details and examples.

Switch Statement

This release adds support for switch statements (#365).

fun describe(number: Int): String {
    switch number {
    case 1:
        return "one"
    case 2:
        return "two"
    default:
        return "other"
    }
}

See the documentation for further details and examples.

Code Formatter

Development of a code formatter has started, in form of a plugin for Prettier (#348).
If you would like to contribute, please let us know!

πŸ›  Improvements

  • Limitations on data structure complexity are now enforced when decoding and also when encoding storage data, e.g number of array elements, number of dictionary entries, etc. (#370)
  • Using the force-unwrap operator on a non-optional is no longer an error, but a hint is reported suggesting the removal of the unnecessary operation (#347)
  • Language Server: The features requiring a Flow client connection are now optional. This allows using the language server in editors other than Visual Studio Code, such as Emacs, Vim, etc. (#303)

🐞 Bug Fixes

  • Fixed the encoding of bignums in storage (#370)
  • Fixed the timing of recording composite-type explicit-conformances (#356)
  • Added support for exporting and JSON encoding/decoding of type values and capabilities (#374)
  • Added support for exporting/importing and JSON encoding/decoding of path values (#319)
  • Fixed the handling of empty integer literals in the checker (#354)
  • Fixed the non-storable fields error (#350)

πŸ“– Documentation

πŸ“¦ Dependencies

This release depends on a fork of the CBOR library that Cadence uses.
When importing Cadence in another Go codebase, add the following statement to the go.mod file:

replace github.com/fxamacker/cbor/v2 => github.com/turbolent/cbor/v2 v2.2.1-0.20200911003300-cac23af49154

v0.9.0

23 Sep 17:15
Compare
Choose a tag to compare

πŸ›  Improvements

  • Add struct as supported event parameter type (#364)
  • Make recursive types storable (#329)
  • Suggest replacing number conversion function calls (#346)

⭐ Features

  • Add map function for optionals (#299)

πŸ’₯ Breaking Changes

  • Require an explicit type annotation for variable declarations with empty literal expressions (#345)

🐞 Bug Fixes

  • Fix parsing of right bitwise shift and function invocation where type argument is instantiation (#378)

πŸ“– Documentation