File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const codegenPrelude = `/* Autogenerated file, do not edit! */
88
99/* eslint-disable */
1010
11- import { Noir, InputMap } from "@noir-lang/noir_js"
11+ import { Noir, InputMap, CompiledCircuit } from "@noir-lang/noir_js"
1212` ;
1313
1414const codegenFunction = (
@@ -19,8 +19,11 @@ const codegenFunction = (
1919 const args = function_signature . inputs . map ( ( [ name ] ) => `${ name } ` ) . join ( ', ' ) ;
2020 const args_with_types = function_signature . inputs . map ( ( [ name , type ] ) => `${ name } : ${ type } ` ) . join ( ', ' ) ;
2121
22- return `export async function ${ name } (${ args_with_types } ): Promise<${ function_signature . returnValue } > {
23- const program = new Noir(${ JSON . stringify ( compiled_program ) } );
22+ return `
23+ export const ${ name } _circuit: CompiledCircuit = ${ JSON . stringify ( compiled_program ) } ;
24+
25+ export async function ${ name } (${ args_with_types } ): Promise<${ function_signature . returnValue } > {
26+ const program = new Noir(${ name } _circuit);
2427 const args: InputMap = { ${ args } };
2528 const { returnValue } = await program.execute(args);
2629 return returnValue as ${ function_signature . returnValue } ;
You can’t perform that action at this time.
0 commit comments