Skip to content

Commit

Permalink
fix: ensure prove task works (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 authored Aug 26, 2024
1 parent 153d1a1 commit 87762e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/hardhat-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
- name: hardhat tasks
run: |
cp ./deploy-config-example.json ./deploy-config.json
pnpm deploy:localhost
pnpm deploy-poll:localhost
bash ./testScriptLocalhost.sh
working-directory: packages/contracts

- name: Stop Hardhat
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/deploy-config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@
}
},
"Poll": {
"pollDuration": 3600,
"coordinatorPubkey": "macipk.9a59264310d95cfd8eb7083aebeba221b5c26e77427f12b7c0f50bc1cc35e621",
"pollDuration": 30,
"coordinatorPubkey": "macipk.29add77d27341c4cdfc2fb623175ecfd6527a286e3e7ded785d9fd7afbbdf399",
"useQuadraticVoting": false
}
},
Expand Down
7 changes: 3 additions & 4 deletions packages/contracts/tasks/helpers/Prover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,11 @@ export class Prover {
onChainProcessVk.ic.map(([x, y]) => new G1Point(x, y)),
);

// verify the proof onchain using the verifier contract

// verify the proof on chain using the verifier contract
const isValidOnChain = await this.verifierContract.verify(
formattedProof,
vk.asContractParam() as IVerifyingKeyStruct,
publicInputsOnChain,
[...publicInputsOnChain],
);

if (!isValidOnChain) {
Expand Down Expand Up @@ -286,7 +285,7 @@ export class Prover {
const isValidOnChain = await this.verifierContract.verify(
formattedProof,
vk.asContractParam() as IVerifyingKeyStruct,
publicInputsOnChain,
[...publicInputsOnChain],
);

if (!isValidOnChain) {
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/tasks/runner/prove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ task("prove", "Command to generate proof and prove the result of a poll on-chain
}

const mpContract = await deployment.getContract<MessageProcessor>({
name: EContracts.Poll,
name: EContracts.MessageProcessor,
address: pollContracts.messageProcessor,
});

Expand Down

0 comments on commit 87762e0

Please sign in to comment.