Skip to content

Commit

Permalink
fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello committed Jan 17, 2025
1 parent 8ef4267 commit 7a3f50d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
7 changes: 2 additions & 5 deletions packages/wasm/src/services/credential/bound-check.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import {
applyEnforceBounds,
MAX_DATE_PLACEHOLDER,
MIN_DATE_PLACEHOLDER,
MAX_NUMBER,
fetchProvingKey,
isBase64OrDataUrl,
MIN_INTEGER,
} from './bound-check';
import {PresentationBuilder} from '@docknetwork/crypto-wasm-ts/lib';
import proofRequest from './proof-request.json';
import { replaceResponseURL } from '@docknetwork/wallet-sdk-core/src/helpers';
import assert from 'assert';
import { MAX_DATE_PLACEHOLDER, MAX_NUMBER, MIN_DATE_PLACEHOLDER, MIN_NUMBER } from './pex-helpers';

const testAPIURL = process.env.TESTING_API_URL || null;

Expand Down Expand Up @@ -218,7 +215,7 @@ describe('Bound check', () => {

const credIdx = 0;
const attributeName = 'credentialSubject.income';
const min = MIN_INTEGER;
const min = MIN_NUMBER;
const max = 20000;

expect(builder.enforceBounds).toHaveBeenCalledWith(
Expand Down
5 changes: 0 additions & 5 deletions packages/wasm/src/services/credential/bound-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,5 @@ export async function fetchProvingKey(proofRequest: ProofRequest) {
return {provingKey, provingKeyId: 'key0'};
}

export const MAX_DATE_PLACEHOLDER = 884541351600000;
export const MIN_DATE_PLACEHOLDER = -17592186044415;
export const MAX_NUMBER = Math.pow(100, 9);
export const MIN_INTEGER = -4294967295;

export const hasProvingKey = (proofRequest: ProofRequest) =>
!!proofRequest.boundCheckSnarkKey;
2 changes: 1 addition & 1 deletion packages/wasm/src/services/credential/pex-helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('pex helpers', () => {
{
attributeName: 'age',
min: 0,
max: 1000000000000000000,
max: 10000000000,
type: 'number',
format: undefined,
},
Expand Down

0 comments on commit 7a3f50d

Please sign in to comment.