@@ -26,7 +26,12 @@ async function localProgramExecution(program, programName, aleoFunction, inputs)
26
26
programManager . setKeyProvider ( keyProvider ) ;
27
27
28
28
// Pre-synthesize the program keys and then cache them in memory using key provider
29
- const keyPair = await programManager . synthesizeKeys ( hello_hello_program , aleoFunction , inputs ) ;
29
+ const keyPair = await programManager . synthesizeKeys ( {
30
+ program : hello_hello_program ,
31
+ functionName : aleoFunction ,
32
+ inputs,
33
+ } ) ;
34
+
30
35
programManager . keyProvider . cacheKeys ( `${ programName } :${ aleoFunction } ` , keyPair ) ;
31
36
32
37
// Specify parameters for the key provider to use search for program keys. In particular specify the cache key
@@ -35,18 +40,17 @@ async function localProgramExecution(program, programName, aleoFunction, inputs)
35
40
36
41
// Execute once using the key provider params defined above. This will use the cached proving keys and make
37
42
// execution significantly faster.
38
- let executionResponse = await programManager . run (
39
- program ,
40
- aleoFunction ,
43
+ let executionResponse = await programManager . run ( {
44
+ program : program ,
45
+ functionName : aleoFunction ,
41
46
inputs,
42
- true ,
43
- undefined ,
47
+ proveExecution : true ,
44
48
keyProviderParams,
45
- ) ;
49
+ } ) ;
46
50
console . log ( "hello_hello/hello executed - result:" , executionResponse . getOutputs ( ) ) ;
47
51
48
52
// Verify the execution using the verifying key that was generated earlier.
49
- if ( programManager . verifyExecution ( executionResponse ) ) {
53
+ if ( programManager . verifyExecution ( { executionResponse } ) ) {
50
54
console . log ( "hello_hello/hello execution verified!" ) ;
51
55
} else {
52
56
throw ( "Execution failed verification!" ) ;
0 commit comments