0.19.0
This release focuses on introducing a framework for property-testing and adding many foundational property tests. Azle has never been subjected to more automated testing than with this release.
We also introduce the concept of a Serializable
object and change StableBTreeMap
to accept arbitrary Serializable
objects. A default (and much more performant than CandidType
objects) stableJson
Serializable
object has also been introduced. See The Azle Book and the examples for more info.
Breaking Changes
StableBTreeMap uses Serializable objects
By default a StableBTreeMap
will use the stableJson
Serializable
to store and retrieve data to and from stable memory. Each CandidType
object is also a Serializable
. If you want to continue using your StableBTreeMap
s that you've already created without migrating them, then you'll need to manually do so:
Before
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap(nat8, text, 0);
Now
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap<nat8, text>(0, nat8, text);
StableBTreeMap parameters
The parameters for StableBTreeMap
have changed. The memory id
is now the first parameter, and the two following parameters are optional and by default are set to stableJson
.
Before
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap(nat8, text, 0);
Now
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap<nat8, text>(0);
StableBTreeMap float64
By default (using the built-in stableJson
) float64
values stored in a StableBTreeMap
may have issues because of this bug: bellard/quickjs#206
StableBTreeMap types
StableBTreeMap
types are no longer inferred, you must explicitly set them as type arguments to StableBTreeMap
:
Before
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap(nat8, text, 0);
Now
import { nat8, StableBTreeMap, text } from 'azle';
let map = StableBTreeMap<nat8, text>(0);
What's Changed
- Multiple property test rounds by @lastmjs in #1405
- Property tests blob by @lastmjs in #1407
- add property tests for opt by @lastmjs in #1410
- Property tests bool by @bdemann in #1408
- Property tests float32 by @bdemann in #1409
- Property tests float64 by @bdemann in #1411
- Property tests null by @bdemann in #1413
- Property tests string by @bdemann in #1412
- Property test num runs by @lastmjs in #1418
- Property tests more error info by @lastmjs in #1419
- add test support for NaNs and infinities by @bdemann in #1420
- Property tests foundation by @lastmjs in #1389
- Add principal property tests by @dansteren in #1422
- Property tests opt by @bdemann in #1424
- Add property tests for Variants by @dansteren in #1427
- Property test new structure by @bdemann in #1428
- Record property test by @dansteren in #1430
- update arbitries to have their own equals method by @bdemann in #1431
- Prettier property tests by @dansteren in #1433
- Add property tests for Tuples by @bdemann in #1434
- Property test literals by @bdemann in #1435
- Add property test for Funcs by @dansteren in #1436
- use candidType everywhere by @bdemann in #1437
- Minor stylistic fixes by @dansteren in #1438
- Property test candid types by @bdemann in #1425
- Property test deep equal by @bdemann in #1442
- Service property test by @dansteren in #1444
- Stable json by @lastmjs in #1446
- refactor CandidType and Serializable by @lastmjs in #1447
- Typeof tstype by @lastmjs in #1448
- String serde for bigint by @lastmjs in #1449
- Property test arbitrary depth variant by @bdemann in #1454
- Stable b tree map performance tests by @lastmjs in #1450
- Reduced code duplication across query method tests by @dansteren in #1457
- Add VS Code Extensions and Editorconfig by @dansteren in #1459
- Test: Added support for standalone query method callbacks by @dansteren in #1463
- Test: Update Canister to accept update methods by @dansteren in #1466
- Change Arbitraries to functions by @bdemann in #1465
- Property test vec new approach by @bdemann in #1467
- Test: Add CanisterConfigArb by @dansteren in #1469
- Filter js and azle keywords from arbitrary names by @bdemann in #1473
- Stable b tree map property tests by @lastmjs in #1451
- final StableBTreeMap tests by @lastmjs in #1475
- tighten Vec() type parameter, change stablebtreemap randomness from 1… by @lastmjs in #1484
- use stableJson everywhere by @lastmjs in #1485
- add CandidTypeObject tests to StableBTreeMap property tests by @lastmjs in #1486
- Console log by @lastmjs in #1487
- add implementation and tests for pagination for items and keys by @lastmjs in #1489
- update to dfx 0.15.2 by @lastmjs in #1491
- attempt to solve the Principal import issue by importing IDL and Prin… by @lastmjs in #1493
- use the deep-equal library instead of the fast-equals library to over… by @lastmjs in #1495
- 0 19 0 fixes by @lastmjs in #1500
- 0 19 0 fixes by @lastmjs in #1505
- Release 0.19.0 rc.5 by @lastmjs in #1503
- Release 0.19.0 rc.6 by @lastmjs in #1504
- fixing the test.yml by @lastmjs in #1507
Full Changelog: 0.18.6...0.19.0