From 10debcc1f6ea636c1747cbdd482e2fab0099e6de Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 15 Sep 2023 19:18:27 +0100 Subject: [PATCH 1/2] chore: unify linting setup for JS code --- .eslintrc.js | 19 +++++++++++++++++++ .github/workflows/formatting.yml | 17 ++++++++++++++++- compiler/integration-tests/.eslintignore | 1 + compiler/integration-tests/.eslintrc.js | 18 +----------------- compiler/integration-tests/package.json | 3 ++- compiler/source-resolver/.eslintignore | 1 + compiler/source-resolver/.eslintrc.js | 3 +++ compiler/source-resolver/package.json | 3 ++- compiler/wasm/.eslintignore | 1 + compiler/wasm/.eslintrc.js | 3 +++ compiler/wasm/package.json | 3 ++- package.json | 3 ++- tooling/noir_js/.eslintignore | 1 + tooling/noir_js/.eslintrc.js | 3 +++ tooling/noir_js/package.json | 3 ++- tooling/noirc_abi_wasm/.eslintrc.js | 18 +----------------- 16 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 .eslintrc.js create mode 100644 compiler/integration-tests/.eslintignore create mode 100644 compiler/source-resolver/.eslintignore create mode 100644 compiler/source-resolver/.eslintrc.js create mode 100644 compiler/wasm/.eslintignore create mode 100644 compiler/wasm/.eslintrc.js create mode 100644 tooling/noir_js/.eslintignore create mode 100644 tooling/noir_js/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000000..b1346a8792f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,19 @@ +module.exports = { + root: true, + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint", "prettier"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + rules: { + "comma-spacing": ["error", { before: false, after: true }], + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", // or "error" + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + "prettier/prettier": "error", + }, +}; diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index bdc95b40bd5..07ae535a454 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -1,4 +1,4 @@ -name: Clippy +name: Formatting on: pull_request: @@ -48,3 +48,18 @@ jobs: - name: Run `cargo fmt` run: cargo fmt --all --check + + eslint: + name: eslint + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Yarn dependencies + uses: ./.github/actions/setup + + - name: Run `yarn lint` + run: yarn lint diff --git a/compiler/integration-tests/.eslintignore b/compiler/integration-tests/.eslintignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/compiler/integration-tests/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/compiler/integration-tests/.eslintrc.js b/compiler/integration-tests/.eslintrc.js index d17e4ef520c..33335c2a877 100644 --- a/compiler/integration-tests/.eslintrc.js +++ b/compiler/integration-tests/.eslintrc.js @@ -1,19 +1,3 @@ module.exports = { - root: true, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint", "prettier"], - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - rules: { - "comma-spacing": ["error", { before: false, after: true }], - // "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", // or "error" - { - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - caughtErrorsIgnorePattern: "^_", - }, - ], - "prettier/prettier": "error", - } + extends: ["../../.eslintrc.js"], }; diff --git a/compiler/integration-tests/package.json b/compiler/integration-tests/package.json index 8ba0d2c725a..32d567107cf 100644 --- a/compiler/integration-tests/package.json +++ b/compiler/integration-tests/package.json @@ -8,7 +8,8 @@ "test": "yarn test:browser", "test:browser": "web-test-runner", "test:integration:browser": "web-test-runner test//integration/browser/**/*.test.ts", - "test:integration:browser:watch": "web-test-runner test/integration/browser/**/*.test.ts --watch" + "test:integration:browser:watch": "web-test-runner test/integration/browser/**/*.test.ts --watch", + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "dependencies": { "@aztec/bb.js": "^0.5.1", diff --git a/compiler/source-resolver/.eslintignore b/compiler/source-resolver/.eslintignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/compiler/source-resolver/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/compiler/source-resolver/.eslintrc.js b/compiler/source-resolver/.eslintrc.js new file mode 100644 index 00000000000..33335c2a877 --- /dev/null +++ b/compiler/source-resolver/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["../../.eslintrc.js"], +}; diff --git a/compiler/source-resolver/package.json b/compiler/source-resolver/package.json index 76ce4657c10..95b535f337b 100644 --- a/compiler/source-resolver/package.json +++ b/compiler/source-resolver/package.json @@ -22,7 +22,8 @@ "build:web": "tsc -p tsconfig.esm.json", "build": "npm run clean-modules && npm run build:node && npm run build:web && npm run generate-types", "test": "ava", - "generate-types": "tsc src/*.ts --declaration --emitDeclarationOnly --outDir types" + "generate-types": "tsc src/*.ts --declaration --emitDeclarationOnly --outDir types", + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "devDependencies": { "@types/node": "^20.5.7", diff --git a/compiler/wasm/.eslintignore b/compiler/wasm/.eslintignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/compiler/wasm/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/compiler/wasm/.eslintrc.js b/compiler/wasm/.eslintrc.js new file mode 100644 index 00000000000..33335c2a877 --- /dev/null +++ b/compiler/wasm/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["../../.eslintrc.js"], +}; diff --git a/compiler/wasm/package.json b/compiler/wasm/package.json index dd01b6d75cd..c71d4879511 100644 --- a/compiler/wasm/package.json +++ b/compiler/wasm/package.json @@ -22,7 +22,8 @@ "build": "bash ./build.sh", "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", "test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", - "test:browser": "web-test-runner" + "test:browser": "web-test-runner", + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "peerDependencies": { "@noir-lang/source-resolver": "workspace:*" diff --git a/package.json b/package.json index 873ced5f3d1..abfa7f270ba 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "scripts": { "build": "yarn workspaces foreach run build", "test": "yarn workspaces foreach run test", - "test:integration": "yarn workspace integration-tests test" + "test:integration": "yarn workspace integration-tests test", + "lint": "yarn workspaces foreach run lint" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.59.5", diff --git a/tooling/noir_js/.eslintignore b/tooling/noir_js/.eslintignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/tooling/noir_js/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/tooling/noir_js/.eslintrc.js b/tooling/noir_js/.eslintrc.js new file mode 100644 index 00000000000..33335c2a877 --- /dev/null +++ b/tooling/noir_js/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["../../.eslintrc.js"], +}; diff --git a/tooling/noir_js/package.json b/tooling/noir_js/package.json index 5eeccc3c790..e08fc8eef32 100644 --- a/tooling/noir_js/package.json +++ b/tooling/noir_js/package.json @@ -17,7 +17,8 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build": "tsc" + "build": "tsc", + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "devDependencies": { "typescript": "^5.2.2" diff --git a/tooling/noirc_abi_wasm/.eslintrc.js b/tooling/noirc_abi_wasm/.eslintrc.js index b1346a8792f..33335c2a877 100644 --- a/tooling/noirc_abi_wasm/.eslintrc.js +++ b/tooling/noirc_abi_wasm/.eslintrc.js @@ -1,19 +1,3 @@ module.exports = { - root: true, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint", "prettier"], - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - rules: { - "comma-spacing": ["error", { before: false, after: true }], - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", // or "error" - { - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - caughtErrorsIgnorePattern: "^_", - }, - ], - "prettier/prettier": "error", - }, + extends: ["../../.eslintrc.js"], }; From a738c5d4bc7b2e432b77da545d98e841092df761 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 15 Sep 2023 19:25:08 +0100 Subject: [PATCH 2/2] chore: fix linter errors --- compiler/integration-tests/test/index.d.ts | 1 + .../browser/compile_prove_verify.test.ts | 256 +++++++++--------- compiler/source-resolver/src/index.ts | 52 ++-- compiler/source-resolver/src/index_node.ts | 25 +- compiler/source-resolver/types/index.d.ts | 6 +- .../source-resolver/types/index_node.d.ts | 2 +- compiler/wasm/test/browser/index.test.ts | 9 +- compiler/wasm/test/index.d.ts | 2 +- compiler/wasm/test/node/index.test.ts | 2 +- compiler/wasm/test/shared.ts | 4 +- tooling/noir_js/src/index.ts | 2 +- .../test/node/abi_encode.test.ts | 2 +- .../noirc_abi_wasm/test/shared/abi_encode.ts | 2 +- 13 files changed, 190 insertions(+), 175 deletions(-) create mode 100644 compiler/integration-tests/test/index.d.ts diff --git a/compiler/integration-tests/test/index.d.ts b/compiler/integration-tests/test/index.d.ts new file mode 100644 index 00000000000..4db9e01cacd --- /dev/null +++ b/compiler/integration-tests/test/index.d.ts @@ -0,0 +1 @@ +declare module "@aztec/bb.js"; diff --git a/compiler/integration-tests/test/integration/browser/compile_prove_verify.test.ts b/compiler/integration-tests/test/integration/browser/compile_prove_verify.test.ts index e2a88e331d0..1388923506c 100644 --- a/compiler/integration-tests/test/integration/browser/compile_prove_verify.test.ts +++ b/compiler/integration-tests/test/integration/browser/compile_prove_verify.test.ts @@ -1,22 +1,20 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from "@esm-bundle/chai"; import { initializeResolver } from "@noir-lang/source-resolver"; import newCompiler, { - compile, - init_log_level as compilerLogLevel + compile, + init_log_level as compilerLogLevel, } from "@noir-lang/noir_wasm"; -import { decompressSync as gunzip } from 'fflate'; +import { decompressSync as gunzip } from "fflate"; import newABICoder, { abiEncode } from "@noir-lang/noirc_abi"; import initACVM, { - executeCircuit, - WitnessMap, - compressWitness, + executeCircuit, + WitnessMap, + compressWitness, } from "@noir-lang/acvm_js"; -// @ts-ignore -import { Barretenberg, RawBuffer, Crs } from '@aztec/bb.js'; - -import * as TOML from 'smol-toml' +import { Barretenberg, RawBuffer, Crs } from "@aztec/bb.js"; +import * as TOML from "smol-toml"; await newCompiler(); await newABICoder(); @@ -25,133 +23,141 @@ await initACVM(); compilerLogLevel("DEBUG"); async function getFile(url: URL): Promise { + const response = await fetch(url); - const response = await fetch(url) - - if (!response.ok) throw new Error('Network response was not OK'); + if (!response.ok) throw new Error("Network response was not OK"); - return await response.text(); + return await response.text(); } const CIRCUIT_SIZE = 2 ** 19; - const test_cases = [ - { - case: "tooling/nargo_cli/tests/execution_success/1_mul" - }, - { - case: "tooling/nargo_cli/tests/execution_success/double_verify_proof" - } + { + case: "tooling/nargo_cli/tests/execution_success/1_mul", + }, + { + case: "tooling/nargo_cli/tests/execution_success/double_verify_proof", + }, ]; const numberOfThreads = navigator.hardwareConcurrency || 1; -let suite = Mocha.Suite.create(mocha.suite, "Noir end to end test"); +const suite = Mocha.Suite.create(mocha.suite, "Noir end to end test"); -suite.timeout(60*20e3);//20mins +suite.timeout(60 * 20e3); //20mins test_cases.forEach((testInfo) => { - const test_name = testInfo.case.split("/").pop(); - const mochaTest = new Mocha.Test(`${test_name} (Compile, Execute, Prove, Verify)`, async () => { - - const base_relative_path = "../../../../.."; - const test_case = testInfo.case; - - const noir_source_url = new URL(`${base_relative_path}/${test_case}/src/main.nr`, import.meta.url); - const prover_toml_url = new URL(`${base_relative_path}/${test_case}/Prover.toml`, import.meta.url); - - const noir_source = await getFile(noir_source_url); - const prover_toml = await getFile(prover_toml_url); - - expect(noir_source).to.be.a.string; - - initializeResolver((id: String) => { - console.log("Resolving:", id); - return noir_source; - }); - - const inputs = TOML.parse(prover_toml); - - expect(inputs, "Prover.toml").to.be.an('object'); - - let compile_output; - - try { - - compile_output = await compile({}); - - expect(await compile_output, "Compile output ").to.be.an('object'); - - } catch (e) { - expect(e, "Compilation Step").to.not.be.an('error'); - throw e; - } - - - let witnessMap: WitnessMap; - try { - - witnessMap = abiEncode(compile_output.abi, inputs, null); - - } catch (e) { - expect(e, "Abi Encoding Step").to.not.be.an('error'); - throw e; - } - - let solvedWitness: WitnessMap; - let compressedByteCode; - try { - compressedByteCode = Uint8Array.from(atob(compile_output.circuit), c => c.charCodeAt(0)); - - solvedWitness = await executeCircuit( - compressedByteCode, - witnessMap, - () => { - throw Error("unexpected oracle"); - } - ); - - } catch (e) { - expect(e, "Abi Encoding Step").to.not.be.an('error'); - throw e; - } - - try { - const compressedWitness = compressWitness(solvedWitness); - const acirUint8Array = gunzip(compressedByteCode); - const witnessUint8Array = gunzip(compressedWitness); - - const isRecursive = true; - const api = await Barretenberg.new(numberOfThreads); - await api.commonInitSlabAllocator(CIRCUIT_SIZE); - - // Plus 1 needed! - const crs = await Crs.new(CIRCUIT_SIZE + 1); - await api.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data())); - - const acirComposer = await api.acirNewAcirComposer(CIRCUIT_SIZE); - - // This took ~6.5 minutes! - const proof = await api.acirCreateProof( - acirComposer, - acirUint8Array, - witnessUint8Array, - isRecursive - ); - - // And this took ~5 minutes! - const verified = await api.acirVerifyProof(acirComposer, proof, isRecursive); - - expect(verified).to.be.true; - - } catch (e) { - expect(e, "Proving and Verifying").to.not.be.an('error'); - throw e; - } - - }); - - suite.addTest(mochaTest); + const test_name = testInfo.case.split("/").pop(); + const mochaTest = new Mocha.Test( + `${test_name} (Compile, Execute, Prove, Verify)`, + async () => { + const base_relative_path = "../../../../.."; + const test_case = testInfo.case; + + const noir_source_url = new URL( + `${base_relative_path}/${test_case}/src/main.nr`, + import.meta.url + ); + const prover_toml_url = new URL( + `${base_relative_path}/${test_case}/Prover.toml`, + import.meta.url + ); + + const noir_source = await getFile(noir_source_url); + const prover_toml = await getFile(prover_toml_url); + + expect(noir_source).to.be.a.string; + + initializeResolver((id: string) => { + console.log("Resolving:", id); + return noir_source; + }); + + const inputs = TOML.parse(prover_toml); + + expect(inputs, "Prover.toml").to.be.an("object"); + + let compile_output; + + try { + compile_output = await compile({}); + + expect(await compile_output, "Compile output ").to.be.an("object"); + } catch (e) { + expect(e, "Compilation Step").to.not.be.an("error"); + throw e; + } + + let witnessMap: WitnessMap; + try { + witnessMap = abiEncode(compile_output.abi, inputs, null); + } catch (e) { + expect(e, "Abi Encoding Step").to.not.be.an("error"); + throw e; + } + + let solvedWitness: WitnessMap; + let compressedByteCode; + try { + compressedByteCode = Uint8Array.from( + atob(compile_output.circuit), + (c) => c.charCodeAt(0) + ); + + solvedWitness = await executeCircuit( + compressedByteCode, + witnessMap, + () => { + throw Error("unexpected oracle"); + } + ); + } catch (e) { + expect(e, "Abi Encoding Step").to.not.be.an("error"); + throw e; + } + + try { + const compressedWitness = compressWitness(solvedWitness); + const acirUint8Array = gunzip(compressedByteCode); + const witnessUint8Array = gunzip(compressedWitness); + + const isRecursive = true; + const api = await Barretenberg.new(numberOfThreads); + await api.commonInitSlabAllocator(CIRCUIT_SIZE); + + // Plus 1 needed! + const crs = await Crs.new(CIRCUIT_SIZE + 1); + await api.srsInitSrs( + new RawBuffer(crs.getG1Data()), + crs.numPoints, + new RawBuffer(crs.getG2Data()) + ); + + const acirComposer = await api.acirNewAcirComposer(CIRCUIT_SIZE); + + // This took ~6.5 minutes! + const proof = await api.acirCreateProof( + acirComposer, + acirUint8Array, + witnessUint8Array, + isRecursive + ); + + // And this took ~5 minutes! + const verified = await api.acirVerifyProof( + acirComposer, + proof, + isRecursive + ); + + expect(verified).to.be.true; + } catch (e) { + expect(e, "Proving and Verifying").to.not.be.an("error"); + throw e; + } + } + ); + suite.addTest(mochaTest); }); diff --git a/compiler/source-resolver/src/index.ts b/compiler/source-resolver/src/index.ts index 7d8e254f7db..e7e1db64b75 100644 --- a/compiler/source-resolver/src/index.ts +++ b/compiler/source-resolver/src/index.ts @@ -1,31 +1,37 @@ -let resolveFunction: Function | null = null; +let resolveFunction: ((source_id: string) => string) | null = null; -export let read_file = function (source_id: any): string { +export const read_file = function (source_id: string): string { + if (resolveFunction) { + const result = resolveFunction(source_id); - if (resolveFunction) { - - const result = resolveFunction(source_id); - - if (typeof result === "string") { - return result; - } else { - throw new Error("Noir source resolver function MUST return String synchronously. Are you trying to return anything else, eg. `Promise`?"); - } + if (typeof result === "string") { + return result; } else { - throw new Error('Not yet initialized. Use initializeResolver(() => string)'); + throw new Error( + "Noir source resolver function MUST return String synchronously. Are you trying to return anything else, eg. `Promise`?" + ); } - + } else { + throw new Error( + "Not yet initialized. Use initializeResolver(() => string)" + ); + } }; -function initialize(noir_resolver: (source_id: String) => string): (source_id: String) => string { - - if (typeof noir_resolver === "function") { - return noir_resolver; - } else { - throw new Error("Provided Noir Resolver is not a function, hint: use function(module_id) => NoirSource as second parameter"); - } +function initialize( + noir_resolver: (source_id: string) => string +): (source_id: string) => string { + if (typeof noir_resolver === "function") { + return noir_resolver; + } else { + throw new Error( + "Provided Noir Resolver is not a function, hint: use function(module_id) => NoirSource as second parameter" + ); + } } -export function initializeResolver(resolver: (source_id: String) => string): void { - resolveFunction = initialize(resolver); -} \ No newline at end of file +export function initializeResolver( + resolver: (source_id: string) => string +): void { + resolveFunction = initialize(resolver); +} diff --git a/compiler/source-resolver/src/index_node.ts b/compiler/source-resolver/src/index_node.ts index 396af74c058..016e118d044 100644 --- a/compiler/source-resolver/src/index_node.ts +++ b/compiler/source-resolver/src/index_node.ts @@ -1,20 +1,17 @@ /// -import { initializeResolver, read_file } from './index.js'; +import { initializeResolver, read_file } from "./index.js"; -initializeResolver((source_id: String) => { - let fileContent = ""; - try { - const fs = require("fs"); - fileContent = - fs.readFileSync(source_id, { encoding: "utf8" }) as string - ; - } catch (e) { - console.log(e); - } - return fileContent; +initializeResolver((source_id: string) => { + let fileContent = ""; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const fs = require("fs"); + fileContent = fs.readFileSync(source_id, { encoding: "utf8" }) as string; + } catch (e) { + console.log(e); + } + return fileContent; }); export { initializeResolver, read_file }; - - diff --git a/compiler/source-resolver/types/index.d.ts b/compiler/source-resolver/types/index.d.ts index 22d9a98fa1f..ef4e98c87e1 100644 --- a/compiler/source-resolver/types/index.d.ts +++ b/compiler/source-resolver/types/index.d.ts @@ -1,2 +1,4 @@ -export declare let read_file: (source_id: any) => string; -export declare function initializeResolver(resolver: (source_id: String) => string): void; +export declare const read_file: (source_id: string) => string; +export declare function initializeResolver( + resolver: (source_id: string) => string +): void; diff --git a/compiler/source-resolver/types/index_node.d.ts b/compiler/source-resolver/types/index_node.d.ts index 3a109e47e73..2a645e138bb 100644 --- a/compiler/source-resolver/types/index_node.d.ts +++ b/compiler/source-resolver/types/index_node.d.ts @@ -1,2 +1,2 @@ -import { initializeResolver, read_file } from './index.js'; +import { initializeResolver, read_file } from "./index.js"; export { initializeResolver, read_file }; diff --git a/compiler/wasm/test/browser/index.test.ts b/compiler/wasm/test/browser/index.test.ts index 9b1649bf0c3..6f79a7ab60c 100644 --- a/compiler/wasm/test/browser/index.test.ts +++ b/compiler/wasm/test/browser/index.test.ts @@ -1,6 +1,10 @@ import { expect } from "@esm-bundle/chai"; import initNoirWasm from "@noir-lang/noir_wasm"; -import { compileNoirSource, nargoArtifactPath, noirSourcePath } from "../shared"; +import { + compileNoirSource, + nargoArtifactPath, + noirSourcePath, +} from "../shared"; beforeEach(async () => { await initNoirWasm(); @@ -13,7 +17,7 @@ async function getFileContent(path: string): Promise { } async function getSource(): Promise { - return getFileContent(noirSourcePath) + return getFileContent(noirSourcePath); } async function getPrecompiledSource(): Promise { @@ -29,7 +33,6 @@ describe("noir wasm compilation", () => { const cliCircuitBase64 = await getPrecompiledSource(); - expect(wasmCircuitBase64).to.equal(cliCircuitBase64); }).timeout(20e3); // 20 seconds }); diff --git a/compiler/wasm/test/index.d.ts b/compiler/wasm/test/index.d.ts index b64901ebda2..35743f263cf 100644 --- a/compiler/wasm/test/index.d.ts +++ b/compiler/wasm/test/index.d.ts @@ -1 +1 @@ -declare module '@noir-lang/source-resolver'; \ No newline at end of file +declare module "@noir-lang/source-resolver"; diff --git a/compiler/wasm/test/node/index.test.ts b/compiler/wasm/test/node/index.test.ts index f823db35944..c180fd6db39 100644 --- a/compiler/wasm/test/node/index.test.ts +++ b/compiler/wasm/test/node/index.test.ts @@ -34,7 +34,7 @@ describe("noir wasm compilation", () => { console.log( "Compilation is a match? ", - wasmCircuitBase64 === cliCircuitBase64, + wasmCircuitBase64 === cliCircuitBase64 ); expect(wasmCircuitBase64).to.equal(cliCircuitBase64); diff --git a/compiler/wasm/test/shared.ts b/compiler/wasm/test/shared.ts index 24a09cc1a04..6e5ad5969f3 100644 --- a/compiler/wasm/test/shared.ts +++ b/compiler/wasm/test/shared.ts @@ -5,10 +5,10 @@ export const noirSourcePath = "../../noir-script/src/main.nr"; export const nargoArtifactPath = "../../noir-script/target/noir_wasm_testing.json"; -export async function compileNoirSource(noir_source: string): Promise { +export async function compileNoirSource(noir_source: string): Promise { console.log("Compiling Noir source..."); - initializeResolver((id: String) => { + initializeResolver((id: string) => { console.log(`Resolving source ${id}`); const source = noir_source; diff --git a/tooling/noir_js/src/index.ts b/tooling/noir_js/src/index.ts index 2b3bf593d0c..3455663f046 100644 --- a/tooling/noir_js/src/index.ts +++ b/tooling/noir_js/src/index.ts @@ -1,3 +1,3 @@ import * as acvm from "@noir-lang/acvm_js"; import * as noirc from "@noir-lang/noirc_abi"; -export { acvm, noirc } \ No newline at end of file +export { acvm, noirc }; diff --git a/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts b/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts index 1328967676d..8a3b6fe9ffc 100644 --- a/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts +++ b/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts @@ -16,4 +16,4 @@ it("recovers original inputs when abi encoding and decoding", async () => { BigInt(inputs.bar[1]) ); expect(decoded_inputs.return_value).to.be.null; -}); \ No newline at end of file +}); diff --git a/tooling/noirc_abi_wasm/test/shared/abi_encode.ts b/tooling/noirc_abi_wasm/test/shared/abi_encode.ts index 7c3721b9efe..9664f4e5a45 100644 --- a/tooling/noirc_abi_wasm/test/shared/abi_encode.ts +++ b/tooling/noirc_abi_wasm/test/shared/abi_encode.ts @@ -17,4 +17,4 @@ export const abi = { export const inputs = { foo: "1", bar: ["1", "2"], -}; \ No newline at end of file +};