Skip to content

Commit

Permalink
fix: use 'lite-server' instead of 'serve' for serving files outside o…
Browse files Browse the repository at this point in the history
…f root
  • Loading branch information
sifnoc committed Dec 4, 2024
1 parent fa543ff commit d9419d8
Show file tree
Hide file tree
Showing 6 changed files with 847 additions and 417 deletions.
15 changes: 15 additions & 0 deletions test-e2e/web/bs-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const server = {
baseDir: "./",
routes: {
"/test-vectors": "../../test-vectors"
},
middleware: [
// To allow COR for only testing and development
function (req, res, next) {
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
next();
}
]
};

2 changes: 1 addition & 1 deletion test-e2e/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const chrome = require('selenium-webdriver/chrome');

// Log ChromeDriver version via WebDriver
const driverVersion = await driver.executeScript('return navigator.userAgent');
console.log(`WebDriver user agent: ${driverVersion}`);
console.log(`WebDriver user agent:\n${driverVersion}`);

await driver.get('http://localhost:3000');

Expand Down
4 changes: 2 additions & 2 deletions test-e2e/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"author": "Jinhwan",
"license": "MIT",
"scripts": {
"start": "yarn serve",
"start": "yarn lite-server",
"test": "node index.js"
},
"dependencies": {
"selenium-webdriver": "^4.27.0"
},
"devDependencies": {
"serve": "^14.2.4"
"lite-server": "^2.6.1"
}
}
11 changes: 0 additions & 11 deletions test-e2e/web/serve.json

This file was deleted.

18 changes: 9 additions & 9 deletions test-e2e/web/test_halo2.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ async function measureTime(callback) {

async function run_plonk_test(input) {
try {
const SRS_KEY = await fetchBinaryFile('./mopro-pkg/parameters/plonk_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/plonk_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/plonk_fibonacci_vk.bin');
const SRS_KEY = await fetchBinaryFile('./test-vectors/halo2/plonk_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./test-vectors/halo2/plonk_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./test-vectors/halo2/plonk_fibonacci_vk.bin');

const { result: proofResult, timeTaken: proofTime } = await measureTime(() =>
mopro_wasm.generate_plonk_proof(SRS_KEY, PROVING_KEY, input)
Expand All @@ -53,9 +53,9 @@ async function run_plonk_test(input) {

async function run_hyperplonk_test(input) {
try {
const SRS_KEY = await fetchBinaryFile('./mopro-pkg/parameters/hyperplonk_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/hyperplonk_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/hyperplonk_fibonacci_vk.bin');
const SRS_KEY = await fetchBinaryFile('./test-vectors/halo2/hyperplonk_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./test-vectors/halo2/hyperplonk_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./test-vectors/halo2/hyperplonk_fibonacci_vk.bin');

const { result: proofResult, timeTaken: proofTime } = await measureTime(() =>
mopro_wasm.generate_hyperplonk_proof(SRS_KEY, PROVING_KEY, input)
Expand All @@ -79,9 +79,9 @@ async function run_hyperplonk_test(input) {

async function run_gemini_test(input) {
try {
const SRS_KEY = await fetchBinaryFile('./mopro-pkg/parameters/gemini_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/gemini_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./mopro-pkg/parameters/gemini_fibonacci_vk.bin');
const SRS_KEY = await fetchBinaryFile('./test-vectors/halo2/gemini_fibonacci_srs.bin');
const PROVING_KEY = await fetchBinaryFile('./test-vectors/halo2/gemini_fibonacci_pk.bin');
const VERIFYING_KEY = await fetchBinaryFile('./test-vectors/halo2/gemini_fibonacci_vk.bin');

const { result: proofResult, timeTaken: proofTime } = await measureTime(() =>
mopro_wasm.generate_gemini_proof(SRS_KEY, PROVING_KEY, input)
Expand Down
Loading

0 comments on commit d9419d8

Please sign in to comment.