From 71f6ee6c39692f2e1b6f139e6873d3b14538b859 Mon Sep 17 00:00:00 2001 From: shuoer86 <129674997+shuoer86@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:58:37 +0800 Subject: [PATCH 1/2] chore: fix typos --- packages/actions/.env.default | 4 ++-- packages/actions/src/types/index.ts | 2 +- packages/actions/test/unit/contribute.test.ts | 2 +- packages/actions/test/unit/finalize.test.ts | 2 +- packages/actions/test/unit/security.test.ts | 2 +- packages/actions/test/unit/storage.test.ts | 2 +- packages/backend/src/functions/ceremony.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/actions/.env.default b/packages/actions/.env.default index bdcf0a3c..e8163121 100644 --- a/packages/actions/.env.default +++ b/packages/actions/.env.default @@ -1,4 +1,4 @@ -# This environemnt must be configured both for core functionalities and testing. +# This environment must be configured both for core functionalities and testing. # The tests can be executed against a pre-deployed Firebase instance or # locally on your machine using the Firebase emulator. @@ -37,7 +37,7 @@ CONFIG_CEREMONY_BUCKET_POSTFIX="-ph2-ceremony" # The amount of time in seconds which indicates the duration about the validity of a pre-signed URL. # default: 7200 seconds = 2 hours. CONFIG_PRESIGNED_URL_EXPIRATION_IN_SECONDS=7200 -# AWS S3 access keys only required for unit/e2e testing (can be ommited) +# AWS S3 access keys only required for unit/e2e testing (can be omitted) # The AWS access key identifier related to S3 APIs. AWS_ACCESS_KEY_ID="YOUR-AWS-ACCESS-KEY-ID" # The AWS secret access key related to S3 APIs. diff --git a/packages/actions/src/types/index.ts b/packages/actions/src/types/index.ts index 8f8be6f3..906aab22 100644 --- a/packages/actions/src/types/index.ts +++ b/packages/actions/src/types/index.ts @@ -190,7 +190,7 @@ export type VMConfiguration = { /** * Group information about the circuit contribution verification mechanism. * @typedef {Object} CircuitContributionVerification - * @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism choosen by the coordinator. + * @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism chosen by the coordinator. * @property {VMConfiguration} [vm] - the VM configuration specs. */ export type CircuitContributionVerification = { diff --git a/packages/actions/test/unit/contribute.test.ts b/packages/actions/test/unit/contribute.test.ts index b11effdd..a3d2168b 100644 --- a/packages/actions/test/unit/contribute.test.ts +++ b/packages/actions/test/unit/contribute.test.ts @@ -436,7 +436,7 @@ describe("Contribute", () => { resumeContributionAfterTimeoutExpiration(userFunctions, fakeCeremoniesData.fakeCeremonyOpenedFixed.uid) ).to.be.rejectedWith("Unable to progress to next circuit for contribution") }) - it("should succesfully resume the contribution", async () => { + it("should successfully resume the contribution", async () => { await signInWithEmailAndPassword(userAuth, users[0].data.email, passwords[0]) await expect( resumeContributionAfterTimeoutExpiration(userFunctions, fakeCeremoniesData.fakeCeremonyOpenedFixed.uid) diff --git a/packages/actions/test/unit/finalize.test.ts b/packages/actions/test/unit/finalize.test.ts index 9464376c..4813b6bb 100644 --- a/packages/actions/test/unit/finalize.test.ts +++ b/packages/actions/test/unit/finalize.test.ts @@ -298,7 +298,7 @@ describe("Finalize", () => { ) ).to.be.rejectedWith("Unable to download the AWS S3 object from the provided ceremony bucket.") }) - it("should succesfully finalize the last contribution", async () => { + it("should successfully finalize the last contribution", async () => { // prepare coordinator for finalization await checkAndPrepareCoordinatorForFinalization( userFunctions, diff --git a/packages/actions/test/unit/security.test.ts b/packages/actions/test/unit/security.test.ts index 7a46186d..f8964a86 100644 --- a/packages/actions/test/unit/security.test.ts +++ b/packages/actions/test/unit/security.test.ts @@ -830,7 +830,7 @@ describe("Security", () => { }) /// @note these test should be running last if (envType === TestingEnvironment.PRODUCTION) { - /// @note it is not recommended to allow anynomous access to firebase + /// @note it is not recommended to allow anonymous access to firebase it("should not allow to authenticate anynomously to Firebase", async () => { const auth = getAuth() await expect(signInAnonymously(auth)).to.be.rejectedWith( diff --git a/packages/actions/test/unit/storage.test.ts b/packages/actions/test/unit/storage.test.ts index f996754c..1d1e73cf 100644 --- a/packages/actions/test/unit/storage.test.ts +++ b/packages/actions/test/unit/storage.test.ts @@ -133,7 +133,7 @@ describe("Storage", () => { const exists = await checkIfObjectExist(userFunctions, bucketName, objectName) expect(exists).to.be.equal(true) }) - it("should return false when given a non existant bucket name", async () => { + it("should return false when given a non existent bucket name", async () => { // check existence const exists = await checkIfObjectExist(userFunctions, "nonExistingBucket", objectName) expect(exists).to.be.equal(false) diff --git a/packages/backend/src/functions/ceremony.ts b/packages/backend/src/functions/ceremony.ts index 0e255e24..908bd518 100644 --- a/packages/backend/src/functions/ceremony.ts +++ b/packages/backend/src/functions/ceremony.ts @@ -298,7 +298,7 @@ export const finalizeCeremony = functions const circuits = await getCeremonyCircuits(ceremonyId) // Get final contribution for each circuit. - // nb. the `getFinalContributionDocument` checks the existance of the final contribution document (if not present, throws). + // nb. the `getFinalContributionDocument` checks the existence of the final contribution document (if not present, throws). // Therefore, we just need to call the method without taking any data to verify the pre-condition of having already computed // the final contributions for each ceremony circuit. for await (const circuit of circuits) await getFinalContribution(ceremonyId, circuit.id) From fe91808407866f439a9dbdb89723b9da7f4d715e Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:08:53 +0000 Subject: [PATCH 2/2] fix(setup): fix issue with wasm file always being deleted --- packages/actions/src/helpers/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/actions/src/helpers/utils.ts b/packages/actions/src/helpers/utils.ts index 03e7b2e3..fcde7ac6 100644 --- a/packages/actions/src/helpers/utils.ts +++ b/packages/actions/src/helpers/utils.ts @@ -712,8 +712,10 @@ export const parseCeremonyFile = async (path: string, cleanup: boolean = false): circuits.push(circuit) // remove the local r1cs and wasm downloads (if used for verifying the config only vs setup) - if (cleanup) fs.unlinkSync(localR1csPath) - fs.unlinkSync(localWasmPath) + if (cleanup) { + fs.unlinkSync(localR1csPath) + fs.unlinkSync(localWasmPath) + } } const setupData: SetupCeremonyData = {