forked from noir-lang/noir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: restructure integration tests (noir-lang#2954)
- Loading branch information
1 parent
8f95f78
commit 8466a3a
Showing
15 changed files
with
82 additions
and
98 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
{ | ||
"name": "integration-tests", | ||
"version": "1.0.0", | ||
"license": "(MIT OR Apache-2.0)", | ||
"main": "index.js", | ||
"private": true, | ||
"scripts": { | ||
"build": "echo Integration Test build step", | ||
"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", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" | ||
}, | ||
"dependencies": { | ||
"@noir-lang/backend_barretenberg": "workspace:*", | ||
"@noir-lang/noir_js": "workspace:*", | ||
"@noir-lang/noir_wasm": "workspace:*", | ||
"@noir-lang/source-resolver": "workspace:*", | ||
"@web/dev-server-esbuild": "^0.3.6", | ||
"@web/test-runner": "^0.15.3", | ||
"@web/test-runner-webdriver": "^0.7.0", | ||
"eslint": "^8.50.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"ethers": "^6.7.1", | ||
"fflate": "^0.8.0", | ||
"prettier": "3.0.3", | ||
"smol-toml": "^1.1.2", | ||
"tslog": "^4.9.2" | ||
} | ||
"name": "integration-tests", | ||
"version": "1.0.0", | ||
"license": "(MIT OR Apache-2.0)", | ||
"main": "index.js", | ||
"private": true, | ||
"scripts": { | ||
"build": "echo Integration Test build step", | ||
"test": "yarn test:browser", | ||
"test:browser": "web-test-runner", | ||
"test:integration:browser": "web-test-runner test/browser/**/*.test.ts", | ||
"test:integration:browser:watch": "web-test-runner test/browser/**/*.test.ts --watch", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" | ||
}, | ||
"dependencies": { | ||
"@noir-lang/backend_barretenberg": "workspace:*", | ||
"@noir-lang/noir_js": "workspace:*", | ||
"@noir-lang/noir_wasm": "workspace:*", | ||
"@noir-lang/source-resolver": "workspace:*", | ||
"@web/dev-server-esbuild": "^0.3.6", | ||
"@web/test-runner": "^0.15.3", | ||
"@web/test-runner-webdriver": "^0.7.0", | ||
"eslint": "^8.50.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"ethers": "^6.7.1", | ||
"fflate": "^0.8.0", | ||
"prettier": "3.0.3", | ||
"smol-toml": "^1.1.2", | ||
"tslog": "^4.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export async function getFile(file_path: string): Promise<string> { | ||
const file_url = new URL(file_path, import.meta.url); | ||
const response = await fetch(file_url); | ||
|
||
if (!response.ok) throw new Error('Network response was not OK'); | ||
|
||
return await response.text(); | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const FIELD_ELEMENT_BYTES = 32; | ||
|
||
export function separatePublicInputsFromProof( | ||
proof: Uint8Array, | ||
numPublicInputs: number, | ||
): { proof: Uint8Array; publicInputs: Uint8Array[] } { | ||
const publicInputs = Array.from({ length: numPublicInputs }, (_, i) => { | ||
const offset = i * FIELD_ELEMENT_BYTES; | ||
return proof.slice(offset, offset + FIELD_ELEMENT_BYTES); | ||
}); | ||
const slicedProof = proof.slice(numPublicInputs * FIELD_ELEMENT_BYTES); | ||
|
||
return { | ||
proof: slicedProof, | ||
publicInputs, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters