@noir-lang/noir_js 1.0.0-beta.3-7000792.nightly → 1.0.0-beta.4-17958e3.nightly
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/lib/base64_decode.cjs +1 -2
- package/lib/debug.cjs +76 -0
- package/lib/debug.d.ts +37 -0
- package/lib/debug.mjs +72 -0
- package/lib/index.cjs +17 -7
- package/lib/program.cjs +17 -7
- package/lib/witness_generation.cjs +32 -18
- package/lib/witness_generation.d.ts +1 -0
- package/lib/witness_generation.mjs +31 -16
- package/package.json +18 -16
package/lib/base64_decode.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.base64Decode =
|
|
3
|
+
exports.base64Decode = base64Decode;
|
|
4
4
|
// Since this is a simple function, we can use feature detection to
|
|
5
5
|
// see if we are in the nodeJs environment or the browser environment.
|
|
6
6
|
function base64Decode(input) {
|
|
@@ -16,4 +16,3 @@ function base64Decode(input) {
|
|
|
16
16
|
throw new Error('No implementation found for base64 decoding.');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
exports.base64Decode = base64Decode;
|
package/lib/debug.cjs
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDebugSymbols = parseDebugSymbols;
|
|
4
|
+
exports.extractCallStack = extractCallStack;
|
|
5
|
+
const pako_1 = require("pako");
|
|
6
|
+
const base64_decode_1 = require("./base64_decode.cjs");
|
|
7
|
+
function parseDebugSymbols(debugSymbols) {
|
|
8
|
+
return JSON.parse((0, pako_1.inflate)((0, base64_decode_1.base64Decode)(debugSymbols), { to: 'string', raw: true })).debug_infos;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the call stack from an thrown by the acvm.
|
|
12
|
+
* @param error - The error to extract from.
|
|
13
|
+
* @param debug - The debug metadata of the program called.
|
|
14
|
+
* @param files - The files used for compilation of the program.
|
|
15
|
+
* @returns The call stack, if available.
|
|
16
|
+
*/
|
|
17
|
+
function extractCallStack(error, debug, files) {
|
|
18
|
+
if (!('callStack' in error) || !error.callStack) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const { callStack, brilligFunctionId } = error;
|
|
22
|
+
if (!debug) {
|
|
23
|
+
return callStack;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
return resolveOpcodeLocations(callStack, debug, files, brilligFunctionId);
|
|
27
|
+
}
|
|
28
|
+
catch (_err) {
|
|
29
|
+
return callStack;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolves the source code locations from an array of opcode locations
|
|
34
|
+
*/
|
|
35
|
+
function resolveOpcodeLocations(opcodeLocations, debug, files, brilligFunctionId) {
|
|
36
|
+
return opcodeLocations.flatMap((opcodeLocation) => getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the call stack from the location of a failing opcode and the debug metadata.
|
|
40
|
+
* One opcode can point to multiple calls due to inlining.
|
|
41
|
+
*/
|
|
42
|
+
function getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId) {
|
|
43
|
+
let callStack = debug.locations[opcodeLocation] || [];
|
|
44
|
+
if (callStack.length === 0) {
|
|
45
|
+
const brilligLocation = extractBrilligLocation(opcodeLocation);
|
|
46
|
+
if (brilligFunctionId !== undefined && brilligLocation !== undefined) {
|
|
47
|
+
callStack = debug.brillig_locations[brilligFunctionId][brilligLocation] || [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return callStack.map((call) => {
|
|
51
|
+
const { file: fileId, span } = call;
|
|
52
|
+
const { path, source } = files[fileId];
|
|
53
|
+
const locationText = source.substring(span.start, span.end);
|
|
54
|
+
const precedingText = source.substring(0, span.start);
|
|
55
|
+
const previousLines = precedingText.split('\n');
|
|
56
|
+
// Lines and columns in stacks are one indexed.
|
|
57
|
+
const line = previousLines.length;
|
|
58
|
+
const column = previousLines[previousLines.length - 1].length + 1;
|
|
59
|
+
return {
|
|
60
|
+
filePath: path,
|
|
61
|
+
line,
|
|
62
|
+
column,
|
|
63
|
+
locationText,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Extracts a brillig location from an opcode location.
|
|
69
|
+
*/
|
|
70
|
+
function extractBrilligLocation(opcodeLocation) {
|
|
71
|
+
const splitted = opcodeLocation.split('.');
|
|
72
|
+
if (splitted.length === 2) {
|
|
73
|
+
return splitted[1];
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
package/lib/debug.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DebugFileMap, DebugInfo, OpcodeLocation } from '@noir-lang/types';
|
|
2
|
+
import { ExecutionError } from '@noir-lang/acvm_js';
|
|
3
|
+
/**
|
|
4
|
+
* A stack of calls, resolved or not
|
|
5
|
+
*/
|
|
6
|
+
type CallStack = SourceCodeLocation[] | OpcodeLocation[];
|
|
7
|
+
/**
|
|
8
|
+
* A resolved pointer to a failing section of the noir source code.
|
|
9
|
+
*/
|
|
10
|
+
interface SourceCodeLocation {
|
|
11
|
+
/**
|
|
12
|
+
* The path to the source file.
|
|
13
|
+
*/
|
|
14
|
+
filePath: string;
|
|
15
|
+
/**
|
|
16
|
+
* The line number of the location.
|
|
17
|
+
*/
|
|
18
|
+
line: number;
|
|
19
|
+
/**
|
|
20
|
+
* The column number of the location.
|
|
21
|
+
*/
|
|
22
|
+
column: number;
|
|
23
|
+
/**
|
|
24
|
+
* The source code text of the location.
|
|
25
|
+
*/
|
|
26
|
+
locationText: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function parseDebugSymbols(debugSymbols: string): DebugInfo[];
|
|
29
|
+
/**
|
|
30
|
+
* Extracts the call stack from an thrown by the acvm.
|
|
31
|
+
* @param error - The error to extract from.
|
|
32
|
+
* @param debug - The debug metadata of the program called.
|
|
33
|
+
* @param files - The files used for compilation of the program.
|
|
34
|
+
* @returns The call stack, if available.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractCallStack(error: ExecutionError, debug: DebugInfo, files: DebugFileMap): CallStack | undefined;
|
|
37
|
+
export {};
|
package/lib/debug.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { inflate } from 'pako';
|
|
2
|
+
import { base64Decode } from "./base64_decode.mjs";
|
|
3
|
+
export function parseDebugSymbols(debugSymbols) {
|
|
4
|
+
return JSON.parse(inflate(base64Decode(debugSymbols), { to: 'string', raw: true })).debug_infos;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Extracts the call stack from an thrown by the acvm.
|
|
8
|
+
* @param error - The error to extract from.
|
|
9
|
+
* @param debug - The debug metadata of the program called.
|
|
10
|
+
* @param files - The files used for compilation of the program.
|
|
11
|
+
* @returns The call stack, if available.
|
|
12
|
+
*/
|
|
13
|
+
export function extractCallStack(error, debug, files) {
|
|
14
|
+
if (!('callStack' in error) || !error.callStack) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
const { callStack, brilligFunctionId } = error;
|
|
18
|
+
if (!debug) {
|
|
19
|
+
return callStack;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return resolveOpcodeLocations(callStack, debug, files, brilligFunctionId);
|
|
23
|
+
}
|
|
24
|
+
catch (_err) {
|
|
25
|
+
return callStack;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolves the source code locations from an array of opcode locations
|
|
30
|
+
*/
|
|
31
|
+
function resolveOpcodeLocations(opcodeLocations, debug, files, brilligFunctionId) {
|
|
32
|
+
return opcodeLocations.flatMap((opcodeLocation) => getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Extracts the call stack from the location of a failing opcode and the debug metadata.
|
|
36
|
+
* One opcode can point to multiple calls due to inlining.
|
|
37
|
+
*/
|
|
38
|
+
function getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId) {
|
|
39
|
+
let callStack = debug.locations[opcodeLocation] || [];
|
|
40
|
+
if (callStack.length === 0) {
|
|
41
|
+
const brilligLocation = extractBrilligLocation(opcodeLocation);
|
|
42
|
+
if (brilligFunctionId !== undefined && brilligLocation !== undefined) {
|
|
43
|
+
callStack = debug.brillig_locations[brilligFunctionId][brilligLocation] || [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return callStack.map((call) => {
|
|
47
|
+
const { file: fileId, span } = call;
|
|
48
|
+
const { path, source } = files[fileId];
|
|
49
|
+
const locationText = source.substring(span.start, span.end);
|
|
50
|
+
const precedingText = source.substring(0, span.start);
|
|
51
|
+
const previousLines = precedingText.split('\n');
|
|
52
|
+
// Lines and columns in stacks are one indexed.
|
|
53
|
+
const line = previousLines.length;
|
|
54
|
+
const column = previousLines[previousLines.length - 1].length + 1;
|
|
55
|
+
return {
|
|
56
|
+
filePath: path,
|
|
57
|
+
line,
|
|
58
|
+
column,
|
|
59
|
+
locationText,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Extracts a brillig location from an opcode location.
|
|
65
|
+
*/
|
|
66
|
+
function extractBrilligLocation(opcodeLocation) {
|
|
67
|
+
const splitted = opcodeLocation.split('.');
|
|
68
|
+
if (splitted.length === 2) {
|
|
69
|
+
return splitted[1];
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
package/lib/index.cjs
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.abi = exports.acvm = exports.Noir = exports.and = exports.xor = exports.blake2s256 = exports.ecdsa_secp256k1_verify = exports.ecdsa_secp256r1_verify = void 0;
|
|
27
37
|
const acvm = __importStar(require("@noir-lang/acvm_js"));
|
package/lib/program.cjs
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Noir = void 0;
|
|
27
37
|
const witness_generation_js_1 = require("./witness_generation.cjs");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateWitness =
|
|
3
|
+
exports.generateWitness = generateWitness;
|
|
4
4
|
const noirc_abi_1 = require("@noir-lang/noirc_abi");
|
|
5
5
|
const base64_decode_js_1 = require("./base64_decode.cjs");
|
|
6
6
|
const acvm_js_1 = require("@noir-lang/acvm_js");
|
|
7
|
+
const debug_js_1 = require("./debug.cjs");
|
|
7
8
|
const defaultForeignCallHandler = async (name, args) => {
|
|
8
9
|
if (name == 'print') {
|
|
9
10
|
// By default we do not print anything for `print` foreign calls due to a need for formatting,
|
|
@@ -14,25 +15,39 @@ const defaultForeignCallHandler = async (name, args) => {
|
|
|
14
15
|
}
|
|
15
16
|
throw Error(`Unexpected oracle during execution: ${name}(${args.join(', ')})`);
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
-
const payload = originalError.rawAssertionPayload;
|
|
19
|
-
if (!payload)
|
|
20
|
-
return originalError;
|
|
18
|
+
function enrichExecutionError(artifact, originalError) {
|
|
21
19
|
const enrichedError = originalError;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
if (originalError.rawAssertionPayload) {
|
|
21
|
+
try {
|
|
22
|
+
// Decode the payload
|
|
23
|
+
const decodedPayload = (0, noirc_abi_1.abiDecodeError)(artifact.abi, originalError.rawAssertionPayload);
|
|
24
|
+
if (typeof decodedPayload === 'string') {
|
|
25
|
+
// If it's a string, just add it to the error message
|
|
26
|
+
enrichedError.message = `Circuit execution failed: ${decodedPayload}`;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// If not, attach the payload to the original error
|
|
30
|
+
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
33
|
+
catch (_errorDecoding) {
|
|
34
|
+
// Ignore errors decoding the payload
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
|
|
35
|
-
//
|
|
37
|
+
try {
|
|
38
|
+
// Decode the callstack
|
|
39
|
+
const callStack = (0, debug_js_1.extractCallStack)(originalError, (0, debug_js_1.parseDebugSymbols)(artifact.debug_symbols)[originalError.acirFunctionId], artifact.file_map);
|
|
40
|
+
enrichedError.noirCallStack = callStack?.map((errorLocation) => {
|
|
41
|
+
if (typeof errorLocation === 'string') {
|
|
42
|
+
return `at opcode ${errorLocation}`;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return `at ${errorLocation.locationText} (${errorLocation.filePath}:${errorLocation.line}:${errorLocation.column})`;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (_errorResolving) {
|
|
50
|
+
// Ignore errors resolving the callstack
|
|
36
51
|
}
|
|
37
52
|
return enrichedError;
|
|
38
53
|
}
|
|
@@ -49,9 +64,8 @@ async function generateWitness(compiledProgram, inputs, foreignCallHandler = def
|
|
|
49
64
|
catch (err) {
|
|
50
65
|
// Typescript types catched errors as unknown or any, so we need to narrow its type to check if it has raw assertion payload.
|
|
51
66
|
if (typeof err === 'object' && err !== null && 'rawAssertionPayload' in err) {
|
|
52
|
-
throw
|
|
67
|
+
throw enrichExecutionError(compiledProgram, err);
|
|
53
68
|
}
|
|
54
69
|
throw new Error(`Circuit execution failed: ${err}`);
|
|
55
70
|
}
|
|
56
71
|
}
|
|
57
|
-
exports.generateWitness = generateWitness;
|
|
@@ -3,5 +3,6 @@ import { WitnessStack, ForeignCallHandler, ExecutionError } from '@noir-lang/acv
|
|
|
3
3
|
import { CompiledCircuit } from '@noir-lang/types';
|
|
4
4
|
export type ErrorWithPayload = ExecutionError & {
|
|
5
5
|
decodedAssertionPayload?: any;
|
|
6
|
+
noirCallStack?: string[];
|
|
6
7
|
};
|
|
7
8
|
export declare function generateWitness(compiledProgram: CompiledCircuit, inputs: InputMap, foreignCallHandler?: ForeignCallHandler): Promise<WitnessStack>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { abiDecodeError, abiEncode } from '@noir-lang/noirc_abi';
|
|
2
2
|
import { base64Decode } from "./base64_decode.mjs";
|
|
3
3
|
import { executeProgram } from '@noir-lang/acvm_js';
|
|
4
|
+
import { extractCallStack, parseDebugSymbols } from "./debug.mjs";
|
|
4
5
|
const defaultForeignCallHandler = async (name, args) => {
|
|
5
6
|
if (name == 'print') {
|
|
6
7
|
// By default we do not print anything for `print` foreign calls due to a need for formatting,
|
|
@@ -11,25 +12,39 @@ const defaultForeignCallHandler = async (name, args) => {
|
|
|
11
12
|
}
|
|
12
13
|
throw Error(`Unexpected oracle during execution: ${name}(${args.join(', ')})`);
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
const payload = originalError.rawAssertionPayload;
|
|
16
|
-
if (!payload)
|
|
17
|
-
return originalError;
|
|
15
|
+
function enrichExecutionError(artifact, originalError) {
|
|
18
16
|
const enrichedError = originalError;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
if (originalError.rawAssertionPayload) {
|
|
18
|
+
try {
|
|
19
|
+
// Decode the payload
|
|
20
|
+
const decodedPayload = abiDecodeError(artifact.abi, originalError.rawAssertionPayload);
|
|
21
|
+
if (typeof decodedPayload === 'string') {
|
|
22
|
+
// If it's a string, just add it to the error message
|
|
23
|
+
enrichedError.message = `Circuit execution failed: ${decodedPayload}`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
// If not, attach the payload to the original error
|
|
27
|
+
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
enrichedError.decodedAssertionPayload = decodedPayload;
|
|
30
|
+
catch (_errorDecoding) {
|
|
31
|
+
// Ignore errors decoding the payload
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
//
|
|
34
|
+
try {
|
|
35
|
+
// Decode the callstack
|
|
36
|
+
const callStack = extractCallStack(originalError, parseDebugSymbols(artifact.debug_symbols)[originalError.acirFunctionId], artifact.file_map);
|
|
37
|
+
enrichedError.noirCallStack = callStack?.map((errorLocation) => {
|
|
38
|
+
if (typeof errorLocation === 'string') {
|
|
39
|
+
return `at opcode ${errorLocation}`;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return `at ${errorLocation.locationText} (${errorLocation.filePath}:${errorLocation.line}:${errorLocation.column})`;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (_errorResolving) {
|
|
47
|
+
// Ignore errors resolving the callstack
|
|
33
48
|
}
|
|
34
49
|
return enrichedError;
|
|
35
50
|
}
|
|
@@ -46,7 +61,7 @@ export async function generateWitness(compiledProgram, inputs, foreignCallHandle
|
|
|
46
61
|
catch (err) {
|
|
47
62
|
// Typescript types catched errors as unknown or any, so we need to narrow its type to check if it has raw assertion payload.
|
|
48
63
|
if (typeof err === 'object' && err !== null && 'rawAssertionPayload' in err) {
|
|
49
|
-
throw
|
|
64
|
+
throw enrichExecutionError(compiledProgram, err);
|
|
50
65
|
}
|
|
51
66
|
throw new Error(`Circuit execution failed: ${err}`);
|
|
52
67
|
}
|
package/package.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contributors": [
|
|
4
4
|
"The Noir Team <team@noir-lang.org>"
|
|
5
5
|
],
|
|
6
|
-
"version": "1.0.0-beta.
|
|
7
|
-
"packageManager": "yarn@
|
|
6
|
+
"version": "1.0.0-beta.4-17958e3.nightly",
|
|
7
|
+
"packageManager": "yarn@4.5.2",
|
|
8
8
|
"license": "(MIT OR Apache-2.0)",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"homepage": "https://noir-lang.org/",
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
"url": "https://github.com/noir-lang/noir/issues"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@noir-lang/acvm_js": "1.0.0-beta.
|
|
21
|
-
"@noir-lang/noirc_abi": "1.0.0-beta.
|
|
22
|
-
"@noir-lang/types": "1.0.0-beta.
|
|
20
|
+
"@noir-lang/acvm_js": "1.0.0-beta.4-17958e3.nightly",
|
|
21
|
+
"@noir-lang/noirc_abi": "1.0.0-beta.4-17958e3.nightly",
|
|
22
|
+
"@noir-lang/types": "1.0.0-beta.4-17958e3.nightly",
|
|
23
|
+
"pako": "^2.1.0"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
25
26
|
"lib",
|
|
@@ -43,24 +44,25 @@
|
|
|
43
44
|
"test:node:cjs": "mocha --timeout 25000 --exit --config ./.mocharc.cjs.json",
|
|
44
45
|
"prettier": "prettier 'src/**/*.ts'",
|
|
45
46
|
"prettier:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
|
|
46
|
-
"lint": "NODE_NO_WARNINGS=1 eslint . --
|
|
47
|
+
"lint": "NODE_NO_WARNINGS=1 eslint . --max-warnings 0",
|
|
47
48
|
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
48
49
|
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
49
50
|
"clean": "rm -rf ./lib"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@types/chai": "^4",
|
|
53
|
-
"@types/mocha": "^10.0.
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"@types/
|
|
54
|
+
"@types/mocha": "^10.0.10",
|
|
55
|
+
"@types/node": "^22.13.10",
|
|
56
|
+
"@types/pako": "^2",
|
|
57
|
+
"@types/prettier": "^3.0.0",
|
|
56
58
|
"chai": "^4.4.1",
|
|
57
|
-
"eslint": "^
|
|
58
|
-
"eslint-plugin-prettier": "^5.
|
|
59
|
-
"mocha": "^
|
|
60
|
-
"prettier": "3.
|
|
61
|
-
"ts-node": "^10.9.
|
|
59
|
+
"eslint": "^9.24.0",
|
|
60
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
61
|
+
"mocha": "^11.1.0",
|
|
62
|
+
"prettier": "3.5.3",
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
62
64
|
"tsc-multi": "^1.1.0",
|
|
63
|
-
"tsx": "^4.
|
|
64
|
-
"typescript": "^5.
|
|
65
|
+
"tsx": "^4.19.3",
|
|
66
|
+
"typescript": "^5.8.3"
|
|
65
67
|
}
|
|
66
68
|
}
|