From 0067e296c0e8985c09a75430c169c3574dfdd02d Mon Sep 17 00:00:00 2001 From: JordyRo1 Date: Thu, 11 Jul 2024 10:42:40 +0200 Subject: [PATCH] fix: `build_tree` iteration condition change --- contracts/src/contracts/hooks/merkle_tree_hook.cairo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/src/contracts/hooks/merkle_tree_hook.cairo b/contracts/src/contracts/hooks/merkle_tree_hook.cairo index 7bd8be3..1e8b88c 100644 --- a/contracts/src/contracts/hooks/merkle_tree_hook.cairo +++ b/contracts/src/contracts/hooks/merkle_tree_hook.cairo @@ -303,8 +303,8 @@ pub mod merkle_tree_hook { let mut cur_idx = 0; let mut tree = array![]; loop { - if (cur_idx == self.count.read() - 1) { - break (); + if (cur_idx >= TREE_DEPTH) { + break; } tree.append(self.tree.read(cur_idx)); cur_idx += 1;