@@ -27,14 +27,6 @@ const GEMINI_CHALLENGE_IN_SUBGROUP = "0x835eb8f7";
2727// 5. Run the test against the deployed contract
2828// 6. Kill the anvil instance
2929
30- const getEnvVarCanBeUndefined = ( envvar ) => {
31- const varVal = process . env [ envvar ] ;
32- if ( ! varVal ) {
33- return false ;
34- }
35- return varVal ;
36- } ;
37-
3830const getEnvVar = ( envvar ) => {
3931 const varVal = process . env [ envvar ] ;
4032 if ( ! varVal ) {
@@ -55,7 +47,7 @@ const [test, verifier] = await Promise.all([
5547 fsPromises . readFile ( verifierPath , encoding ) ,
5648] ) ;
5749
58- const hasZK = getEnvVarCanBeUndefined ( "HAS_ZK" ) ;
50+ const hasZK = getEnvVar ( "HAS_ZK" ) ;
5951
6052export const compilationInput = {
6153 language : "Solidity" ,
@@ -230,7 +222,6 @@ const killAnvil = () => {
230222 console . log ( testName , " complete" ) ;
231223} ;
232224
233- // TODO(https://github.com/AztecProtocol/barretenberg/issues/1316): Clean this code up. We are trying to use this logic for three different flows: bb plonk, bb honk, and bbjs honk, and all three have different setups.
234225try {
235226 const proofPath = getEnvVar ( "PROOF" ) ;
236227
@@ -239,7 +230,7 @@ try {
239230 const proof = readFileSync ( proofPath ) ;
240231 proofStr = proof . toString ( "hex" ) ;
241232
242- let publicInputsPath = getEnvVarCanBeUndefined ( "PUBLIC_INPUTS" ) ;
233+ let publicInputsPath = getEnvVar ( "PUBLIC_INPUTS" ) ;
243234 var publicInputs = [ ] ;
244235 let numExtraPublicInputs = 0 ;
245236 let extraPublicInputs = [ ] ;
@@ -251,15 +242,11 @@ try {
251242 [ numExtraPublicInputs , extraPublicInputs ] = readPublicInputs ( proofAsFields ) ;
252243 }
253244
254- // Read public inputs from binary file if available
255- if ( publicInputsPath ) {
256- const publicInputsBinary = readFileSync ( publicInputsPath ) ;
257- const innerPublicInputs = binaryToFields ( publicInputsBinary ) ;
258- publicInputs = innerPublicInputs . concat ( extraPublicInputs ) ;
259- } else {
260- // for plonk, the extraPublicInputs are all of the public inputs
261- publicInputs = extraPublicInputs ;
262- }
245+ // Read public inputs from binary file
246+ const publicInputsBinary = readFileSync ( publicInputsPath ) ;
247+ const innerPublicInputs = binaryToFields ( publicInputsBinary ) ;
248+ publicInputs = innerPublicInputs . concat ( extraPublicInputs ) ;
249+
263250 proofStr = proofStr . substring ( 64 * numExtraPublicInputs ) ;
264251 proofStr = "0x" + proofStr ;
265252
0 commit comments