Skip to content

Commit fc0f2a8

Browse files
committed
adding missing golden files
1 parent e52a537 commit fc0f2a8

File tree

8 files changed

+81
-81
lines changed

8 files changed

+81
-81
lines changed

rust/candid_parser/tests/assets/ok/actor.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
33

44
module {
5-
public type f = shared Int8 -> async Int8;
65
public type g = f;
7-
public type h = shared f -> async f;
86
public type o = ?o;
7+
public type f = shared Int8 -> async Int8;
8+
public type h = shared f -> async f;
99
public type Self = actor {
1010
f : shared Nat -> async h;
1111
g : f;

rust/candid_parser/tests/assets/ok/cyclic.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
module {
55
public type A = ?B;
6-
public type B = ?C;
7-
public type C = A;
6+
public type Z = A;
87
public type X = Y;
8+
public type C = A;
99
public type Y = Z;
10-
public type Z = A;
10+
public type B = ?C;
1111
public type Self = actor { f : shared (A, B, C, X, Y, Z) -> async () }
1212
}

rust/candid_parser/tests/assets/ok/example.mo

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,56 @@
22
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
33

44
module {
5-
public type A = B;
6-
public type B = ?A;
5+
public type my_variant = {
6+
/// Doc comment for my_variant field a
7+
#a : {
8+
/// Doc comment for my_variant field a field b
9+
b : Text;
10+
};
11+
/// Doc comment for my_variant field c
12+
#c : ?{
13+
/// Doc comment for my_variant field c field d
14+
d : Text;
15+
e : [
16+
{
17+
/// Doc comment for my_variant field c field e inner vec element
18+
f : Nat;
19+
}
20+
];
21+
};
22+
};
23+
/// Doc comment for service id
24+
public type s = actor { f : t; g : shared list -> async (B, tree, stream) };
725
/// Doc comment for List
826
public type List = ?{
927
/// Doc comment for List head
1028
head : Int;
1129
/// Doc comment for List tail
1230
tail : List;
1331
};
32+
public type list = ?node;
33+
public type tree = {
34+
#branch : { val : Int; left : tree; right : tree };
35+
#leaf : Int;
36+
};
1437
public type a = { #a; #b : b };
15-
public type b = (Int, Nat);
1638
/// Doc comment for broker service
1739
public type broker = actor {
1840
find : shared (name : Text) -> async actor {
1941
current : shared () -> async Nat32;
2042
up : shared () -> async ();
2143
};
2244
};
45+
public type t = shared (server : s) -> async ();
46+
/// Doc comment for prim type
47+
public type my_type = Principal;
2348
public type f = shared (List, shared Int32 -> async Int64) -> async (
2449
?List,
2550
res,
2651
);
27-
public type list = ?node;
28-
/// Doc comment for prim type
29-
public type my_type = Principal;
30-
public type my_variant = {
31-
/// Doc comment for my_variant field a
32-
#a : {
33-
/// Doc comment for my_variant field a field b
34-
b : Text;
35-
};
36-
/// Doc comment for my_variant field c
37-
#c : ?{
38-
/// Doc comment for my_variant field c field d
39-
d : Text;
40-
e : [
41-
{
42-
/// Doc comment for my_variant field c field e inner vec element
43-
f : Nat;
44-
}
45-
];
46-
};
47-
};
52+
public type b = (Int, Nat);
53+
public type stream = ?{ head : Nat; next : shared query () -> async stream };
54+
public type A = B;
4855
/// Doc comment for nested type
4956
public type nested = {
5057
_0_ : Nat;
@@ -56,14 +63,6 @@ module {
5663
_41_ : { #_42_ ; #A; #B; #C };
5764
_42_ : Nat;
5865
};
59-
/// Doc comment for nested_records
60-
public type nested_records = {
61-
/// Doc comment for nested_records field nested
62-
nested : ?{
63-
/// Doc comment for nested_records field nested_field
64-
nested_field : Text;
65-
};
66-
};
6766
public type nested_res = {
6867
#Ok : { #Ok; #Err };
6968
#Err : {
@@ -73,7 +72,15 @@ module {
7372
#Err : { _0_ : Int };
7473
};
7574
};
76-
public type node = { head : Nat; tail : list };
75+
/// Doc comment for nested_records
76+
public type nested_records = {
77+
/// Doc comment for nested_records field nested
78+
nested : ?{
79+
/// Doc comment for nested_records field nested_field
80+
nested_field : Text;
81+
};
82+
};
83+
public type B = ?A;
7784
/// Doc comment for res type
7885
public type res = {
7986
/// Doc comment for Ok variant
@@ -85,14 +92,7 @@ module {
8592
error : Text;
8693
};
8794
};
88-
/// Doc comment for service id
89-
public type s = actor { f : t; g : shared list -> async (B, tree, stream) };
90-
public type stream = ?{ head : Nat; next : shared query () -> async stream };
91-
public type t = shared (server : s) -> async ();
92-
public type tree = {
93-
#branch : { val : Int; left : tree; right : tree };
94-
#leaf : Int;
95-
};
95+
public type node = { head : Nat; tail : list };
9696
/// Doc comment for service
9797
public type Self = actor {
9898
/// Doc comment for f1 method of service

rust/candid_parser/tests/assets/ok/inline_methods.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
module {
55
public type Fn = shared query Nat -> async Nat;
6-
public type Gn = Fn;
76
public type R = { x : Nat; fn : Fn; gn : Gn; nested : { fn : Gn } };
87
public type RInline = { x : Nat; fn : shared query Nat -> async Nat };
8+
public type Gn = Fn;
99
public type Self = actor {
1010
add_two : shared Nat -> async Nat;
1111
fn : Fn;

rust/candid_parser/tests/assets/ok/keyword.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
33

44
module {
5+
public type stream = ?{ head : Nat; next : shared query () -> async stream };
56
public type if_ = {
67
#branch : { val : Int; left : if_; right : if_ };
78
#leaf : Int;
89
};
10+
public type return_ = actor { f : t; g : shared list -> async (if_, stream) };
911
public type list = ?node;
10-
public type node = { head : Nat; tail : list };
1112
public type o = ?o;
12-
public type return_ = actor { f : t; g : shared list -> async (if_, stream) };
13-
public type stream = ?{ head : Nat; next : shared query () -> async stream };
1413
public type t = shared (server : return_) -> async ();
14+
public type node = { head : Nat; tail : list };
1515
public type Self = actor {
1616
Oneway : shared () -> ();
1717
f__ : shared o -> async o;

rust/candid_parser/tests/assets/ok/management.mo

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,57 @@
33

44
module {
55
public type bitcoin_address = Text;
6-
public type bitcoin_network = { #mainnet; #testnet };
7-
public type block_hash = Blob;
8-
public type canister_id = Principal;
6+
public type ecdsa_curve = { #secp256k1 };
7+
public type get_utxos_request = {
8+
network : bitcoin_network;
9+
filter : ?{ #page : Blob; #min_confirmations : Nat32 };
10+
address : bitcoin_address;
11+
};
912
public type canister_settings = {
1013
freezing_threshold : ?Nat;
1114
controllers : ?[Principal];
1215
memory_allocation : ?Nat;
1316
compute_allocation : ?Nat;
1417
};
15-
public type definite_canister_settings = {
16-
freezing_threshold : Nat;
17-
controllers : [Principal];
18-
memory_allocation : Nat;
19-
compute_allocation : Nat;
18+
public type user_id = Principal;
19+
public type get_current_fee_percentiles_request = {
20+
network : bitcoin_network;
2021
};
21-
public type ecdsa_curve = { #secp256k1 };
22+
public type outpoint = { txid : Blob; vout : Nat32 };
2223
public type get_balance_request = {
2324
network : bitcoin_network;
2425
address : bitcoin_address;
2526
min_confirmations : ?Nat32;
2627
};
27-
public type get_current_fee_percentiles_request = {
28-
network : bitcoin_network;
28+
public type definite_canister_settings = {
29+
freezing_threshold : Nat;
30+
controllers : [Principal];
31+
memory_allocation : Nat;
32+
compute_allocation : Nat;
2933
};
30-
public type get_utxos_request = {
34+
public type satoshi = Nat64;
35+
public type bitcoin_network = { #mainnet; #testnet };
36+
public type millisatoshi_per_byte = Nat64;
37+
public type wasm_module = Blob;
38+
public type send_transaction_request = {
39+
transaction : Blob;
3140
network : bitcoin_network;
32-
filter : ?{ #page : Blob; #min_confirmations : Nat32 };
33-
address : bitcoin_address;
3441
};
3542
public type get_utxos_response = {
3643
next_page : ?Blob;
3744
tip_height : Nat32;
3845
tip_block_hash : block_hash;
3946
utxos : [utxo];
4047
};
41-
public type http_header = { value : Text; name : Text };
48+
public type block_hash = Blob;
49+
public type canister_id = Principal;
50+
public type utxo = { height : Nat32; value : satoshi; outpoint : outpoint };
4251
public type http_response = {
4352
status : Nat;
4453
body : Blob;
4554
headers : [http_header];
4655
};
47-
public type millisatoshi_per_byte = Nat64;
48-
public type outpoint = { txid : Blob; vout : Nat32 };
49-
public type satoshi = Nat64;
50-
public type send_transaction_request = {
51-
transaction : Blob;
52-
network : bitcoin_network;
53-
};
54-
public type user_id = Principal;
55-
public type utxo = { height : Nat32; value : satoshi; outpoint : outpoint };
56-
public type wasm_module = Blob;
56+
public type http_header = { value : Text; name : Text };
5757
public type Self = actor {
5858
bitcoin_get_balance : shared get_balance_request -> async satoshi;
5959
bitcoin_get_current_fee_percentiles : shared get_current_fee_percentiles_request -> async [

rust/candid_parser/tests/assets/ok/recursion.mo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
33

44
module {
5+
public type stream = ?{ head : Nat; next : shared query () -> async stream };
56
public type A = B;
6-
public type B = ?A;
7-
public type list = ?node;
8-
public type node = { head : Nat; tail : list };
97
/// Doc comment for service id
108
public type s = actor { f : t; g : shared list -> async (B, tree, stream) };
11-
public type stream = ?{ head : Nat; next : shared query () -> async stream };
12-
public type t = shared (server : s) -> async ();
9+
public type B = ?A;
10+
public type list = ?node;
1311
public type tree = {
1412
#branch : { val : Int; left : tree; right : tree };
1513
#leaf : Int;
1614
};
15+
public type t = shared (server : s) -> async ();
16+
public type node = { head : Nat; tail : list };
1717
public type Self = s
1818
}

rust/candid_parser/tests/assets/ok/service.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
33

44
module {
5-
public type Func = shared () -> async Service;
65
public type Service = actor { f : Func };
6+
public type Func = shared () -> async Service;
77
public type Service2 = Service;
88
public type Self = actor {
99
asArray : shared query () -> async ([Service2], [Func]);

0 commit comments

Comments
 (0)