Skip to content

Commit c39be46

Browse files
add check if hash.bigInt exists and handle if not
1 parent b3757fe commit c39be46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/circuits/common.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ export const prepareSiblingsStr = (proof: Proof, levels: number): string[] => {
119119
for (let i = siblings.length; i < levels; i++) {
120120
siblings.push(ZERO_HASH);
121121
}
122-
return siblings.map((s) => (typeof s === 'string' ? s : s.bigInt().toString()));
122+
return siblings.map((s) =>
123+
typeof s === 'string'
124+
? s
125+
: s.bigInt
126+
? s.bigInt().toString()
127+
: new Hash(Object.values(s.bytes) as unknown as Uint8Array).bigInt().toString()
128+
);
123129
};
124130

125131
/**

0 commit comments

Comments
 (0)