Skip to content

Commit 291e154

Browse files
committed
Fixing some of the examples
1 parent dbe6fed commit 291e154

File tree

6 files changed

+36
-30
lines changed

6 files changed

+36
-30
lines changed

create-leo-app/template-extension/src/worker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ async function localProgramExecution(program, aleoFunction, inputs) {
1818
const account = new Account();
1919
programManager.setAccount(account);
2020

21-
const executionResponse = await programManager.run(
21+
const executionResponse = await programManager.run({
2222
program,
23-
aleoFunction,
23+
functionName: aleoFunction,
2424
inputs,
25-
false,
26-
);
25+
proveExecution: false,
26+
});
2727
return executionResponse.getOutputs();
2828
}
2929

create-leo-app/template-nextjs-ts/src/app/worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ async function localProgramExecution(program: string, aleoFunction: string, inpu
2323
const account = new Account();
2424
programManager.setAccount(account);
2525

26-
const executionResponse = await programManager.run(
26+
const executionResponse = await programManager.run({
2727
program,
28-
aleoFunction,
28+
functionName: aleoFunction,
2929
inputs,
30-
false,
31-
);
30+
proveExecution: false,
31+
});
3232
return executionResponse.getOutputs();
3333
}
3434

create-leo-app/template-node-ts/src/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ async function localProgramExecution(program, programName, aleoFunction, inputs)
2727

2828
// Pre-synthesize the program keys and then cache them in memory using key provider
2929
try {
30-
const keyPair = await programManager.synthesizeKeys(hello_hello_program, aleoFunction, inputs);
30+
const keyPair = await programManager.synthesizeKeys({
31+
program: hello_hello_program,
32+
functionName: aleoFunction,
33+
inputs,
34+
});
3135

3236
programManager.keyProvider.cacheKeys(`${programName}:${aleoFunction}`, keyPair);
3337

@@ -41,18 +45,17 @@ async function localProgramExecution(program, programName, aleoFunction, inputs)
4145

4246
// Execute once using the key provider params defined above. This will use the cached proving keys and make
4347
// execution significantly faster.
44-
let executionResponse = await programManager.run(
48+
let executionResponse = await programManager.run({
4549
program,
46-
aleoFunction,
50+
functionName: aleoFunction,
4751
inputs,
48-
true,
49-
undefined,
52+
proveExecution: true,
5053
keyProviderParams,
51-
);
54+
});
5255
console.log("hello_hello/hello executed - result:", executionResponse.getOutputs());
5356

5457
// Verify the execution using the verifying key that was generated earlier.
55-
if (programManager.verifyExecution(executionResponse, 9_000_000)) {
58+
if (programManager.verifyExecution({ executionResponse, blockHeight: 9_000_000 })) {
5659
console.log("hello_hello/hello execution verified!");
5760
} else {
5861
throw("Execution failed verification!");

create-leo-app/template-node/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ async function localProgramExecution(program, programName, aleoFunction, inputs)
2626
programManager.setKeyProvider(keyProvider);
2727

2828
// 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+
});
3034
programManager.keyProvider.cacheKeys(`${programName}:${aleoFunction}`, keyPair);
3135

3236
// 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)
3539

3640
// Execute once using the key provider params defined above. This will use the cached proving keys and make
3741
// execution significantly faster.
38-
let executionResponse = await programManager.run(
42+
let executionResponse = await programManager.run({
3943
program,
40-
aleoFunction,
44+
functionName: aleoFunction,
4145
inputs,
42-
true,
43-
undefined,
46+
proveExecution: true,
4447
keyProviderParams,
45-
);
48+
});
4649
console.log("hello_hello/hello executed - result:", executionResponse.getOutputs());
4750

4851
// Verify the execution using the verifying key that was generated earlier.
49-
if (programManager.verifyExecution(executionResponse, 9_000_000)) {
52+
if (programManager.verifyExecution({ executionResponse, blockHeight: 9_000_000 })) {
5053
console.log("hello_hello/hello execution verified!");
5154
} else {
5255
throw("Execution failed verification!");

create-leo-app/template-react-leo/src/workers/worker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ async function localProgramExecution(program, aleoFunction, inputs) {
1818
const account = new Account();
1919
programManager.setAccount(account);
2020

21-
const executionResponse = await programManager.run(
21+
const executionResponse = await programManager.run({
2222
program,
23-
aleoFunction,
23+
programName: aleoFunction,
2424
inputs,
25-
false,
26-
);
25+
proveExecution: false,
26+
});
2727
return executionResponse.getOutputs();
2828
}
2929

create-leo-app/template-vanilla/worker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ async function localProgramExecution(program, aleoFunction, inputs) {
2727
const account = new Account();
2828
programManager.setAccount(account);
2929

30-
const executionResponse = await programManager.run(
30+
const executionResponse = await programManager.run({
3131
program,
32-
aleoFunction,
32+
functionName: aleoFunction,
3333
inputs,
34-
false,
35-
);
34+
proveExecution: false,
35+
});
3636
return executionResponse.getOutputs();
3737
}
3838

0 commit comments

Comments
 (0)