@@ -29,7 +29,11 @@ async function localProgramExecution(program, programName, functionName, inputs)
29
29
30
30
// Pre-synthesize the program keys and then cache them in memory using key provider.
31
31
console . log ( "Synthesizing hello_hello/hello keys" ) ;
32
- const keyPair = await programManager . synthesizeKeys ( hello_hello_program , functionName , inputs ) ;
32
+ const keyPair = await programManager . synthesizeKeys ( {
33
+ program : hello_hello_program ,
34
+ functionName,
35
+ inputs,
36
+ } ) ;
33
37
programManager . keyProvider . cacheKeys ( `${ programName } :${ functionName } ` , keyPair ) ;
34
38
35
39
// Specify parameters for the key provider to use search for program keys. In particular specify the cache key
@@ -39,18 +43,17 @@ async function localProgramExecution(program, programName, functionName, inputs)
39
43
// Execute once using the key provider params defined above. This will use the cached proving keys and make
40
44
// execution significantly faster.
41
45
console . log ( "Executing hello_hello/hello" ) ;
42
- let executionResponse = await programManager . run (
46
+ let executionResponse = await programManager . run ( {
43
47
program,
44
48
functionName,
45
49
inputs,
46
- true ,
47
- undefined ,
50
+ proveExecution : true ,
48
51
keyProviderParams,
49
- ) ;
52
+ } ) ;
50
53
console . log ( "hello_hello/hello executed - result:" , executionResponse . getOutputs ( ) ) ;
51
54
52
55
// Verify the execution using the verifying key that was generated earlier.
53
- if ( programManager . verifyExecution ( executionResponse , 9_000_000 ) ) {
56
+ if ( programManager . verifyExecution ( { executionResponse, blockHeight : 9_000_000 } ) ) {
54
57
console . log ( "hello_hello/hello execution verified!" ) ;
55
58
} else {
56
59
throw ( "Execution failed verification!" ) ;
@@ -86,4 +89,4 @@ async function remoteProgramExecution(programName, functionName, inputs) {
86
89
// console.log("Starting remote execute");
87
90
// const auctionTicket = "{\n owner: aleo12a4wll9ax6w5355jph0dr5wt2vla5sss2t4cnch0tc3vzh643v8qcfvc7a.private,\n auction: {\n starting_bid: 1000u64.private,\n name: 35399035103896773146887283777field.private,\n item: {\n id: 2711777270856651361584090827715149911900945757872672230578290769243507539617field.private,\n offchain_data: [\n 988474637487226873250021955104421895943605632761729320744454284792013483886field.private,\n 1018595503607749325560812785092303652308909717269501712857428145700763090203field.private,\n 1866354748676879328546224733327549476838379876255164483333908854380501015560field.private,\n 17649382157field.private\n ]\n }\n },\n auction_id: 4494702806735512695876583707511065751304542460719196393147692059573188109243field.private,\n settings: {\n auction_privacy: 1field.private,\n bid_types_accepted: 2field.private\n },\n _nonce: 3369967065799891136255379173673996324404175734426175774361522329924029135340group.public,\n _version: 0u8.public\n }";
88
91
// const privateBid = "{\n owner: aleo12a4wll9ax6w5355jph0dr5wt2vla5sss2t4cnch0tc3vzh643v8qcfvc7a.private,\n bid: {\n amount: 50000u64.private,\n auction_id: 4494702806735512695876583707511065751304542460719196393147692059573188109243field.private,\n bid_public_key: 7957235921075215080384898776027711008106448988910535634014947882222019778701group.private\n },\n bid_id: 7560059211950188901208146469854635725646381155467709838136796808753178551929field.private,\n _nonce: 6603986437928263590097393830337419611438422585243442121397081002092267314422group.public,\n _version: 0u8.public\n}";
89
- // await remoteProgramExecution("private_auction_test_3.aleo", "select_winner_private", [auctionTicket, privateBid]);
92
+ // await remoteProgramExecution("private_auction_test_3.aleo", "select_winner_private", [auctionTicket, privateBid]);
0 commit comments