Skip to content

Commit f845ea1

Browse files
committed
add back logs
1 parent 824fe4d commit f845ea1

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/examples/zkfunction/root.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Experimental, Field, Gadgets } from 'o1js';
1+
import { assert, Experimental, Field, Gadgets } from 'o1js';
22
const { ZkFunction } = Experimental;
33

44
/**
@@ -18,26 +18,33 @@ const main = ZkFunction({
1818
},
1919
});
2020

21-
/* console.time('compile...'); */
21+
console.time('compile...');
2222
const { verificationKey } = await main.compile();
23+
console.timeEnd('compile...');
24+
2325
const x = Field(8);
2426
const y = Field(2);
27+
28+
console.time('prove...');
2529
const proof = await main.prove(x, y);
30+
console.timeEnd('prove...');
2631

32+
console.time('verify...');
2733
let ok = await main.verify(proof, verificationKey);
34+
console.timeEnd('verify...');
2835

29-
console.log('ok?', ok);
36+
assert(ok, 'proof should verify');
3037

3138
console.log('testing round trips');
3239

3340
ok = await proofRoundTrip(proof).verify(verificationKey);
34-
console.log('proof round trip ok?', ok);
41+
assert(ok, 'proof should verify');
3542

3643
console.log('verification key round trip...');
3744

3845
ok = await proof.verify(verificationKeyRoundTrip(verificationKey));
3946

40-
console.log('verification key round trip ok?', ok);
47+
assert(ok, 'proof should verify');
4148

4249
function proofRoundTrip(proof: Experimental.KimchiProof): Experimental.KimchiProof {
4350
let json = proof.toJSON();

0 commit comments

Comments
 (0)