You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❌ Cannot call: another `transition` (unless from another program)
320
310
321
311
### Async Transition
322
-
An `async transition` function **modifies private state** exactly like a regular `transition`, but it also includes an onchain portion that can **modify onchain/public state**. It can call `function` and `inline` functions, but **cannot be called by a function or inline**. An `async transition`**must** return a `Future`.
312
+
An `async transition` function **modifies private state** exactly like a regular `transition`, but it also includes an onchain portion that can **modify public (onchain) state**.
313
+
314
+
It can call `function` and `inline` functions, but **cannot be called by a function or inline**.
async function check_program_edition(edition: u16) {
1196
+
assert_eq(self.edition, edition);
1197
+
}
1198
+
```
1199
+
1200
+
1201
+
The `self.edition` operator returns a program's edition, which is the program's version number. A program's edition starts at zero and is incremented by one for each upgrade. The edition is tracked automatically on the network.
1202
+
1203
+
You may also refer to another program's edition with the following syntax:
1204
+
```leo
1205
+
import credits.aleo;
1206
+
...
1207
+
let ext_edition: u16 = Program::edition(credits.aleo);
1208
+
```
1209
+
1210
+
:::info
1211
+
* The `self.edition` operator can only be used in an async function. Using it outside an async function will result in a compilation error.
1212
+
* The `self.edition` operator doesn't take any parameters.
1213
+
* To reference another program's edition, you will need to import that program first.
Copy file name to clipboardExpand all lines: documentation/language/programs_in_practice/functions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ function foo(
125
125
}
126
126
```
127
127
128
-
## Inline
128
+
## Inline Function
129
129
130
130
An inline function is declared as `inline {name}() {}`. Similar to helper functions, they contain expressions and statements that can compute values, and cannot be executed directly from the outside. The key difference is that the Leo compiler inlines the body of the function at each call site.
Copy file name to clipboardExpand all lines: documentation/language/programs_in_practice/limitations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ snarkVM imposes the following limits on Aleo programs:
22
22
23
23
Some other protocol-level limits to be aware of are:
24
24
-**the maximum transaction size is 128 KB.** If your program exceeds this, perhaps by requiring large inputs or producing large outputs, consider optimizing the data types in your Leo code.
25
-
-**the maxmimum number of micro-credits your transaction can consume for on-chain execution is `100_000_000`.**. If your program exceeds this, consider optimizing on-chain components of your Leo code.
25
+
-**the maximum number of micro-credits your transaction can consume for on-chain execution is `100_000_000`.**. If your program exceeds this, consider optimizing on-chain components of your Leo code.
26
26
27
27
As with the above restructions. these limits can only be increased via the governance process.
0 commit comments