diff --git a/src/examples/zkapps/reducer/actions-as-merkle-list.ts b/src/examples/zkapps/reducer/actions-as-merkle-list.ts index eb0ac18a0f..16ce8ea29c 100644 --- a/src/examples/zkapps/reducer/actions-as-merkle-list.ts +++ b/src/examples/zkapps/reducer/actions-as-merkle-list.ts @@ -85,13 +85,11 @@ class ActionsContract extends SmartContract { // (note: if we're past the actual sizes, `.pop()` returns a dummy Action -- in this case, the "empty" public key which is not equal to any real address) let hasAddress = Bool(false); - let iter = merkleActionss.startIterating(); - for (let i = 0; i < MAX_UPDATES_WITH_ACTIONS; i++) { - let merkleActions = iter.next(); - let innerIter = merkleActions.startIterating(); + let merkleActions = merkleActionss.pop(); + for (let j = 0; j < MAX_ACTIONS_PER_UPDATE; j++) { - let action = innerIter.next(); + let action = merkleActions.pop(); hasAddress = hasAddress.or(action.equals(address)); } }