From 318c405888e99a658f5254d8063d5b8097098dbe Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Wed, 15 Jun 2022 13:16:48 -0700 Subject: [PATCH] fix: Add exportSolidityCallData to groth16 & plonk snarkjs bindings (#63) --- src/snarkjs.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/snarkjs.ts b/src/snarkjs.ts index d309153..ac13c31 100644 --- a/src/snarkjs.ts +++ b/src/snarkjs.ts @@ -31,6 +31,12 @@ const wrappedSnark = { ): Promise { return snarkjs.groth16.verify(vk_verifier, publicSignals, proof, logger); }, + exportSolidityCallData: async function groth16ExportSolidityCallData( + proof: unknown, + publicInputs: unknown + ): Promise { + return snarkjs.groth16.exportSolidityCallData(proof, publicInputs); + }, }, plonk: { fullProve: async function plonkFullProve( @@ -64,6 +70,12 @@ const wrappedSnark = { ): Promise { return snarkjs.plonk.verify(vk_verifier, publicSignals, proof, logger); }, + exportSolidityCallData: async function plonkExportSolidityCallData( + proof: unknown, + publicInputs: unknown + ): Promise { + return snarkjs.plonk.exportSolidityCallData(proof, publicInputs); + }, }, powersOfTau: { newAccumulator: async function newAccumulator(