diff --git a/canister_templates/experimental.wasm b/canister_templates/experimental.wasm index f47f454d2a..8c5a7d758c 100644 Binary files a/canister_templates/experimental.wasm and b/canister_templates/experimental.wasm differ diff --git a/canister_templates/stable.wasm b/canister_templates/stable.wasm index c05d03ad8d..1d49bfb4a1 100644 Binary files a/canister_templates/stable.wasm and b/canister_templates/stable.wasm differ diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/.gitignore b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/.gitignore similarity index 89% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/.gitignore rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/.gitignore index b2eb1501d7..1ea6144a79 100644 --- a/examples/stable/test/property/canister_methods/on_low_wasm_memory/.gitignore +++ b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/.gitignore @@ -3,3 +3,4 @@ node_modules dist dfx_generated +!src diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/dfx.json b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/dfx.json similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/dfx.json rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/dfx.json diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/jest.config.js b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/jest.config.js similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/jest.config.js rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/jest.config.js diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/package-lock.json b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/package-lock.json similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/package-lock.json rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/package-lock.json diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/package.json b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/package.json similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/package.json rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/package.json diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/src/index.ts b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/src/index.ts similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/src/index.ts rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/src/index.ts diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/test/dfx.ts b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/dfx.ts similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/test/dfx.ts rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/dfx.ts diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/test/test.ts b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/test.ts similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/test/test.ts rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/test.ts diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/test/tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/tests.ts similarity index 75% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/test/tests.ts rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/tests.ts index d60b22b0e1..15d07dee55 100644 --- a/examples/stable/test/property/canister_methods/on_low_wasm_memory/test/tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/tests.ts @@ -1,12 +1,6 @@ import { Principal } from 'azle'; import { getCanisterId } from 'azle/dfx'; -import { - defaultPropTestParams, - expect, - it, - runAndProvideReproduction, - Test -} from 'azle/test'; +import { defaultPropTestParams, expect, it, Test } from 'azle/test'; import fc from 'fast-check'; import { deployFreshCanister, getCanisterStatus } from './dfx'; @@ -18,44 +12,39 @@ const CANISTER_NAME = 'canister'; export function getTests(): Test { return () => { it('should trigger low memory handler when memory limit is approached', async () => { - await runAndProvideReproduction(async () => { - await fc.assert( - fc.asyncProperty( - fc.integer({ min: 0, max: 100 }), - fc.integer({ - min: 90 * 1024 * 1024, // 90 MiB in bytes (about the smallest size of this azle canister) - max: HARD_LIMIT - }), - async ( - wasmMemoryThresholdPercentage, + await fc.assert( + fc.asyncProperty( + fc.integer({ min: 0, max: 100 }), + fc.integer({ + min: 90 * 1024 * 1024, // 90 MiB in bytes (about the smallest size of this azle canister) + max: HARD_LIMIT + }), + async (wasmMemoryThresholdPercentage, wasmMemoryLimit) => { + // Calculate actual threshold based on percentage + const wasmMemoryThreshold = Math.floor( + wasmMemoryLimit * + (wasmMemoryThresholdPercentage / 100) + ); + + const actor = await deployFreshCanister( + CANISTER_NAME, + wasmMemoryThreshold, wasmMemoryLimit - ) => { - // Calculate actual threshold based on percentage - const wasmMemoryThreshold = Math.floor( - wasmMemoryLimit * - (wasmMemoryThresholdPercentage / 100) - ); - - const actor = await deployFreshCanister( - CANISTER_NAME, - wasmMemoryThreshold, - wasmMemoryLimit - ); - - await validateInitialStatus(actor, wasmMemoryLimit); - - await addBytesUntilLimitReached(actor); - - await validateFinalStatus( - actor, - wasmMemoryLimit, - wasmMemoryThreshold - ); - } - ), - defaultPropTestParams() - ); - }); + ); + + await validateInitialStatus(actor, wasmMemoryLimit); + + await addBytesUntilLimitReached(actor); + + await validateFinalStatus( + actor, + wasmMemoryLimit, + wasmMemoryThreshold + ); + } + ), + defaultPropTestParams() + ); }); }; } diff --git a/examples/stable/test/property/canister_methods/on_low_wasm_memory/tsconfig.json b/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/tsconfig.json similarity index 100% rename from examples/stable/test/property/canister_methods/on_low_wasm_memory/tsconfig.json rename to examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/tsconfig.json diff --git a/examples/stable/test/property/ic_api/canister_self/package-lock.json b/examples/stable/test/property/ic_api/canister_self/package-lock.json index 358bf7e1cf..13be8d3efa 100644 --- a/examples/stable/test/property/ic_api/canister_self/package-lock.json +++ b/examples/stable/test/property/ic_api/canister_self/package-lock.json @@ -1,5 +1,5 @@ { - "name": "id", + "name": "canister_self", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index ce57f9cdb9..ba89a8424e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ }, "devDependencies": { "@dfinity/identity": "^2.2.0", - "@eslint/js": "^9.19.0", + "@eslint/js": "^9.20.0", "@types/deep-equal": "^1.0.4", "@types/fs-extra": "11.0.4", "@types/pako": "^2.0.3", @@ -54,14 +54,14 @@ "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "deep-equal": "^2.2.3", - "eslint": "^9.19.0", + "eslint": "^9.20.0", "eslint-config-prettier": "^10.0.1", "eslint-plugin-simple-import-sort": "^12.1.1", "fast-check": "^3.23.2", "husky": "9.1.7", "jest": "^29.7.0", "lint-staged": "15.4.3", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "puppeteer": "^24.2.0", "semver": "^7.7.1", "ts-jest": "^29.1.4", @@ -1124,9 +1124,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.19.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.19.0.tgz", - "integrity": "sha512-rbq9/g38qjfqFLOVPvwjIvFFdNziEC5S65jmjPw5r6A//QH+W91akh9irMwjDN8zKUTak6W9EsAv4m/7Wnw0UQ==", + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", + "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", "dev": true, "license": "MIT", "engines": { @@ -4034,18 +4034,18 @@ } }, "node_modules/eslint": { - "version": "9.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.19.0.tgz", - "integrity": "sha512-ug92j0LepKlbbEv6hD911THhoRHmbdXt2gX+VDABAW/Ir7D3nqKdv5Pf5vtlyY6HQMTEP2skXY43ueqTCWssEA==", + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.0.tgz", + "integrity": "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.10.0", + "@eslint/core": "^0.11.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.19.0", + "@eslint/js": "9.20.0", "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -4142,6 +4142,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/core": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -7481,10 +7494,11 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 530b65a9db..0be6d6b75b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "devDependencies": { "@dfinity/identity": "^2.2.0", - "@eslint/js": "^9.19.0", + "@eslint/js": "^9.20.0", "@types/deep-equal": "^1.0.4", "@types/fs-extra": "11.0.4", "@types/pako": "^2.0.3", @@ -67,14 +67,14 @@ "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "deep-equal": "^2.2.3", - "eslint": "^9.19.0", + "eslint": "^9.20.0", "eslint-config-prettier": "^10.0.1", "eslint-plugin-simple-import-sort": "^12.1.1", "fast-check": "^3.23.2", "husky": "9.1.7", "jest": "^29.7.0", "lint-staged": "15.4.3", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "puppeteer": "^24.2.0", "semver": "^7.7.1", "ts-jest": "^29.1.4",