github onflow/cadence v0.23.0

2 years ago

💥 Breaking Changes

  • Remove PublicKey.isValid by @robert-e-davidson3 in #1273, #1454

    The PublicKey constructor now validates the public key data and aborts the program if it is invalid.
    The isValid field was removed.

⭐ Features

  • Add converter functions to produce path values from strings by @dsainati1 in #1437, #1211

    Paths can now be constructed at run-time. The following path constructors were added:

    fun PublicPath(identifier: string): PublicPath?
    fun PrivatePath(identifier: string): PrivatePath?
    fun StoragePath(identifier: string): StoragePath?

    Each of these functions take an identifier and produce a path of the appropriate domain.
    For example, to construct a public path from a string:

    let pathID = "foo"
    let path = PublicPath(identifier: pathID) // is /public/foo

    For more information, see https://docs.onflow.org/cadence/language/accounts/#path-functions

  • Add RLP decoding utility methods by @ramtinms in #1397, #1456

    Cadence now provides RLP decoding functions through the built-in contract RLP.
    It provides the following functions for decoding strings and lists:

    fun decodeString(_ input: [UInt8]): [UInt8]
    fun decodeList(_ input: [UInt8]): [[UInt8]]

    For more information, see https://docs.onflow.org/cadence/language/built-in-functions/#rlp

  • Add index to for loop by @dsainati1 in #1216, #1452

    For-loops may now declare an indexing variable:

    for index, element in array {
        // ...
    }
  • Add BLS-specific crypto functions by @dsainati1 in #1236, #1250, #1430

    PublicKey gained a new function to verify a proof-of-possession:

    fun verifyPoP(_ proof: [UInt8]): Bool

    Cadence now provides BLS-specific functions through the built-in contract BLS.
    It provides the following functions:

    fun aggregateSignatures(_ signatures: [[UInt8]]): [UInt8]?
    fun aggregatePublicKeys(_ publicKeys: [PublicKey]): PublicKey?

    For more information, see https://docs.onflow.org/cadence/language/crypto/#bls

  • Adding tracing by @ramtinms in #1179, #1448

🛠 Improvements

🐞 Bug Fixes

🙌 New Contributors

Thank you to our new contributor, @robert-e-davidson3!

Full Changelog: v0.21.3...v0.23.0

Don't miss a new cadence release

NewReleases is sending notifications on new releases.