From c39be4635eaf2a7ad511072cee224735bd9c5ee6 Mon Sep 17 00:00:00 2001 From: vbasiuk Date: Wed, 11 Oct 2023 22:51:26 +0300 Subject: [PATCH] add check if hash.bigInt exists and handle if not --- src/circuits/common.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/circuits/common.ts b/src/circuits/common.ts index 95920cb8..509d4ed5 100644 --- a/src/circuits/common.ts +++ b/src/circuits/common.ts @@ -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() + ); }; /**