@@ -56,15 +56,17 @@ contract Parent {
56
56
context .call_public_function (target_contract , target_selector , [target_value ]);
57
57
}
58
58
59
- // Private function that enqueues two calls to a child contract:
59
+ // Private function that enqueues two calls to a child contract:
60
60
// - one through a nested call to enqueue_call_to_child with value 10,
61
61
// - followed by one issued directly from this function with value 20.
62
62
#[aztec(private)]
63
63
fn enqueue_calls_to_child_with_nested_first (
64
64
target_contract : AztecAddress ,
65
65
target_selector : FunctionSelector
66
66
) {
67
- let enqueue_call_to_child_selector = FunctionSelector ::from_signature ("enqueue_call_to_child((Field),(u32),Field)" );
67
+ let enqueue_call_to_child_selector = comptime {
68
+ FunctionSelector ::from_signature ("enqueue_call_to_child((Field),(u32),Field)" )
69
+ };
68
70
let _ret = context .call_private_function (
69
71
context .this_address (),
70
72
enqueue_call_to_child_selector ,
@@ -73,7 +75,7 @@ contract Parent {
73
75
context .call_public_function (target_contract , target_selector , [20 ]);
74
76
}
75
77
76
- // Private function that enqueues two calls to a child contract:
78
+ // Private function that enqueues two calls to a child contract:
77
79
// - one issued directly from this function with value 20,
78
80
// - followed by one through a nested call to enqueue_call_to_child with value 10.
79
81
#[aztec(private)]
@@ -82,7 +84,9 @@ contract Parent {
82
84
target_selector : FunctionSelector
83
85
) {
84
86
context .call_public_function (target_contract , target_selector , [20 ]);
85
- let enqueue_call_to_child_selector = FunctionSelector ::from_signature ("enqueue_call_to_child((Field),(u32),Field)" );
87
+ let enqueue_call_to_child_selector = comptime {
88
+ FunctionSelector ::from_signature ("enqueue_call_to_child((Field),(u32),Field)" )
89
+ };
86
90
let _ret = context .call_private_function (
87
91
context .this_address (),
88
92
enqueue_call_to_child_selector ,
@@ -110,7 +114,9 @@ contract Parent {
110
114
target_selector : FunctionSelector ,
111
115
target_value : Field
112
116
) {
113
- let pub_entry_point_selector = FunctionSelector ::from_signature ("pub_entry_point((Field),(u32),Field)" );
117
+ let pub_entry_point_selector = comptime {
118
+ FunctionSelector ::from_signature ("pub_entry_point((Field),(u32),Field)" )
119
+ };
114
120
let this_address = context .this_address ();
115
121
let _void = context .call_public_function (
116
122
this_address ,
@@ -126,7 +132,9 @@ contract Parent {
126
132
target_selector : FunctionSelector ,
127
133
target_value : Field
128
134
) {
129
- let pub_entry_point_selector = FunctionSelector ::from_signature ("pub_entry_point((Field),(u32),Field)" );
135
+ let pub_entry_point_selector = comptime {
136
+ FunctionSelector ::from_signature ("pub_entry_point((Field),(u32),Field)" )
137
+ };
130
138
let this_address = context .this_address ();
131
139
132
140
context .call_public_function (
@@ -265,7 +273,9 @@ contract Parent {
265
273
let value_to_set = 7 ;
266
274
let parent_private_set_call_interface = Parent ::interface ().private_call (
267
275
child_contract_address ,
268
- FunctionSelector ::from_signature ("private_set_value(Field,(Field))" ),
276
+ comptime {
277
+ FunctionSelector ::from_signature ("private_set_value(Field,(Field))" )
278
+ },
269
279
[value_to_set , owner .to_field ()]
270
280
);
271
281
let result : Field = env .call_private (parent_private_set_call_interface );
@@ -282,7 +292,9 @@ contract Parent {
282
292
// Get value from child through parent
283
293
let parent_private_get_call_interface = Parent ::interface ().private_call (
284
294
child_contract_address ,
285
- FunctionSelector ::from_signature ("private_get_value(Field,(Field))" ),
295
+ comptime {
296
+ FunctionSelector ::from_signature ("private_get_value(Field,(Field))" )
297
+ },
286
298
[7 , owner .to_field ()]
287
299
);
288
300
let read_result : Field = env .call_private (parent_private_get_call_interface );
0 commit comments