From 71bbf737fca4d5009ce06770c1d7d217c6dd36f0 Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:28:06 +0100 Subject: [PATCH] fix: use correct tree arity and import from maci-core --- packages/contracts/tasks/helpers/Prover.ts | 4 ++-- packages/contracts/tasks/helpers/constants.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/contracts/tasks/helpers/Prover.ts b/packages/contracts/tasks/helpers/Prover.ts index 6f90a90ec..99db75d1c 100644 --- a/packages/contracts/tasks/helpers/Prover.ts +++ b/packages/contracts/tasks/helpers/Prover.ts @@ -1,4 +1,5 @@ /* eslint-disable no-console, no-await-in-loop */ +import { STATE_TREE_ARITY, MESSAGE_TREE_ARITY } from "maci-core"; import { G1Point, G2Point } from "maci-crypto"; import { VerifyingKey } from "maci-domainobjs"; @@ -8,7 +9,6 @@ import type { BigNumberish } from "ethers"; import { asHex, formatProofForVerifierContract } from "../../ts/utils"; -import { STATE_TREE_ARITY } from "./constants"; import { IProverParams } from "./types"; /** @@ -92,7 +92,7 @@ export class Prover { ]); const numMessages = Number(numSignUpsAndMessages[1]); - const messageBatchSize = STATE_TREE_ARITY ** Number(treeDepths[1]); + const messageBatchSize = MESSAGE_TREE_ARITY ** Number(treeDepths[1]); let totalMessageBatches = numMessages <= messageBatchSize ? 1 : Math.floor(numMessages / messageBatchSize); let numberBatchesProcessed = numBatchesProcessed; diff --git a/packages/contracts/tasks/helpers/constants.ts b/packages/contracts/tasks/helpers/constants.ts index ed02e3f62..38ed0b0bf 100644 --- a/packages/contracts/tasks/helpers/constants.ts +++ b/packages/contracts/tasks/helpers/constants.ts @@ -32,8 +32,6 @@ export enum EChainId { Coverage = 1337, } -export const STATE_TREE_ARITY = 5; - /** * Get network rpc urls object *