From 650af54919d881002c2bc4e4a1b6f86f94b178d4 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Mon, 25 Sep 2023 10:33:02 -0500 Subject: [PATCH] refactor list of lists --- .github/workflows/test.yml | 4 +- examples/list_of_lists/dfx.json | 3 +- examples/list_of_lists/package-lock.json | 481 +++++------------- examples/list_of_lists/package.json | 8 +- examples/list_of_lists/src/index.ts | 309 ++++++----- examples/list_of_lists/test/test.ts | 4 +- examples/manual_reply/dfx.json | 3 +- examples/manual_reply/test/test.ts | 4 +- .../visitors/encode_decode/decode_visitor.ts | 2 +- .../visitors/encode_decode/encode_visitor.ts | 2 +- 10 files changed, 287 insertions(+), 533 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66c388d159..97938d6e5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,9 +17,7 @@ # "examples/complex_types", # "examples/func_types", # "examples/generics", -# "examples/key_value_store", # "examples/ledger_canister", -# "examples/list_of_lists", # "examples/management_canister", # "examples/manual_reply", # "examples/motoko_examples/calc", @@ -113,6 +111,8 @@ jobs: "examples/init", "examples/imports", "examples/inspect_message", + "examples/key_value_store", + "examples/list_of_lists", "examples/primitive_types", "examples/principal", "examples/query", diff --git a/examples/list_of_lists/dfx.json b/examples/list_of_lists/dfx.json index 4407bb6d6c..2b5185954b 100644 --- a/examples/list_of_lists/dfx.json +++ b/examples/list_of_lists/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/index.ts", "candid": "src/index.did", - "wasm": ".azle/list_of_lists/list_of_lists.wasm.gz", + "wasm": ".azle/list_of_lists/list_of_lists.wasm", + "gzip": true, "declarations": { "output": "dfx_generated/list_of_lists", "node_compatibility": true diff --git a/examples/list_of_lists/package-lock.json b/examples/list_of_lists/package-lock.json index 474d9b088d..25453901dc 100644 --- a/examples/list_of_lists/package-lock.json +++ b/examples/list_of_lists/package-lock.json @@ -8,10 +8,10 @@ "azle": "0.17.1" }, "devDependencies": { - "@dfinity/agent": "0.14.1", - "fast-equals": "4.0.3", - "ts-node": "10.7.0", - "typescript": "4.6.3" + "@dfinity/agent": "^0.19.2", + "fast-equals": "^5.0.1", + "ts-node": "^10.9.1", + "typescript": "^5.2.2" } }, "node_modules/@cspotcode/source-map-consumer": { @@ -34,226 +34,54 @@ } }, "node_modules/@dfinity/agent": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.14.1.tgz", - "integrity": "sha512-qLAQrhkxshcsxECnMSa1zY7mI8ua0vItrdA9JJI9WBRz4rDDXtrXyOYnh3u6pUPpdfF/i6bjx+NgrjYZucLe1Q==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.19.2.tgz", + "integrity": "sha512-KLRWEjeU9SyyaS7IBVJ9ZUcufxufr55e/kRIyClK157+0pkTG9a8xKjUIMx3QzKvLsqqzXL238nWwdoP6jAD8g==", "dev": true, "dependencies": { + "@noble/hashes": "^1.3.1", "base64-arraybuffer": "^0.2.0", - "bignumber.js": "^9.0.0", "borc": "^2.1.1", - "js-sha256": "0.9.0", - "simple-cbor": "^0.4.1", - "ts-node": "^10.8.2" + "simple-cbor": "^0.4.1" }, "peerDependencies": { - "@dfinity/candid": "^0.14.1", - "@dfinity/principal": "^0.14.1" - } - }, - "node_modules/@dfinity/agent/node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@dfinity/agent/node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } + "@dfinity/candid": "^0.19.2", + "@dfinity/principal": "^0.19.2" } }, "node_modules/@dfinity/candid": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.14.1.tgz", - "integrity": "sha512-yRIRnVrJ4LjB0jFKUqZ2NeUzCCR6m8pm/n+0+IoVzY94ZkFATUkBSvdNxDZd1CCtNDNApi+YDe61DSQ51cDkrg==", - "dev": true, - "peer": true, - "dependencies": { - "ts-node": "^10.8.2" - } - }, - "node_modules/@dfinity/candid/node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "peer": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@dfinity/candid/node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.19.2.tgz", + "integrity": "sha512-X2hCqNMhnnmwtnOc0WnymOZYx3qphjEMuSYbBr7tMIkV7Hwt9BmXXlLnQTxUytTPxf+3he0GcS3KzsSQ9CK8ew==", "dev": true, "peer": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } + "@dfinity/principal": "^0.19.2" } }, "node_modules/@dfinity/principal": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.14.1.tgz", - "integrity": "sha512-a5TDU0iWLeuNjI+L1Ukx5nRhQHMCN2GRQkQg1Z0AzP3dX7FkBOiaLwMCLhCRUk/sK/SeR6/hCA0YKiwRqzjhqA==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.19.2.tgz", + "integrity": "sha512-vsKN6BKya70bQUsjgKRDlR2lOpv/XpUkCMIiji6rjMtKHIuWEB5Eu3JqZsOuBmWo3A3TT/K/osT9VPm0k4qdYQ==", "dev": true, "peer": true, "dependencies": { - "js-sha256": "^0.9.0", - "ts-node": "^10.8.2" - } - }, - "node_modules/@dfinity/principal/node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "peer": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@dfinity/principal/node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "peer": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } + "@noble/hashes": "^1.3.1" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -266,6 +94,18 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@swc/core": { "version": "1.2.151", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.151.tgz", @@ -651,9 +491,9 @@ ] }, "node_modules/bignumber.js": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", - "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "dev": true, "engines": { "node": "*" @@ -1061,10 +901,13 @@ } }, "node_modules/fast-equals": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", - "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==", - "dev": true + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } }, "node_modules/fs-extra": { "version": "10.0.1", @@ -1150,9 +993,9 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { "inherits": "^2.0.3", @@ -1199,12 +1042,12 @@ } }, "node_modules/ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "dependencies": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -1215,7 +1058,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { @@ -1241,17 +1084,29 @@ } } }, + "node_modules/ts-node/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/universalify": { @@ -1298,150 +1153,45 @@ } }, "@dfinity/agent": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.14.1.tgz", - "integrity": "sha512-qLAQrhkxshcsxECnMSa1zY7mI8ua0vItrdA9JJI9WBRz4rDDXtrXyOYnh3u6pUPpdfF/i6bjx+NgrjYZucLe1Q==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.19.2.tgz", + "integrity": "sha512-KLRWEjeU9SyyaS7IBVJ9ZUcufxufr55e/kRIyClK157+0pkTG9a8xKjUIMx3QzKvLsqqzXL238nWwdoP6jAD8g==", "dev": true, "requires": { + "@noble/hashes": "^1.3.1", "base64-arraybuffer": "^0.2.0", - "bignumber.js": "^9.0.0", "borc": "^2.1.1", - "js-sha256": "0.9.0", - "simple-cbor": "^0.4.1", - "ts-node": "^10.8.2" - }, - "dependencies": { - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" - } - }, - "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - } - } + "simple-cbor": "^0.4.1" } }, "@dfinity/candid": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.14.1.tgz", - "integrity": "sha512-yRIRnVrJ4LjB0jFKUqZ2NeUzCCR6m8pm/n+0+IoVzY94ZkFATUkBSvdNxDZd1CCtNDNApi+YDe61DSQ51cDkrg==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.19.2.tgz", + "integrity": "sha512-X2hCqNMhnnmwtnOc0WnymOZYx3qphjEMuSYbBr7tMIkV7Hwt9BmXXlLnQTxUytTPxf+3he0GcS3KzsSQ9CK8ew==", "dev": true, "peer": true, - "requires": { - "ts-node": "^10.8.2" - }, - "dependencies": { - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" - } - }, - "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "peer": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - } - } - } + "requires": {} }, "@dfinity/principal": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.14.1.tgz", - "integrity": "sha512-a5TDU0iWLeuNjI+L1Ukx5nRhQHMCN2GRQkQg1Z0AzP3dX7FkBOiaLwMCLhCRUk/sK/SeR6/hCA0YKiwRqzjhqA==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.19.2.tgz", + "integrity": "sha512-vsKN6BKya70bQUsjgKRDlR2lOpv/XpUkCMIiji6rjMtKHIuWEB5Eu3JqZsOuBmWo3A3TT/K/osT9VPm0k4qdYQ==", "dev": true, "peer": true, "requires": { - "js-sha256": "^0.9.0", - "ts-node": "^10.8.2" - }, - "dependencies": { - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "peer": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" - } - }, - "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "peer": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - } - } + "@noble/hashes": "^1.3.1" } }, "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { @@ -1454,6 +1204,12 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true + }, "@swc/core": { "version": "1.2.151", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.151.tgz", @@ -1657,9 +1413,9 @@ "dev": true }, "bignumber.js": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", - "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "dev": true }, "borc": { @@ -1857,9 +1613,9 @@ "optional": true }, "fast-equals": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", - "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", "dev": true }, "fs-extra": { @@ -1924,9 +1680,9 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -1956,12 +1712,12 @@ } }, "ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "requires": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -1972,14 +1728,25 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" + }, + "dependencies": { + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + } } }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true }, "universalify": { diff --git a/examples/list_of_lists/package.json b/examples/list_of_lists/package.json index 523bcbe17e..97fb5bc33a 100644 --- a/examples/list_of_lists/package.json +++ b/examples/list_of_lists/package.json @@ -7,9 +7,9 @@ "azle": "0.17.1" }, "devDependencies": { - "@dfinity/agent": "0.14.1", - "fast-equals": "4.0.3", - "ts-node": "10.7.0", - "typescript": "4.6.3" + "@dfinity/agent": "^0.19.2", + "fast-equals": "^5.0.1", + "ts-node": "^10.9.1", + "typescript": "^5.2.2" } } diff --git a/examples/list_of_lists/src/index.ts b/examples/list_of_lists/src/index.ts index ce953a52cc..df607d344d 100644 --- a/examples/list_of_lists/src/index.ts +++ b/examples/list_of_lists/src/index.ts @@ -1,12 +1,10 @@ import { blob, bool, - candid, empty, float32, float64, Func, - func, int, int16, int32, @@ -20,7 +18,6 @@ import { Null, Opt, principal, - Principal, query, Record, reserved, @@ -30,48 +27,34 @@ import { Vec } from 'azle'; -class Person extends Record { - @candid(text) - name: text; +const Person = Record({ + name: text, + age: nat8 +}); - @candid(nat8) - age: nat8; -} +const State = Variant({ + solid: Null, + liquid: Null, + gas: Null +}); -class State extends Variant { - @candid(Null) - solid: Null; +const BasicFunc = Func([text], text, 'query'); - @candid(Null) - liquid: Null; - - @candid(Null) - gas: Null; -} - -@func([text], text, 'query') -class BasicFunc extends Func {} - -export default class extends Service { - @query([Vec(text)], Vec(text)) - listOfStringOne(param: Vec): Vec { +export default Service({ + listOfStringOne: query([Vec(text)], Vec(text), (param) => { return param; - } - - @query([Vec(Vec(text))], Vec(Vec(text))) - listOfStringTwo(params: Vec>): Vec> { + }), + listOfStringTwo: query([Vec(Vec(text))], Vec(Vec(text)), (params) => { return params; - } - - @query([Vec(Vec(Vec(Vec(text))))], Vec(Vec(Vec(Vec(text))))) - listOfStringFour( - params: Vec>>> - ): Vec>>> { - return params; - } - - @query([], Vec(Vec(Vec(Vec(Vec(Vec(Vec(int8)))))))) - listOfListOfInt8(): Vec>>>>>> { + }), + listOfStringFour: query( + [Vec(Vec(Vec(Vec(text))))], + Vec(Vec(Vec(Vec(text)))), + (params) => { + return params; + } + ), + listOfListOfInt8: query([], Vec(Vec(Vec(Vec(Vec(Vec(Vec(int8))))))), () => { return [ [ [ @@ -93,37 +76,27 @@ export default class extends Service { [[[[[3]]]], [[[[4]]]]] ] ]; - } - - @query([Vec(Vec(Vec(Null)))], Vec(Vec(Vec(Null)))) - listOfNull(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(bool)))], Vec(Vec(Vec(bool)))) - listOfBool(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(text)))], Vec(Vec(Vec(text)))) - listOfString(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(Opt(text))))], Vec(Vec(Vec(Opt(text))))) - listOfOptionString( - param: Vec>>> - ): Vec>>> { - return param; - } - - @query([], Vec(Vec(Vec(empty)))) - listOfEmpty(): Vec>> { + }), + listOfNull: query([Vec(Vec(Vec(Null)))], Vec(Vec(Vec(Null))), (param) => { + return param; + }), + listOfBool: query([Vec(Vec(Vec(bool)))], Vec(Vec(Vec(bool))), (param) => { + return param; + }), + listOfString: query([Vec(Vec(Vec(text)))], Vec(Vec(Vec(text))), (param) => { + return param; + }), + listOfOptionString: query( + [Vec(Vec(Vec(Opt(text))))], + Vec(Vec(Vec(Opt(text)))), + (param) => { + return param; + } + ), + listOfEmpty: query([], Vec(Vec(Vec(empty))), () => { throw new Error('Anything you want'); - } - - @query([], Vec(Vec(Vec(reserved)))) - listOfReserved(): Vec>> { + }), + listOfReserved: query([], Vec(Vec(Vec(reserved))), () => { return [ [['A'], ['n']], [ @@ -131,95 +104,107 @@ export default class extends Service { ['i', 'n', 'g'] ] ]; - } - - @query([Vec(Vec(Vec(BasicFunc)))], Vec(Vec(Vec(BasicFunc)))) - listOfFunc(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(principal)))], Vec(Vec(Vec(principal)))) - listOfPrincipal(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(float64)))], Vec(Vec(Vec(float64)))) - listOfF64(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(float32)))], Vec(Vec(Vec(float32)))) - listOfF32(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(int)))], Vec(Vec(Vec(int)))) - listOfInt(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(int64)))], Vec(Vec(Vec(int64)))) - listOfInt64(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(int32)))], Vec(Vec(Vec(int32)))) - listOfInt32(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(int16)))], Vec(Vec(Vec(int16)))) - listOfInt16(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(int8)))], Vec(Vec(Vec(int8)))) - listOfInt8(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(nat)))], Vec(Vec(Vec(nat)))) - listOfNat(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(nat64)))], Vec(Vec(Vec(nat64)))) - listOfNat64(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(nat32)))], Vec(Vec(Vec(nat32)))) - listOfNat32(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(nat16)))], Vec(Vec(Vec(nat16)))) - listOfNat16(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(nat8)))], Vec(Vec(Vec(nat8)))) - listOfNat8(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(Person)))], Vec(Vec(Vec(Person)))) - listOfRecord(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(Vec(Vec(State)))], Vec(Vec(Vec(State)))) - listOfVariant(param: Vec>>): Vec>> { - return param; - } - - @query([Vec(blob)], Vec(blob)) - listOfBlob(param: Vec): Vec { - return param; - } - - @query([Vec(Vec(blob))], Vec(Vec(blob))) - listOfListOfBlob(param: Vec>): Vec> { - return param; - } -} + }), + listOfFunc: query( + [Vec(Vec(Vec(BasicFunc)))], + Vec(Vec(Vec(BasicFunc))), + (param) => { + return param; + } + ), + listOfPrincipal: query( + [Vec(Vec(Vec(principal)))], + Vec(Vec(Vec(principal))), + (param) => { + return param; + } + ), + listOfF64: query( + [Vec(Vec(Vec(float64)))], + Vec(Vec(Vec(float64))), + (param) => { + return param; + } + ), + listOfF32: query( + [Vec(Vec(Vec(float32)))], + Vec(Vec(Vec(float32))), + (param) => { + return param; + } + ), + listOfInt: query([Vec(Vec(Vec(int)))], Vec(Vec(Vec(int))), (param) => { + return param; + }), + listOfInt64: query( + [Vec(Vec(Vec(int64)))], + Vec(Vec(Vec(int64))), + (param) => { + return param; + } + ), + listOfInt32: query( + [Vec(Vec(Vec(int32)))], + Vec(Vec(Vec(int32))), + (param) => { + return param; + } + ), + listOfInt16: query( + [Vec(Vec(Vec(int16)))], + Vec(Vec(Vec(int16))), + (param) => { + return param; + } + ), + listOfInt8: query([Vec(Vec(Vec(int8)))], Vec(Vec(Vec(int8))), (param) => { + return param; + }), + listOfNat: query([Vec(Vec(Vec(nat)))], Vec(Vec(Vec(nat))), (param) => { + return param; + }), + listOfNat64: query( + [Vec(Vec(Vec(nat64)))], + Vec(Vec(Vec(nat64))), + (param) => { + return param; + } + ), + listOfNat32: query( + [Vec(Vec(Vec(nat32)))], + Vec(Vec(Vec(nat32))), + (param) => { + return param; + } + ), + listOfNat16: query( + [Vec(Vec(Vec(nat16)))], + Vec(Vec(Vec(nat16))), + (param) => { + return param; + } + ), + listOfNat8: query([Vec(Vec(Vec(nat8)))], Vec(Vec(Vec(nat8))), (param) => { + return param; + }), + listOfRecord: query( + [Vec(Vec(Vec(Person)))], + Vec(Vec(Vec(Person))), + (param) => { + return param; + } + ), + listOfVariant: query( + [Vec(Vec(Vec(State)))], + Vec(Vec(Vec(State))), + (param) => { + return param; + } + ), + listOfBlob: query([Vec(blob)], Vec(blob), (param) => { + return param; + }), + listOfListOfBlob: query([Vec(Vec(blob))], Vec(Vec(blob)), (param) => { + return param; + }) +}); diff --git a/examples/list_of_lists/test/test.ts b/examples/list_of_lists/test/test.ts index 59934e31e1..6a442869d7 100644 --- a/examples/list_of_lists/test/test.ts +++ b/examples/list_of_lists/test/test.ts @@ -2,10 +2,10 @@ import { getCanisterId, runTests } from 'azle/test'; import { createActor } from '../dfx_generated/list_of_lists'; import { getTests } from './tests'; -const list_of_lists_canister = createActor(getCanisterId('list_of_lists'), { +const listOfListsCanister = createActor(getCanisterId('list_of_lists'), { agentOptions: { host: 'http://127.0.0.1:8000' } }); -runTests(getTests(list_of_lists_canister)); +runTests(getTests(listOfListsCanister)); diff --git a/examples/manual_reply/dfx.json b/examples/manual_reply/dfx.json index 8045f0bcaf..baaa659511 100644 --- a/examples/manual_reply/dfx.json +++ b/examples/manual_reply/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/manual_reply.ts", "candid": "src/manual_reply.did", - "wasm": ".azle/manual_reply/manual_reply.wasm.gz", + "wasm": ".azle/manual_reply/manual_reply.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/manual_reply", "node_compatibility": true diff --git a/examples/manual_reply/test/test.ts b/examples/manual_reply/test/test.ts index 452bb300d1..f3e0557cc0 100644 --- a/examples/manual_reply/test/test.ts +++ b/examples/manual_reply/test/test.ts @@ -2,10 +2,10 @@ import { getCanisterId, runTests } from 'azle/test'; import { createActor } from './dfx_generated/manual_reply'; import { getTests } from './tests'; -const manual_reply_canister = createActor(getCanisterId('manual_reply'), { +const manualReplyCanister = createActor(getCanisterId('manual_reply'), { agentOptions: { host: 'http://127.0.0.1:8000' } }); -runTests(getTests(manual_reply_canister)); +runTests(getTests(manualReplyCanister)); diff --git a/src/lib_new/visitors/encode_decode/decode_visitor.ts b/src/lib_new/visitors/encode_decode/decode_visitor.ts index 2c91d8342f..65a3f67d87 100644 --- a/src/lib_new/visitors/encode_decode/decode_visitor.ts +++ b/src/lib_new/visitors/encode_decode/decode_visitor.ts @@ -21,7 +21,7 @@ export class DecodeVisitor extends IDL.Visitor { return data.js_class(data.js_data); } visitFunc(t: IDL.FuncClass, data: VisitorData): VisitorResult { - return new data.js_class(data.js_data[0], data.js_data[1]); + return data.js_data; } visitPrimitive( t: IDL.PrimitiveType, diff --git a/src/lib_new/visitors/encode_decode/encode_visitor.ts b/src/lib_new/visitors/encode_decode/encode_visitor.ts index 752c1063b8..f33acb675d 100644 --- a/src/lib_new/visitors/encode_decode/encode_visitor.ts +++ b/src/lib_new/visitors/encode_decode/encode_visitor.ts @@ -22,7 +22,7 @@ export class EncodeVisitor extends IDL.Visitor { return data.js_data.principal; } visitFunc(t: IDL.FuncClass, data: VisitorData): VisitorResult { - return [data.js_data.principal, data.js_data.name]; + return data.js_data; } visitPrimitive( t: IDL.PrimitiveType,