Skip to content

Commit

Permalink
clean up log function
Browse files Browse the repository at this point in the history
  • Loading branch information
glamperd committed Sep 10, 2024
1 parent 894e9af commit 1e87ae2
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/backend/src/functions/circuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,19 @@ export const verifycontribution = functionsV2.https.onCall(

const verificationTaskTimer = new Timer({ label: `${ceremonyId}-${circuitId}-${participantDoc.id}` })

const dumpLog = async (path: string) => {
const fs = require('fs');
printLog(`transcript >>>>>>`, LogLevel.DEBUG)
fs.readFile(path, 'utf8', (err: any, data: any) => {
if (err) {
printLog(err, LogLevel.ERROR);
return;
}
printLog(data, LogLevel.DEBUG);
});

}

const completeVerification = async () => {
// Stop verification task timer.
printLog("Completing verification", LogLevel.DEBUG)
Expand Down Expand Up @@ -863,16 +876,7 @@ export const verifycontribution = functionsV2.https.onCall(
transcriptLogger
)

printLog(`transcript >>>>>>`, LogLevel.DEBUG)
const fs = require('fs');

fs.readFile(verificationTranscriptTemporaryLocalPath, 'utf8', (err: any, data: any) => {
if (err) {
console.error(err);
return;
}
printLog(data, LogLevel.DEBUG);
});
dumpLog(verificationTranscriptTemporaryLocalPath)

// Compute contribution hash.
lastZkeyBlake2bHash = await blake512FromPath(lastZkeyTempFilePath)
Expand Down

0 comments on commit 1e87ae2

Please sign in to comment.