Skip to content

Commit

Permalink
add check if hash.bigInt exists and handle if not
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Oct 11, 2023
1 parent b3757fe commit c39be46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/circuits/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ export const prepareSiblingsStr = (proof: Proof, levels: number): string[] => {
for (let i = siblings.length; i < levels; i++) {
siblings.push(ZERO_HASH);
}
return siblings.map((s) => (typeof s === 'string' ? s : s.bigInt().toString()));
return siblings.map((s) =>
typeof s === 'string'
? s
: s.bigInt
? s.bigInt().toString()
: new Hash(Object.values(s.bytes) as unknown as Uint8Array).bigInt().toString()
);
};

/**
Expand Down

0 comments on commit c39be46

Please sign in to comment.