From 00a1c69aa0b143ccb8f23a22b4d1ef1a837d755f Mon Sep 17 00:00:00 2001 From: Gregor Date: Thu, 28 Nov 2024 14:09:29 +0100 Subject: [PATCH] test witness arguments --- src/tests/inductive-proofs-internal.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/tests/inductive-proofs-internal.ts b/src/tests/inductive-proofs-internal.ts index 7867acedc..7d528fe80 100644 --- a/src/tests/inductive-proofs-internal.ts +++ b/src/tests/inductive-proofs-internal.ts @@ -16,11 +16,12 @@ let MaxProofsVerifiedTwo = ZkProgram({ methods: { baseCase: { - privateInputs: [], + privateInputs: [Field], - async method() { + async method(x: Field) { pushLog('baseCase'); - return { publicOutput: Field(7) }; + x = x.add(7); + return { publicOutput: x }; }, }, @@ -29,7 +30,8 @@ let MaxProofsVerifiedTwo = ZkProgram({ async method() { pushLog('mergeOne'); - let x: Field = await MaxProofsVerifiedTwo.proveRecursively.baseCase(); + let z = Provable.witness(Field, () => 0); + let x: Field = await MaxProofsVerifiedTwo.proveRecursively.baseCase(z); return { publicOutput: x.add(1) }; }, }, @@ -39,7 +41,8 @@ let MaxProofsVerifiedTwo = ZkProgram({ async method() { pushLog('mergeTwo'); - let x: Field = await MaxProofsVerifiedTwo.proveRecursively.baseCase(); + let z = Provable.witness(Field, () => 0); + let x: Field = await MaxProofsVerifiedTwo.proveRecursively.baseCase(z); let y: Field = await MaxProofsVerifiedTwo.proveRecursively.mergeOne(); return { publicOutput: x.add(y) }; },