From 4fb72f09487eda9c06af8a73408ed1aca6503c1e Mon Sep 17 00:00:00 2001 From: querolita Date: Tue, 29 Oct 2024 15:57:48 +0100 Subject: [PATCH] comment parts of the unit test --- .../provable/test/dynamic-array-unit-test.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib/provable/test/dynamic-array-unit-test.ts b/src/lib/provable/test/dynamic-array-unit-test.ts index 05843a8e2..f7e6d3d46 100644 --- a/src/lib/provable/test/dynamic-array-unit-test.ts +++ b/src/lib/provable/test/dynamic-array-unit-test.ts @@ -13,8 +13,8 @@ let List = ZkProgram({ name: 'dynamicarrays', methods: { pushAndPop: { - privateInputs: [Field, Field, Field], - async method(v0: Field, v1: Field, v2: Field) { + privateInputs: [], + async method() { // Define classes of dynamic arrays for specific provable types let Bytestring = DynamicArray(UInt8, { capacity: 8 }); @@ -82,19 +82,21 @@ let List = ZkProgram({ // getOption returns None for out-of-bounds and Some for in-bounds index bytes.getOption(new Field(0)).assertSome(); - assert(bytes.getOption(new Field(1)).toValue === undefined); + //assert(bytes.getOption(new Field(1)) === undefined); // TODO: Error if accessing out-of-bounds index // TODO: Mapping over elements should work correctly - bytes.push(new Field(1)); + + /* bytes.push(new Field(1)); bytes.push(new Field(0)); let mapped = bytes.map(UInt8, (value) => - Gadgets.add(value, new Field(1)) + Gadgets.add(value, new UInt8(1)) ); assert(mapped.get(new Field(0)).equals(new Field(3))); assert(mapped.get(new Field(1)).equals(new Field(2))); assert(mapped.get(new Field(2)).equals(new Field(1))); + */ // Growing capacity should work correctly let longerArray = bytes.growCapacityTo(10); @@ -120,12 +122,11 @@ let uint = (n: number | bigint): Spec => { await List.compile(); await equivalentAsync({ from: [uint(12)], to: boolean }, { runs: 1 })( - (x) => { - assert(x < 1n << 12n); + (_x) => { return true; }, - async (x) => { - let proof = await List.pushAndPop(x); + async (_x) => { + let proof = await List.pushAndPop(); return await List.verify(proof); } );