bstest001 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/prover.js +9 -5
- package/package.json +1 -1
- package/src/utils/prover.ts +9 -5
package/dist/utils/prover.js
CHANGED
|
@@ -29,12 +29,16 @@ async function proveBrowser(input, keyBasePath) {
|
|
|
29
29
|
return { pA, pB, pC };
|
|
30
30
|
}
|
|
31
31
|
async function proveNode(input, keyBasePath) {
|
|
32
|
-
// @ts-ignore webpackIgnore: true prevents bundler from trying to include
|
|
32
|
+
// @ts-ignore webpackIgnore: true prevents bundler from trying to include Node.js modules in browser
|
|
33
33
|
const { execFile } = await import(/* webpackIgnore: true */ 'child_process');
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
const { promises: fs } = await import(/* webpackIgnore: true */ 'fs');
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
const os = (await import(/* webpackIgnore: true */ 'os')).default;
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
const path = (await import(/* webpackIgnore: true */ 'path')).default;
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
const { promisify } = await import(/* webpackIgnore: true */ 'util');
|
|
38
42
|
const execFileAsync = promisify(execFile);
|
|
39
43
|
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'privacycash-proof-'));
|
|
40
44
|
const inputPath = path.join(tmpDir, 'input.json');
|
package/package.json
CHANGED
package/src/utils/prover.ts
CHANGED
|
@@ -39,12 +39,16 @@ async function proveBrowser(input: any, keyBasePath: string) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
async function proveNode(input: any, keyBasePath: string) {
|
|
42
|
-
// @ts-ignore webpackIgnore: true prevents bundler from trying to include
|
|
42
|
+
// @ts-ignore webpackIgnore: true prevents bundler from trying to include Node.js modules in browser
|
|
43
43
|
const { execFile } = await import(/* webpackIgnore: true */ 'child_process');
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
const { promises: fs } = await import(/* webpackIgnore: true */ 'fs');
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
const os = (await import(/* webpackIgnore: true */ 'os')).default;
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
const path = (await import(/* webpackIgnore: true */ 'path')).default;
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
const { promisify } = await import(/* webpackIgnore: true */ 'util');
|
|
48
52
|
const execFileAsync = promisify(execFile);
|
|
49
53
|
|
|
50
54
|
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'privacycash-proof-'));
|