From f4d40833d4b86d48878e32d30b73264e996b8a03 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Sat, 23 Sep 2023 19:02:57 -0500 Subject: [PATCH 1/2] blob_array example completed --- examples/async_await/dfx.json | 3 ++- examples/audio_recorder/dfx.json | 3 ++- examples/bitcoin/dfx.json | 3 ++- examples/blob_array/dfx.json | 3 ++- examples/blob_array/src/index.ts | 15 ++++++--------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/async_await/dfx.json b/examples/async_await/dfx.json index ccffbfebed..425a4963bf 100644 --- a/examples/async_await/dfx.json +++ b/examples/async_await/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/async_await.ts", "candid": "src/async_await.did", - "wasm": ".azle/async_await/async_await.wasm.gz", + "wasm": ".azle/async_await/async_await.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/async_await", "node_compatibility": true diff --git a/examples/audio_recorder/dfx.json b/examples/audio_recorder/dfx.json index 3683d4aa37..65df40b322 100644 --- a/examples/audio_recorder/dfx.json +++ b/examples/audio_recorder/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/index.ts", "candid": "src/index.did", - "wasm": ".azle/audio_recorder/audio_recorder.wasm.gz", + "wasm": ".azle/audio_recorder/audio_recorder.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/audio_recorder", "node_compatibility": true diff --git a/examples/bitcoin/dfx.json b/examples/bitcoin/dfx.json index 1f44c9ce37..3942f82d05 100644 --- a/examples/bitcoin/dfx.json +++ b/examples/bitcoin/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/index.ts", "candid": "src/index.did", - "wasm": ".azle/bitcoin/bitcoin.wasm.gz", + "wasm": ".azle/bitcoin/bitcoin.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/bitcoin", "node_compatibility": true diff --git a/examples/blob_array/dfx.json b/examples/blob_array/dfx.json index d47937a3f6..744bb07531 100644 --- a/examples/blob_array/dfx.json +++ b/examples/blob_array/dfx.json @@ -6,7 +6,8 @@ "root": "src", "ts": "src/index.ts", "candid": "src/index.did", - "wasm": ".azle/blob_array/blob_array.wasm.gz", + "wasm": ".azle/blob_array/blob_array.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/blob_array", "node_compatibility": true diff --git a/examples/blob_array/src/index.ts b/examples/blob_array/src/index.ts index 2dea6d17b4..87a84ebb3f 100644 --- a/examples/blob_array/src/index.ts +++ b/examples/blob_array/src/index.ts @@ -1,16 +1,13 @@ import { blob, query, Service, Vec } from 'azle'; -export default class extends Service { - @query([], blob) - getBlob(): blob { +export default Service({ + getBlob: query([], blob, () => { return stringToBlob('hello'); - } - - @query([], Vec(blob)) - getBlobs(): Vec { + }), + getBlobs: query([], Vec(blob), () => { return [stringToBlob('hello'), stringToBlob('world')]; - } -} + }) +}); function stringToBlob(string: string): blob { return Buffer.from(string); From be4cdd24bf2b628e892f2b8c04d4791f6a6c2296 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Sat, 23 Sep 2023 19:04:17 -0500 Subject: [PATCH 2/2] add bitcoin and blob_array --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd1bbfb236..813571a5b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,8 +14,6 @@ # The check-basic-integration-tests-success job is designed to ensure that all jobs spun up from the matrix in the basic-integration-tests have succeeded # All Examples TODO restore when https://github.com/demergent-labs/azle/issues/1192 is resolved -# "examples/bitcoin", -# "examples/blob_array", # "examples/bytes", # "examples/call_raw", # "examples/candid_encoding", @@ -114,6 +112,8 @@ jobs: [ "examples/async_await", "examples/audio_recorder", + "examples/bitcoin", + "examples/blob_array", "examples/primitive_types", "examples/principal", "examples/query",