Skip to content

Commit

Permalink
instantiate backend when one calls Noir.init
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Oct 2, 2023
1 parent 69b47e2 commit 143e7bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tooling/noir_js/src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export class Noir {
private backend: Backend,
) {}

async init(): Promise<void> {
await this.backend.instantiate();
}

// Initial inputs to your program
async generateFinalProof(inputs: any): Promise<Uint8Array> {
const serializedWitness = await generateWitness(this.circuit, inputs);
Expand Down
2 changes: 2 additions & 0 deletions tooling/noir_js_types/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface Backend {
verifyFinalProof(proof: Uint8Array): Promise<boolean>;

verifyIntermediateProof(proof: Uint8Array): Promise<boolean>;

instantiate(): Promise<void>;
}

export type CompiledCircuit = {
Expand Down

0 comments on commit 143e7bd

Please sign in to comment.