Skip to content

Commit

Permalink
remove noop from supported operators for onchain v2 circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Oct 28, 2024
1 parent 826ad35 commit f5d820d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xpolygonid/js-sdk",
"version": "1.21.0",
"version": "1.21.1",
"description": "SDK to work with Polygon ID",
"main": "dist/node/cjs/index.js",
"module": "dist/node/esm/index.js",
Expand Down
14 changes: 10 additions & 4 deletions src/proof/provers/inputs-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,22 @@ const v2Operations = [
Operators.NIN,
Operators.NE
];
const v2OnChainOperations = [
Operators.EQ,
Operators.LT,
Operators.GT,
Operators.IN,
Operators.NIN,
Operators.NE
];

export const circuitValidator: {
[k in CircuitId]: { maxQueriesCount: number; supportedOperations: Operators[] };
} = {
[CircuitId.AtomicQueryMTPV2]: { maxQueriesCount: 1, supportedOperations: v2Operations },
[CircuitId.AtomicQueryMTPV2OnChain]: { maxQueriesCount: 1, supportedOperations: v2Operations },
[CircuitId.AtomicQueryMTPV2OnChain]: { maxQueriesCount: 1, supportedOperations: v2OnChainOperations },
[CircuitId.AtomicQuerySigV2]: { maxQueriesCount: 1, supportedOperations: v2Operations },
[CircuitId.AtomicQuerySigV2OnChain]: { maxQueriesCount: 1, supportedOperations: v2Operations },
[CircuitId.AtomicQuerySigV2OnChain]: { maxQueriesCount: 1, supportedOperations: v2OnChainOperations },
[CircuitId.AtomicQueryV3]: { maxQueriesCount: 1, supportedOperations: allOperations },
[CircuitId.AtomicQueryV3OnChain]: { maxQueriesCount: 1, supportedOperations: allOperations },
[CircuitId.AuthV2]: { maxQueriesCount: 0, supportedOperations: [] },
Expand Down Expand Up @@ -296,7 +304,6 @@ export class InputGenerator {
circuitInputs.challenge = params.challenge;

const query = circuitQueries[0];
query.operator = this.transformV2QueryOperator(query.operator);
circuitInputs.query = query;
circuitInputs.claim = {
issuerID: circuitClaimData.issuerId,
Expand Down Expand Up @@ -381,7 +388,6 @@ export class InputGenerator {
circuitInputs.skipClaimRevocationCheck = params.skipRevocation;

const query = circuitQueries[0];
query.operator = this.transformV2QueryOperator(query.operator);
circuitInputs.query = query;
circuitInputs.currentTimeStamp = getUnixTimestamp(new Date());

Expand Down

0 comments on commit f5d820d

Please sign in to comment.