-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ceremony verification): implemented ceremony finalization verifi…
…cation and test fix Implemented a function that given a ceremony prefix will verify whether the finalization was successful: all artifacts are uploaded and are valid. These are compared with local copies that are generated on the fly. Also fixed failing prod tests. Ceremony verification is now a Hardhat task as it requires smart contract interaction.
- Loading branch information
Showing
22 changed files
with
536 additions
and
540 deletions.
There are no files selected for viewing
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
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,36 @@ | ||
import { task } from "hardhat/config" | ||
import { verifyCeremony } from "./contracts" | ||
import { initializeUserServices } from "../../test/utils" | ||
|
||
task("verifyCeremony", "A task that can be used to verify a ceremony finalization validity") | ||
.addPositionalParam("ceremonyPrefix") | ||
.addPositionalParam("outputDirectory") | ||
.addPositionalParam("solidityVersion") | ||
.addPositionalParam("wasmPath") | ||
.addPositionalParam("circuitInputs") | ||
.addPositionalParam("verifierTemplatePath") | ||
.addPositionalParam("coordinatorUID") | ||
.setAction(async (taskArgs, hre) => { | ||
// get a signer | ||
const [deployer] = await hre.ethers.getSigners() | ||
|
||
// init user app | ||
const { userFirestore, userFunctions } = initializeUserServices() | ||
|
||
// verify ceremony | ||
await verifyCeremony( | ||
userFunctions, | ||
userFirestore, | ||
taskArgs.ceremonyPrefix, | ||
taskArgs.outputDirectory, | ||
taskArgs.solidityVersion, | ||
taskArgs.wasmPath, | ||
taskArgs.circuitInputs, | ||
taskArgs.verifierTemplatePath, | ||
deployer, | ||
taskArgs.coordinatorUID | ||
) | ||
|
||
// if we are here it is because it didn't throw so we can safely assume that it all was veriifer | ||
console.log(`[+] The artifacts generated by the ceremony ${taskArgs.ceremonyPrefix} are valid`) | ||
}) |
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
Binary file not shown.
Oops, something went wrong.