Skip to content

Commit

Permalink
remove all examples where the candid file is accessed at .azle
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Apr 25, 2024
1 parent df68539 commit 0b75172
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 21 deletions.
8 changes: 2 additions & 6 deletions examples/canister/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
"main": "src/index.ts",
"candid_gen": "automatic",
"env": ["SOME_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[
".azle/some_canister/some_canister.did",
"candid/some_canister.did"
]
],
"assets": [["src/some_canister.did", "candid/some_canister.did"]],
"declarations": {
"output": "test/dfx_generated/canister",
"node_compatibility": true
Expand All @@ -19,6 +14,7 @@
"some_canister": {
"type": "azle",
"main": "src/some_canister.ts",
"candid": "src/some_canister.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/some_canister",
Expand Down
4 changes: 4 additions & 0 deletions examples/canister/src/some_canister.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
service: () -> {
query1: () -> (bool) query;
update1: () -> (text);
}
10 changes: 5 additions & 5 deletions examples/composite_queries/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"AZLE_TEST_FETCH"
],
"assets": [
[".azle/canister2/canister2.did", "candid/canister2.did"],
[".azle/canister3/canister3.did", "candid/canister3.did"]
["src/canister2/index.did", "candid/canister2.did"],
["src/canister3/index.did", "candid/canister3.did"]
],
"declarations": {
"output": "test/dfx_generated/canister1",
Expand All @@ -22,11 +22,10 @@
"canister2": {
"type": "azle",
"main": "src/canister2/index.ts",
"candid": "src/canister2/index.did",
"candid_gen": "automatic",
"env": ["CANISTER3_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[".azle/canister3/canister3.did", "candid/canister3.did"]
],
"assets": [["src/canister3/index.did", "candid/canister3.did"]],
"declarations": {
"output": "test/dfx_generated/canister2",
"node_compatibility": true
Expand All @@ -35,6 +34,7 @@
"canister3": {
"type": "azle",
"main": "src/canister3/index.ts",
"candid": "src/canister3/index.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/canister3",
Expand Down
7 changes: 7 additions & 0 deletions examples/composite_queries/src/canister2/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
service: () -> {
deepQuery: () -> (text) query;
incCounter: () -> (nat) query;
manualQuery: () -> (text) query;
simpleQuery: () -> (text) query;
updateQuery: () -> (text);
}
3 changes: 3 additions & 0 deletions examples/composite_queries/src/canister3/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service: () -> {
deepQuery: () -> (text) query;
}
5 changes: 2 additions & 3 deletions examples/cross_canister_calls/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"main": "src/canister1/index.ts",
"candid_gen": "automatic",
"env": ["CANISTER2_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[".azle/canister2/canister2.did", "candid/canister2.did"]
],
"assets": [["src/canister2/index.did", "candid/canister2.did"]],
"declarations": {
"output": "test/dfx_generated/canister1",
"node_compatibility": true
Expand All @@ -16,6 +14,7 @@
"canister2": {
"type": "azle",
"main": "src/canister2/index.ts",
"candid": "src/canister2/index.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/canister2",
Expand Down
9 changes: 9 additions & 0 deletions examples/cross_canister_calls/src/canister2/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
service: () -> {
account: (record {id:text}) -> (opt record {id:text; balance:nat64}) query;
accounts: () -> (vec record {id:text; balance:nat64}) query;
balance: (text) -> (nat64) query;
getNotification: () -> (text) query;
receiveNotification: (text) -> ();
transfer: (text, text, nat64) -> (nat64);
trap: () -> (text) query;
}
3 changes: 2 additions & 1 deletion examples/cycles/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"cycles": {
"type": "azle",
"main": "src/cycles/index.ts",
"candid": "src/cycles/index.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/cycles",
Expand All @@ -14,7 +15,7 @@
"main": "src/intermediary/index.ts",
"candid_gen": "automatic",
"env": ["CYCLES_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [[".azle/cycles/cycles.did", "candid/cycles.did"]],
"assets": [["src/cycles/index.did", "candid/cycles.did"]],
"declarations": {
"output": "test/dfx_generated/intermediary",
"node_compatibility": true
Expand Down
6 changes: 6 additions & 0 deletions examples/cycles/src/cycles/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
service: () -> {
getCanisterBalance: () -> (nat64) query;
getCanisterBalance128: () -> (nat) query;
receiveCycles: () -> (nat64);
receiveCycles128: () -> (nat);
}
3 changes: 3 additions & 0 deletions examples/func_types/canisters/notifiers/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service: () -> {
getNotifier: () -> (func (vec nat8) -> () oneway) query;
}
3 changes: 2 additions & 1 deletion examples/func_types/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"candid_gen": "automatic",
"env": ["NOTIFIERS_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[".azle/notifiers/notifiers.did", "candid/notifiers.did"]
["canisters/notifiers/index.did", "candid/notifiers.did"]
],
"declarations": {
"output": "test/dfx_generated/func_types",
Expand All @@ -16,6 +16,7 @@
"notifiers": {
"type": "azle",
"main": "canisters/notifiers/index.ts",
"candid": "canisters/notifiers/index.did",
"candid_gen": "automatic",
"env": ["NOTIFIERS_PRINCIPAL"],
"declarations": {
Expand Down
3 changes: 2 additions & 1 deletion examples/recursion/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"env": ["MY_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[
".azle/recursive_canister/recursive_canister.did",
"src/recursive_canister/index.did",
"candid/recursive_canister.did"
]
],
Expand All @@ -19,6 +19,7 @@
"recursive_canister": {
"type": "azle",
"main": "src/recursive_canister/index.ts",
"candid": "src/recursive_canister/index.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/recursive_canister",
Expand Down
6 changes: 6 additions & 0 deletions examples/recursion/src/recursive_canister/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type rec_0 = service {getMessage: () -> (text) query; myQuery: (rec_0) -> (rec_0) query;};
type rec_1 = service {getMessage: () -> (text) query; myQuery: (rec_1) -> (rec_1) query;};
service: (text) -> {
getMessage: () -> (text) query;
myQuery: (rec_0) -> (rec_1) query;
}
6 changes: 2 additions & 4 deletions examples/rejections/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"candid_gen": "automatic",
"env": ["SOME_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"],
"assets": [
[
".azle/some_canister/some_canister.did",
"candid/some_canister.did"
],
["src/some_canister/index.did", "candid/some_canister.did"],
["src/nonexistent.did", "candid/nonexistent.did"]
],
"declarations": {
Expand All @@ -20,6 +17,7 @@
"some_canister": {
"type": "azle",
"main": "src/some_canister/index.ts",
"candid": "src/some_canister/index.did",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/some_canister",
Expand Down
5 changes: 5 additions & 0 deletions examples/rejections/src/some_canister/index.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
service: () -> {
accept: () -> (bool) query;
error: () -> (empty) query;
reject: (text) -> (empty) query;
}

0 comments on commit 0b75172

Please sign in to comment.