Skip to content

Commit a987a9c

Browse files
committed
bindings: update polyCommFromRust
1 parent 199e872 commit a987a9c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/bindings/crypto/napi-conversion-core.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,22 +180,13 @@ function conversionCorePerField({ makeAffine, PolyComm }: NapiClasses) {
180180
return new PolyCommClass(unshifted as unknown, undefined);
181181
};
182182

183-
/* const polyCommFromRust = (polyComm: NapiPolyComm): PolyComm => {
183+
const polyCommFromRust = (polyComm: any): any => {
184+
if (polyComm == null) return undefined;
184185
console.log('polyComm', polyComm);
185186
const rustUnshifted = asArrayLike<NapiAffine>(polyComm.unshifted, 'polyComm.unshifted');
186187
console.log('rustUnshifted', rustUnshifted);
187188
const mlUnshifted = rustUnshifted.map(affineFromRust);
188189
return [0, [0, ...mlUnshifted]];
189-
}; */
190-
const polyCommFromRust = (polyComm: any): any => {
191-
let rustUnshifted = polyComm.unshifted;
192-
console.log('rustUnshifted', rustUnshifted);
193-
let mlUnshifted = mapFromUintArray(rustUnshifted, (ptr) => {
194-
console.log('ptr', ptr);
195-
/* return affineFromRust(wrap(ptr, CommitmentCurve));
196-
*/
197-
});
198-
return [0, [0, ...mlUnshifted]];
199190
};
200191

201192
const polyCommsToRust = ([, ...comms]: MlArray<PolyComm>): NapiPolyComm[] =>

0 commit comments

Comments
 (0)