Skip to content

Commit

Permalink
Merge pull request #1253 from demergent-labs/functional_syntax_blob_a…
Browse files Browse the repository at this point in the history
…rray

Functional syntax blob array
  • Loading branch information
lastmjs authored Sep 24, 2023
2 parents c709c3c + be4cdd2 commit 99bd671
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -114,6 +112,8 @@ jobs:
[
"examples/async_await",
"examples/audio_recorder",
"examples/bitcoin",
"examples/blob_array",
"examples/primitive_types",
"examples/principal",
"examples/query",
Expand Down
3 changes: 2 additions & 1 deletion examples/async_await/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/audio_recorder/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/bitcoin/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/blob_array/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 6 additions & 9 deletions examples/blob_array/src/index.ts
Original file line number Diff line number Diff line change
@@ -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<blob> {
}),
getBlobs: query([], Vec(blob), () => {
return [stringToBlob('hello'), stringToBlob('world')];
}
}
})
});

function stringToBlob(string: string): blob {
return Buffer.from(string);
Expand Down

0 comments on commit 99bd671

Please sign in to comment.