v0.14.0
This release introduced a new high-level Account Key API and improves the interpreter performance.
The current low-level Account Key API is now deprecated and will be removed in a future release. Please switch to the new one.
The following example transaction demonstrates the functionality:
transaction {
prepare(signer: AuthAccount) {
let newPublicKey = PublicKey(
publicKey: "010203".decodeHex(),
signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
)
// Add a key
let addedKey = signer.keys.add(
publicKey: newPublicKey,
hashAlgorithm: HashAlgorithm.SHA3_256,
weight: 100.0
)
// Retrieve a key
let sameKey = signer.keys.get(keyIndex: addedKey.keyIndex)
// Revoke a key
signer.keys.revoke(keyIndex: addedKey.keyIndex)
}
}
β Features
- Introduce a new high-level Account Key API (#633) @SupunS
- Allow the Language Server to be debugged (#663) @turbolent
π₯ Breaking Changes
The Crypto
contract has changed in a backwards-incompatible way, so the types and values it declared could be used in the new Account Key API:
-
The struct
Crypto.PublicKey
was replaced by the new built-in global structPublicKey
.
There is no need anymore to import theCrypto
contract to work with public keys. -
The struct
Crypto.SignatureAlgorithm
was replaced with the new built-in global enumSignatureAlgorithm
.
There is no need anymore to import theCrypto
contract to work with signature algorithms. -
The struct
Crypto.HashAlgorithm
was replaced with the new built-in global enumHashAlgorithm
.
There is no need anymore to import theCrypto
contract to work with hash algorithms. -
The signature algorithm value
Crypto.ECDSA_Secp256k1
was replaced with the new built-in enum caseSignatureAlgorithm.ECDSA_Secp256k1
-
The signature algorithm value
Crypto.ECDSA_P256
was replaced with the new built-in enum caseSignatureAlgorithm.ECDSA_P256
-
The hash algorithm
Crypto.SHA3_256
was replaced with the new built-in enum caseHashAlgorithm.SHA3_256
-
The hash algorithm
Crypto.SHA2_256
was replaced with the new built-in enum caseHashAlgorithm.SHA2_256
π Improvements
- Add support for importing enum values (#672) @SupunS
- Optimize interpreter: Make invocation location ranges lazy (#685) @turbolent
- Optimize interpreter activations (#673) @turbolent
- Optimize integer conversion (#677) @turbolent
- Optimize interpreter: Evaluate statements and declarations directly, remove trampolines (#684) @turbolent
- Optimize interpreter: Move statement evaluation code (#683) @turbolent
- Optimize interpreter: Move evaluation of expressions and statements to separate files (#682) @turbolent
- Optimize interpreter: Evaluate expressions directly without trampolines (#681) @turbolent
- Optimize interpreter: Refactor function invocations to return a value instead of a trampoline (#680) @turbolent
- Optimize interpreter: Evaluate binary expressions directly (#679) @turbolent
π Bug Fixes
- Add support for exporting enums (#669) @SupunS
- Ensure code is long enough when extracting excerpt (#690) @turbolent