-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs found during property testing #1388
Comments
The |
null was not handled correctly in the StableJson replacer and reviver |
|
|
|
Did not account for NaN is stableJson |
Did not account for Infinity and -Infinity in stableJson |
Services must have their properties sorted alphabetically. See https://forum.dfinity.org/t/services-wont-deserialize-properly-if-functions-arent-in-alphabetical-order/20885/14. It's supposedly fixed by @dfinity/agent v0.20.0, we just need to update to that version. |
The DFX CLI has a bug where it requires variants to have at least one field. The spec says that it's fine (as far as I could tell) but the CLI doesn't allow it. See property_tests/arbitraries/candid/constructed/variant_arb/definition_arbs.ts. Note No issue has been made for this yet. I could use advice on where to open this issue. |
The thing where empty tuples get returned as {} and not [] yet if you try to pass in an empty tuple {} as a parameter dfx will break. Consistency would be great and allow us to only have one value instead of an agentArgumentValue and an agentResponseValue |
import { Canister,query,update,Void,bool,int64,Principal,float64,blob,int16,Func,int,int32,Opt,Some,None,text,nat32,Vec,nat8,Tuple,Record,nat16,nat,Variant,int8,nat64,float32 } from 'azle';
import { deepEqual } from 'fast-equals';
// TODO solve the underlying principal problem https://github.com/demergent-labs/azle/issues/1443
import { Principal as DfinityPrincipal } from '@dfinity/principal';
const w2t8l3C = Void;
const _XQA61 = bool;
const KF4Kt = int64;
const T2ma2g1 = int64;
const _m4Y = Principal;
const _m3s = Principal;
const _av = int;
const _hYZ6k5e = Void;
const bz9GH0 = nat32;
const S6n8at = bool;
const _K6w = Vec(nat8) |
Tuple tests are failing on main Running test: tuple _3tSBU2qr
test: tuple _3tSBU2qr passed
src/index.ts 1011ms
Uninstalling code for canister canister, with canister_id bkyz2-fmaaa-aaaaa-qaaaq-cai
Deploying: canister
All canisters have already been created.
Building canisters...
Executing 'npx azle canister'
Building canister canister
TypeError: Cannot use 'in' operator to search for 'azleName' in undefined
at toIdl (evalmachine.<anonymous>:98198:20)
at toIdlArray (evalmachine.<anonymous>:98213:21)
at Object.getIdl (evalmachine.<anonymous>:98714:76)
at toIdl (evalmachine.<anonymous>:98207:23)
at evalmachine.<anonymous>:98211:41
at Array.map (<anonymous>)
at toIdlArray (evalmachine.<anonymous>:98211:28)
at Object.getIdl (evalmachine.<anonymous>:98714:37)
at toIdl (evalmachine.<anonymous>:98207:23)
at evalmachine.<anonymous>:98392:20
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
The build step failed for canister 'bkyz2-fmaaa-aaaaa-qaaaq-cai' (canister) with an embedded error: Failed to build custom canister canister.: Failed to run npx azle canister.: The custom tool failed.
Error: Property failed after 2 tests |
During the initial phases of property testing, we have discovered that not all JavaScript function names can be Rust function names. The developer could create a valid canister method, and the Rust macro would break.
This should be solved if we can get rid of the Rust environment by shipping a Wasm to the developer and using indexes to call into functions. Otherwise we'd have to somehow map JS function names to Rust names.
The text was updated successfully, but these errors were encountered: