💥 Breaking Changes
-
Remove
PublicKey.isValid
by @robert-e-davidson3 in #1273, #1454The
PublicKey
constructor now validates the public key data and aborts the program if it is invalid.
TheisValid
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
🛠 Improvements
-
Refactor account storage to use atree ordered maps by @turbolent in #1248, #1404 #1391
This storage format change will allow adding a storage querying API in the future.
-
Expand interpreter tracing for composite, array and dictionary types by @ramtinms in #1450, #1468
-
Bump onflow/atree to v0.2.0 by @fxamacker in #1470
This updates Cadence to the latest version of atree.
-
Improve BLS API by @turbolent in #1417
-
Improve RLP API by @turbolent in #1423
🐞 Bug Fixes
- Make error reporting in contract update validation deterministic by @turbolent in #1420, #1428
🙌 New Contributors
Thank you to our new contributor, @robert-e-davidson3!
Full Changelog: v0.21.3...v0.23.0