Skip to content

Commit

Permalink
Merge pull request #108 from gnosisguild/sp/task-fix
Browse files Browse the repository at this point in the history
fix tasks for decryption verifier change
  • Loading branch information
samepant authored Sep 23, 2024
2 parents 513ec36 + e15f139 commit 4ca16ba
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/evm/tasks/enclave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ task(

let computeParams = taskArguments.computeParams;
if (!computeParams) {
// no compute params provided, use mock
const MockDecryptionVerifier = await hre.deployments.get(
"MockDecryptionVerifier",
);
Expand All @@ -109,6 +110,21 @@ task(
MockDecryptionVerifier.address,
32,
);

// since we are using mock, we need to set the decryption verifier to the mock encryption scheme id
try {
const setDecryptionVerifier =
await enclaveContract.setDecryptionVerifier(
"0x0000000000000000000000000000000000000000000000000000000000000001",
MockDecryptionVerifier.address,
);
await setDecryptionVerifier.wait();
} catch (e) {
console.log(
"Setting decryption verifier for encryption scheme id failed: ",
e,
);
}
}

try {
Expand Down Expand Up @@ -227,6 +243,7 @@ task("e3:publishInput", "Publish input for an E3 program")
task("e3:publishCiphertext", "Publish ciphertext output for an E3 program")
.addParam("e3Id", "Id of the E3 program")
.addParam("data", "data to publish")
.addParam("proof", "proof to publish")
.setAction(async function (taskArguments: TaskArguments, hre) {
const enclave = await hre.deployments.get("Enclave");

Expand All @@ -238,6 +255,7 @@ task("e3:publishCiphertext", "Publish ciphertext output for an E3 program")
const tx = await enclaveContract.publishCiphertextOutput(
taskArguments.e3Id,
taskArguments.data,
taskArguments.proof,
);

console.log("Publishing ciphertext... ", tx.hash);
Expand All @@ -249,6 +267,7 @@ task("e3:publishCiphertext", "Publish ciphertext output for an E3 program")
task("e3:publishPlaintext", "Publish plaintext output for an E3 program")
.addParam("e3Id", "Id of the E3 program")
.addParam("data", "data to publish")
.addParam("proof", "proof to publish")
.setAction(async function (taskArguments: TaskArguments, hre) {
const enclave = await hre.deployments.get("Enclave");

Expand All @@ -260,6 +279,7 @@ task("e3:publishPlaintext", "Publish plaintext output for an E3 program")
const tx = await enclaveContract.publishPlaintextOutput(
taskArguments.e3Id,
taskArguments.data,
taskArguments.proof,
);

console.log("Publishing ciphertext... ", tx.hash);
Expand Down

0 comments on commit 4ca16ba

Please sign in to comment.