update filepaths

This commit is contained in:
Kaylee George
2023-04-10 01:55:49 -07:00
parent 131f425c15
commit e9ccad3e56
4 changed files with 11 additions and 27 deletions

11
dist/index.js vendored
View File

@@ -99009,11 +99009,6 @@ function generateAppIdentifier (appName) {
// const vkey = JSON.parse(vkeyPath) // doesn't work
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
var zkeyFiles = {
vkeyPath: "/zkeyFiles/verification_key.json",
wasmFilePath: "/zkeyFiles/rln.wasm",
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
};
var RLN = /** @class */ (function () {
// private memIndex: number
function RLN(appName, onChain, rlnIdentifier) {
@@ -99026,17 +99021,17 @@ var RLN = /** @class */ (function () {
: generateAppIdentifier(appName);
}
/* call initRLN to create rln instance */
RLN.prototype.initRLN = function (existingIdentity) {
RLN.prototype.initRLN = function (vKeyPath, wasmFilePath, finalZkeyPath, existingIdentity) {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this;
return [4 /*yield*/, fetch(zkeyFiles.vkeyPath).then(function (res) { return res.json(); })];
return [4 /*yield*/, fetch(vKeyPath).then(function (res) { return res.json(); })];
case 1:
_a.vKey = _b.sent();
this.rlnjs = new rlnjs.RLN(zkeyFiles.wasmFilePath, zkeyFiles.finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
this.rlnjs = new rlnjs.RLN(wasmFilePath, finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
this.rlnIdentifier = this.rlnjs.rlnIdentifier;
this.cache = new rlnjs.Cache(this.rlnjs.rlnIdentifier);
this.identityCommitment = this.rlnjs.identity.getCommitment();

11
dist/index.mjs vendored
View File

@@ -228240,11 +228240,6 @@ function generateAppIdentifier (appName) {
// const vkey = JSON.parse(vkeyPath) // doesn't work
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
var zkeyFiles = {
vkeyPath: "/zkeyFiles/verification_key.json",
wasmFilePath: "/zkeyFiles/rln.wasm",
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
};
var RLN = /** @class */ (function () {
// private memIndex: number
function RLN(appName, onChain, rlnIdentifier) {
@@ -228257,17 +228252,17 @@ var RLN = /** @class */ (function () {
: generateAppIdentifier(appName);
}
/* call initRLN to create rln instance */
RLN.prototype.initRLN = function (existingIdentity) {
RLN.prototype.initRLN = function (vKeyPath, wasmFilePath, finalZkeyPath, existingIdentity) {
return __awaiter$1(this, void 0, void 0, function () {
var _a;
return __generator$1(this, function (_b) {
switch (_b.label) {
case 0:
_a = this;
return [4 /*yield*/, fetch(zkeyFiles.vkeyPath).then(function (res) { return res.json(); })];
return [4 /*yield*/, fetch(vKeyPath).then(function (res) { return res.json(); })];
case 1:
_a.vKey = _b.sent();
this.rlnjs = new RLN$1(zkeyFiles.wasmFilePath, zkeyFiles.finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
this.rlnjs = new RLN$1(wasmFilePath, finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
this.rlnIdentifier = this.rlnjs.rlnIdentifier;
this.cache = new Cache(this.rlnjs.rlnIdentifier);
this.identityCommitment = this.rlnjs.identity.getCommitment();

2
dist/types/RLN.d.ts vendored
View File

@@ -11,7 +11,7 @@ export default class RLN {
identityCommitment?: bigint;
vKey?: any;
constructor(appName: string, onChain?: Contract, rlnIdentifier?: bigint);
initRLN(existingIdentity?: string): Promise<void>;
initRLN(vKeyPath: string, wasmFilePath: string, finalZkeyPath: string, existingIdentity?: string): Promise<void>;
initOnChain(): Promise<void>;
generateRLNProof(msg: string, epoch: bigint): Promise<RLNFullProof>;
verifyProof(rlnProof: RLNFullProof): Promise<boolean>;

View File

@@ -12,12 +12,6 @@ import generateAppIdentifier from "./utils/generateAppId"
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
const zkeyFiles = {
vkeyPath: "/zkeyFiles/verification_key.json",
wasmFilePath: "/zkeyFiles/rln.wasm",
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
}
export default class RLN {
registry: Registry
@@ -47,11 +41,11 @@ export default class RLN {
}
/* call initRLN to create rln instance */
public async initRLN(existingIdentity?: string) {
this.vKey = await fetch(zkeyFiles.vkeyPath).then((res) => res.json())
public async initRLN(vKeyPath: string, wasmFilePath: string, finalZkeyPath: string, existingIdentity?: string) {
this.vKey = await fetch(vKeyPath).then((res) => res.json())
this.rlnjs = new RLNjs(
zkeyFiles.wasmFilePath,
zkeyFiles.finalZkeyPath,
wasmFilePath,
finalZkeyPath,
this.vKey,
this.rlnIdentifier,
existingIdentity