From 4d211f005aac396e5ac56caffa5d96fabe51b024 Mon Sep 17 00:00:00 2001 From: Michel Erokhov Date: Thu, 16 Nov 2023 22:06:18 +0100 Subject: [PATCH] move check --- src/helpers/getBatchOfEntanglementsHashes.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/getBatchOfEntanglementsHashes.ts b/src/helpers/getBatchOfEntanglementsHashes.ts index cdbaa6a..ce4e4a7 100644 --- a/src/helpers/getBatchOfEntanglementsHashes.ts +++ b/src/helpers/getBatchOfEntanglementsHashes.ts @@ -41,15 +41,15 @@ export default async function getBatchOfEntanglementsHashes( type ) + if (hashIndex === -1) { + throw new Error(`This hash isn't among those added to the blockchain`) + } + if (isUsedAttestation && hashIndex === -1) throw new Error( `This verification method has already been used for another account!` ) - if (hashIndex === -1) { - throw new Error(`This hash isn't among those added to the blockchain`) - } - if (batchSize > filteredEntanglements.length) throw new Error(`Batch hasn't been completed`)