Closed
Description
openedon Jul 15, 2020
Context
New features have been added to Cadence in the last few releases.
Update the documentation and describe the new features
Definition of Done
- Querying block information
-
Get the current block:
fun getCurrentBlock(): Block
-
Get a block at a given height:
fun getBlock(at height: UInt64): Block?
-
The block info is:
struct Block { let id: [UInt8; 32] let height: UInt64 let timestamp: UFix64 }
-
- Crypto contract
- Typed capabilities
- Run-time Types
- Addresses size (8 instead of 20 bytes)
- Parameters for transactions and scripts
-
fun toString(): String
was added for all number types and addresses -
fun toBytes(): [UInt8]
was added toAddress
-
fun toBigEndianBytes(): [UInt8]
was added to all number types. - Fields which have a non-storable type are now rejected:
Non-storable types are:- Functions (e.g.
((Int): Bool)
) - Accounts (
AuthAccount
/PublicAccount
) - Transactions
Void
- Functions (e.g.
-
String.decodeHex(): [Int]
→String.decodeHex(): [UInt8]
-
AuthAccount.addPublicKey(publicKey: [Int])
→AuthAccount.addPublicKey(publicKey: [UInt8])
-
AuthAccount.setCode(code: [Int])
→AuthAccount.setCode(code: [UInt8])
- Conformance check now allows subtype for return type
- Type hierarchy
-
unsafeRandom
- Account creation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment