Skip to content

Commit

Permalink
fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello committed Jan 27, 2025
1 parent 73ece25 commit 5f0501c
Showing 1 changed file with 86 additions and 94 deletions.
180 changes: 86 additions & 94 deletions integration-tests/verification-flow/range-proofs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,100 +51,92 @@ describe('Range proofs verification', () => {

// TODO: The DID for this credential is not available anymore
// Will need to create a new credential with the same schema and conditions
it('should generate range proofs presentation using number max placeholder', async () => {
const wallet: IWallet = await getWallet();
const controller = await createVerificationController({
wallet,
});

const credentialUrl =
'https://creds-staging.truvera.io/8c668af5bd679cdb09af5df866c1da0c6732756fc96dd28236c87c9d2ad356ae';
const password = '1234';
const {data: credential} = await axios.get(
`${credentialUrl}?p=${btoa(password)}`,
);

// debugger;

await getCredentialProvider().addCredential(credential);

await controller.start({
template: 'https://creds-staging.truvera.io/proof/1c829d4e-029c-455d-935f-1ac5c1f53439',
// {
// boundCheckSnarkKey,
// signature: null,
// qr: 'https://creds-testnet.truvera.io/proof/b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// id: 'b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// name: 'test data',
// nonce: '798b999c18bb83f0f9669aac91c68910',
// created: '2025-01-15T16:34:06.077Z',
// response_url:
// 'https://api-testnet.truvera.io/proof-requests/b8acdd33-e8e0-491f-8674-6ba521d9ea84/send-presentation',
// request: {
// id: 'b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// input_descriptors: [
// {
// id: 'Credential 1',
// name: 'test data',
// purpose: 'test',
// constraints: {
// fields: [
// {
// path: ['$.credentialSubject.id'],
// optional: false,
// },
// {
// path: ['$.credentialSubject.number'],
// filter: {
// type: 'number',
// exclusiveMinimum: 0,
// },
// optional: false,
// predicate: 'required',
// },
// {
// path: ['$.credentialSchema.id'],
// filter: {
// const:
// 'https://schema.truvera.io/TestingCheqdSchema-V1-1736958567072.json',
// },
// },
// {
// path: ['$.credentialSubject.name'],
// optional: false,
// },
// ],
// },
// },
// ],
// },
// type: 'proof-request',
// },
});

const attributesToReveal = [
'credentialSubject.name',
'credentialSubject.date',
'credentialSubject.number',
];

controller.selectedCredentials.set(credential.id, {
credential: credential,
attributesToReveal,
});

const presentation = await controller.createPresentation();

// expect(
// presentation.verifiableCredential[0].credentialSubject,
// ).toBeDefined();

try {
const result = await controller.submitPresentation(presentation);
} catch (err) {
debugger;
}
});
// it('should generate range proofs presentation using number max placeholder', async () => {
// const wallet: IWallet = await getWallet();
// const controller = await createVerificationController({
// wallet,
// });

// const credentialUrl =
// 'https://creds-testnet.truvera.io/3e824efbead0f72cbe0070923d981762122bf5440cfce513e96b65482ea4934a';
// const password = '1234';
// const {data: credential} = await axios.get(
// `${credentialUrl}?p=${btoa(password)}`,
// );

// await getCredentialProvider().addCredential(credential);

// await controller.start({
// template: {
// boundCheckSnarkKey,
// signature: null,
// qr: 'https://creds-testnet.truvera.io/proof/b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// id: 'b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// name: 'test data',
// nonce: '798b999c18bb83f0f9669aac91c68910',
// created: '2025-01-15T16:34:06.077Z',
// response_url:
// 'https://api-testnet.truvera.io/proof-requests/b8acdd33-e8e0-491f-8674-6ba521d9ea84/send-presentation',
// request: {
// id: 'b8acdd33-e8e0-491f-8674-6ba521d9ea84',
// input_descriptors: [
// {
// id: 'Credential 1',
// name: 'test data',
// purpose: 'test',
// constraints: {
// fields: [
// {
// path: ['$.credentialSubject.id'],
// optional: false,
// },
// {
// path: ['$.credentialSubject.number'],
// filter: {
// type: 'number',
// exclusiveMinimum: 0,
// },
// optional: false,
// predicate: 'required',
// },
// {
// path: ['$.credentialSchema.id'],
// filter: {
// const:
// 'https://schema.truvera.io/TestingCheqdSchema-V1-1736958567072.json',
// },
// },
// {
// path: ['$.credentialSubject.name'],
// optional: false,
// },
// ],
// },
// },
// ],
// },
// type: 'proof-request',
// },
// });

// const attributesToReveal = [
// 'credentialSubject.id',
// 'credentialSubject.name',
// 'credentialSubject.date',
// 'credentialSubject.number',
// ];

// controller.selectedCredentials.set(credential.id, {
// credential: credential,
// attributesToReveal,
// });

// const presentation = await controller.createPresentation();

// expect(
// presentation.verifiableCredential[0].credentialSubject,
// ).toBeDefined();
// });

afterAll(() => closeWallet());
});

0 comments on commit 5f0501c

Please sign in to comment.