Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a616c01

Browse files
committedOct 17, 2022
any children
1 parent 7fd540e commit a616c01

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed
 

‎src/examples/zkapps/dex/dex.ts

+4-16
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,8 @@ class TokenContract extends SmartContract {
308308
@method authorizeUpdate(zkappUpdate: AccountUpdate) {
309309
// adopt this account update as a child, allowing a certain layout for its own children
310310
// we allow 10 child account updates, in a left-biased tree of width 3
311-
let { NoChildren, StaticChildren } = AccountUpdate.Layout;
312-
let layout = StaticChildren(
313-
StaticChildren(
314-
StaticChildren(StaticChildren(NoChildren), NoChildren),
315-
NoChildren
316-
),
317-
NoChildren
318-
);
311+
let { NoChildren, StaticChildren, AnyChildren } = AccountUpdate.Layout;
312+
let layout = AnyChildren;
319313
this.experimental.authorize(zkappUpdate, layout);
320314

321315
// walk account updates to see if balances for this token cancel
@@ -331,14 +325,8 @@ class TokenContract extends SmartContract {
331325
) {
332326
// adopt this account update as a child, allowing a certain layout for its own children
333327
// we allow 10 child account updates, in a left-biased tree of width 3
334-
let { NoChildren, StaticChildren } = AccountUpdate.Layout;
335-
let layout = StaticChildren(
336-
StaticChildren(
337-
StaticChildren(StaticChildren(NoChildren), NoChildren),
338-
NoChildren
339-
),
340-
NoChildren
341-
);
328+
let { NoChildren, StaticChildren, AnyChildren } = AccountUpdate.Layout;
329+
let layout = AnyChildren;
342330
this.experimental.authorize(zkappUpdate, layout);
343331

344332
// walk account updates to see if balances cancel the amount sent

0 commit comments

Comments
 (0)
Please sign in to comment.