Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run test failed #58

Closed
zjingwang opened this issue May 16, 2023 · 1 comment
Closed

npm run test failed #58

zjingwang opened this issue May 16, 2023 · 1 comment

Comments

@zjingwang
Copy link

● TestVerifyWithAtomicMTPProof

expect(received).resolves.not.toThrow()

Received promise rejected instead of resolved
Rejected to value: [Error: can't load schema for request query]

  278 |   const verifier = new Verifier(verificationKeyLoader, schemaLoader, resolvers);
  279 |
> 280 |   await expect(
      |         ^
  281 |     verifier.verifyAuthResponse(response, request),
  282 |   ).resolves.not.toThrow();
  283 | });

  at expect (node_modules/expect/build/index.js:178:15)
  at Object.<anonymous> (test/auth.test.ts:280:9)

● TestFullVerify

expect(received).resolves.not.toThrow()

Received promise rejected instead of resolved
Rejected to value: [Error: can't load schema for request query]

  337 |     console.log(err);
  338 |   }
> 339 |   await expect(
      |         ^
  340 |     verifier.fullVerify(token, request, opts),
  341 |   ).resolves.not.toThrow();
  342 | });

  at expect (node_modules/expect/build/index.js:178:15)
  at Object.<anonymous> (test/auth.test.ts:339:9)

● TestResponseWithEmptyQueryRequest_ErrorCase

can't load schema for request query

  92 |     loadResult = await schemaLoader.load(query.context);
  93 |   } catch (e) {
> 94 |     throw new Error(`can't load schema for request query`);
     |           ^
  95 |   }
  96 |   const schemaHash = createSchemaHash(query.context, query.type);
  97 |   if (schemaHash.bigInt() !== outputs.schemaHash.bigInt()) {

  at checkQueryRequest (src/circuits/query.ts:94:11)
  at AtomicQuerySigV2PubSignals.verifyQuery (src/circuits/atomicSigV2.ts:124:12)
  at Verifier.verifyAuthResponse (src/auth/auth.ts:111:7)
  at Verifier.fullVerify (src/auth/auth.ts:181:5)

● TestResponseWithEmptyQueryRequest_ErrorCase

expect(received).toContain(expected) // indexOf

Expected substring: "operator that was used is not equal to request"
Received string:    "Error: can't load schema for request query"

  500 |     await verifier.verifyAuthResponse(response, request);
  501 |   } catch (e) {
> 502 |     expect(e.toString()).toContain(
      |                          ^
  503 |       'operator that was used is not equal to request',
  504 |     );
  505 |   }

  at Object.<anonymous> (test/auth.test.ts:502:26)

● verify jwz with selective disclosure

expect(received).resolves.not.toThrow()

Received promise rejected instead of resolved
Rejected to value: [Error: can't load schema for request query]

  567 |     acceptedStateTransitionDelay: 5 * 60 * 1000, // 5 minutes
  568 |   };
> 569 |   await expect(
      |         ^
  570 |     verifier.fullVerify(token, request, opts),
  571 |   ).resolves.not.toThrow();
  572 | });

  at expect (node_modules/expect/build/index.js:178:15)
  at Object.<anonymous> (test/auth.test.ts:569:9)

Test Suites: 1 failed, 1 total

@vmidyllic
Copy link
Contributor

proper setup of schema loader should mitigate the issue.
e.g. for IPFS schemas you need to set IpfsGatewayURL / IpfsNodeURL option in verifier initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants