Skip to content

Commit

Permalink
chore(noir_js): remove unnecessary input validation in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Sep 26, 2023
1 parent a8f18c5 commit c0a915e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 61 deletions.
55 changes: 0 additions & 55 deletions tooling/noir_js/src/input_validation.ts

This file was deleted.

7 changes: 1 addition & 6 deletions tooling/noir_js/src/witness_generation.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { abiEncode } from '@noir-lang/noirc_abi';
import { validateInputs } from './input_validation.js';
import { base64Decode } from './base64_decode.js';
import { WitnessMap, executeCircuit } from '@noir-lang/acvm_js';

// Generates the witnesses needed to feed into the chosen proving system
export async function generateWitness(compiledProgram, inputs): Promise<WitnessMap> {
// Validate inputs
const { isValid, error } = validateInputs(inputs, compiledProgram.abi);
if (!isValid) {
throw new Error(error?.toString());
}
// Throws on ABI encoding error
const witnessMap = abiEncode(compiledProgram.abi, inputs, null);

// Execute the circuit to generate the rest of the witnesses
Expand Down

0 comments on commit c0a915e

Please sign in to comment.