@@ -103,7 +103,18 @@ function srsPerField(f: 'fp' | 'fq', napi: Napi, conversion: RustConversion) {
103103
104104 let maybeLagrangeCommitment = ( srs : NapiSrs , domain_size : number , i : number ) => {
105105 try {
106- return napi [ `caml_${ f } _srs_maybe_lagrange_commitment` ] ( srs , domain_size , i ) ;
106+ console . log ( 3 ) ;
107+ console . log ( 'srs napi' , srs ) ;
108+
109+ /*let bytes = (napi as any)[`caml_${f}_srs_to_bytes`](srs);
110+ console.log('bytes', bytes);
111+ let wasmSrs = undefined;
112+ if (f === 'fp') wasmSrs = (napi as any)[`caml_${f}_srs_from_bytes`](bytes);
113+ else wasmSrs = (napi as any)[`caml_fq_srs_from_bytes`](bytes);
114+ */
115+ let s = napi [ `caml_${ f } _srs_maybe_lagrange_commitment` ] ( srs , domain_size , i ) ;
116+ console . log ( 'S' , s ) ;
117+ return s ;
107118 } catch ( error ) {
108119 console . error ( `Error in SRS maybe lagrange commitment for field ${ f } ` ) ;
109120 throw error ;
@@ -197,7 +208,8 @@ function srsPerField(f: 'fp' | 'fq', napi: Napi, conversion: RustConversion) {
197208 // happy, fast case: if basis is already stored on the srs, return the ith commitment
198209 let commitment = maybeLagrangeCommitment ( srs , domainSize , i ) ;
199210
200- if ( commitment === undefined ) {
211+ if ( commitment === undefined || commitment === null ) {
212+ console . log ( "comm was undefined" ) ;
201213 if ( cache === undefined ) {
202214 // if there is no cache, recompute and store basis in memory
203215 commitment = lagrangeCommitment ( srs , domainSize , i ) ;
@@ -235,6 +247,7 @@ function srsPerField(f: 'fp' | 'fq', napi: Napi, conversion: RustConversion) {
235247 commitment = c ;
236248 }
237249 }
250+ console . log ( "commitment was not undefined" ) ;
238251
239252 // edge case for when we have a writeable cache and the basis was already stored on the srs
240253 // but we didn't store it in the cache separately yet
0 commit comments