Skip to content

Commit 86630a7

Browse files
committed
Fixing some of the examples
1 parent 523cf13 commit 86630a7

File tree

16 files changed

+70
-69
lines changed

16 files changed

+70
-69
lines changed

create-leo-app/template-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "rimraf static/js && rollup --config"
88
},
99
"devDependencies": {
10-
"@provablehq/sdk": "^0.8.8",
10+
"@provablehq/sdk": "^0.9.0",
1111
"@web/rollup-plugin-import-meta-assets": "^2.2.1",
1212
"rimraf": "^6.0.1",
1313
"rollup": "^4.32.0"

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/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@provablehq/sdk": "^0.8.8",
12+
"@provablehq/sdk": "^0.9.0",
1313
"next": "15.2.3",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0",

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/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "npm run build && node dist/index.js"
99
},
1010
"dependencies": {
11-
"@provablehq/sdk": "^0.8.8"
11+
"@provablehq/sdk": "^0.9.0"
1212
},
1313
"devDependencies": {
1414
"rimraf": "^6.0.1",

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)) {
58+
if (programManager.verifyExecution({ executionResponse })) {
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)) {
52+
if (programManager.verifyExecution({ executionResponse })) {
5053
console.log("hello_hello/hello execution verified!");
5154
} else {
5255
throw("Execution failed verification!");

create-leo-app/template-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"dev": "node index.js"
88
},
99
"dependencies": {
10-
"@provablehq/sdk": "^0.8.8"
10+
"@provablehq/sdk": "^0.9.0"
1111
}
1212
}

create-leo-app/template-offline-public-transaction-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "npm run build && node dist/index.js"
99
},
1010
"dependencies": {
11-
"@provablehq/sdk": "^0.8.8"
11+
"@provablehq/sdk": "^0.9.0"
1212
},
1313
"devDependencies": {
1414
"rimraf": "^6.0.1",

create-leo-app/template-react-leo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"install-leo": "./install.sh"
1313
},
1414
"dependencies": {
15-
"@provablehq/sdk": "^0.8.8",
15+
"@provablehq/sdk": "^0.9.0",
1616
"comlink": "^4.4.2",
1717
"react": "^19.0.0",
1818
"react-dom": "^19.0.0"

0 commit comments

Comments
 (0)