Skip to content

Commit 3079d0a

Browse files
authored
Merge pull request #583 from semaphore-protocol/refactor/artifacts-download
Remove code to create temporary folder for artifacts Former-commit-id: c00b007
2 parents 097e8b1 + 1a6e26b commit 3079d0a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/proof/src/get-snark-artifacts.node.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ export default async function getSnarkArtifacts(treeDepth: number): Promise<Snar
88
const tmpDir = "semaphore-proof"
99
const tmpPath = `${tmp.tmpdir}/${tmpDir}-${treeDepth}`
1010

11-
if (!fs.existsSync(tmpPath)) {
12-
tmp.dirSync({ name: `${tmpDir}-${treeDepth}` })
13-
}
14-
15-
if (fs.readdirSync(tmpPath).length !== 2) {
11+
if (!fs.existsSync(tmpPath) || fs.readdirSync(tmpPath).length !== 2) {
1612
await download(`https://semaphore.cedoor.dev/artifacts/${treeDepth}/semaphore.wasm`, tmpPath)
1713
await download(`https://semaphore.cedoor.dev/artifacts/${treeDepth}/semaphore.zkey`, tmpPath)
1814
}

0 commit comments

Comments
 (0)