Skip to content

Commit

Permalink
test witness arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Nov 28, 2024
1 parent 3289b6b commit 00a1c69
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/tests/inductive-proofs-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
},
},

Expand All @@ -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) };
},
},
Expand All @@ -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) };
},
Expand Down

0 comments on commit 00a1c69

Please sign in to comment.