Skip to content

Commit 36d7237

Browse files
committed
removed transient dependencies
1 parent 6231b41 commit 36d7237

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/utils/constraints-utils.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import * as snarkjs from "snarkjs";
2-
// @ts-expect-error: No type definitions available for the "r1csfile" package
3-
import * as r1csfile from "r1csfile";
4-
// @ts-expect-error: No type definitions available for the "@iden3/binfileutils" package
5-
import * as binfileutils from "@iden3/binfileutils";
62

73
import { LinearCombination, R1CSConstraint } from "../../src/types/utils";
84

@@ -79,20 +75,11 @@ export async function getPlonkConstraintsNumber(r1csFilePath: string, Fr: any):
7975
}
8076
};
8177

82-
const { fd: fdR1cs, sections: sectionsR1cs } = await binfileutils.readBinFile(
83-
r1csFilePath,
84-
"r1cs",
85-
1,
86-
1 << 22,
87-
1 << 24,
88-
);
89-
const r1cs = await r1csfile.readR1csFd(fdR1cs, sectionsR1cs, { loadConstraints: true, loadCustomGates: true });
78+
const r1cs = await snarkjs.r1cs.info(r1csFilePath);
9079

9180
let plonkConstraintsCount = r1cs.nOutputs + r1cs.nPubInputs;
9281

9382
r1cs.constraints.forEach((constraint: R1CSConstraint) => process(...constraint));
9483

95-
await fdR1cs.fd.close();
96-
9784
return plonkConstraintsCount;
9885
}

0 commit comments

Comments
 (0)