Skip to content

Commit

Permalink
update rapidsnark path and check for null or undefined tally result
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Nov 27, 2023
1 parent eb9bc9b commit 899f289
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/utils/maci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function getRecipientTallyResult(
): TallyResult {
// Create proof for tally result
const result = tally.results.tally[recipientIndex]
if (!result) {
if (result == null) {
// result is null or undefined
throw Error(`Missing tally result for index ${recipientIndex}`)
}

Expand Down Expand Up @@ -196,7 +197,7 @@ type getGenProofArgsInput = {
// the key get zkeys file mapping, see utils/circuits.ts
circuitType: string
circuitDirectory: string
rapidSnarkDirectory?: string
rapidSnark?: string
// where the proof will be produced
outputDir: string
}
Expand Down Expand Up @@ -234,12 +235,11 @@ export function getGenProofArgs(
maciTxHash,
circuitType,
circuitDirectory,
rapidSnarkDirectory,
rapidSnark,
outputDir,
} = args
const tallyFile = getTalyFilePath(outputDir)
const maciStateFile = path.join(outputDir, `macistate`)
const rapidSnarkExe = path.join(rapidSnarkDirectory || '', 'prover')

const {
processZkFile,
Expand Down Expand Up @@ -274,7 +274,7 @@ export function getGenProofArgs(
eth_provider: providerUrl,
poll_id: pollId.toString(),
tally_file: tallyFile,
rapidsnark: rapidSnarkExe,
rapidsnark: rapidSnark,
process_witnessgen: processWitness,
tally_witnessgen: tallyWitness,
process_zkey: processZkFile,
Expand Down

0 comments on commit 899f289

Please sign in to comment.