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