@0xpolygonid/js-sdk 1.10.3 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/esm/index.js +4 -5
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +4 -5
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/proof/verifiers/pub-signals-verifier.js +4 -5
- package/dist/node/esm/proof/verifiers/pub-signals-verifier.js +4 -5
- package/package.json +1 -1
|
@@ -297,10 +297,7 @@ class PubSignalsVerifier {
|
|
|
297
297
|
}
|
|
298
298
|
};
|
|
299
299
|
this.checkStateExistenceForId = async (userId, userState) => {
|
|
300
|
-
|
|
301
|
-
if (!latest) {
|
|
302
|
-
throw exports.userStateError;
|
|
303
|
-
}
|
|
300
|
+
await this.resolve(userId, userState.bigInt());
|
|
304
301
|
};
|
|
305
302
|
this.checkGlobalState = async (state, id) => {
|
|
306
303
|
return this.rootResolve(state.bigInt(), id.bigInt());
|
|
@@ -393,7 +390,9 @@ class PubSignalsVerifier {
|
|
|
393
390
|
contractState = await this._stateStorage.getStateInfoByIdAndState(idBigInt, state);
|
|
394
391
|
}
|
|
395
392
|
catch (e) {
|
|
396
|
-
|
|
393
|
+
const stateNotExistErr = (e?.errorArgs ?? [])[0];
|
|
394
|
+
const errMsg = stateNotExistErr || e.message;
|
|
395
|
+
if (errMsg === 'State does not exist') {
|
|
397
396
|
if (isGenesis) {
|
|
398
397
|
return {
|
|
399
398
|
latest: true,
|
|
@@ -294,10 +294,7 @@ export class PubSignalsVerifier {
|
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
this.checkStateExistenceForId = async (userId, userState) => {
|
|
297
|
-
|
|
298
|
-
if (!latest) {
|
|
299
|
-
throw userStateError;
|
|
300
|
-
}
|
|
297
|
+
await this.resolve(userId, userState.bigInt());
|
|
301
298
|
};
|
|
302
299
|
this.checkGlobalState = async (state, id) => {
|
|
303
300
|
return this.rootResolve(state.bigInt(), id.bigInt());
|
|
@@ -390,7 +387,9 @@ export class PubSignalsVerifier {
|
|
|
390
387
|
contractState = await this._stateStorage.getStateInfoByIdAndState(idBigInt, state);
|
|
391
388
|
}
|
|
392
389
|
catch (e) {
|
|
393
|
-
|
|
390
|
+
const stateNotExistErr = (e?.errorArgs ?? [])[0];
|
|
391
|
+
const errMsg = stateNotExistErr || e.message;
|
|
392
|
+
if (errMsg === 'State does not exist') {
|
|
394
393
|
if (isGenesis) {
|
|
395
394
|
return {
|
|
396
395
|
latest: true,
|