-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #310 from docknetwork/feat/cheqd-migration
cheqd migration
Showing
50 changed files
with
1,103 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { IWallet } from '@docknetwork/wallet-sdk-core/lib/types'; | ||
import { createVerificationController } from '@docknetwork/wallet-sdk-core/src/verification-controller'; | ||
import { CheqdCredentialNonZKP, CheqdCredentialZKP } from './data/credentials/cheqd-credentials'; | ||
import { closeWallet, createNewWallet, getCredentialProvider, getWallet } from './helpers'; | ||
import { ProofTemplateIds, createProofRequest } from './helpers/certs-helpers'; | ||
|
||
describe('Cheq integration tests', () => { | ||
beforeAll(async () => { | ||
await createNewWallet(); | ||
}); | ||
|
||
it('should verify a non ZKP cheqd credential', async () => { | ||
const wallet: IWallet = await getWallet(); | ||
|
||
getCredentialProvider().addCredential(CheqdCredentialNonZKP); | ||
|
||
const proofRequest = await createProofRequest( | ||
ProofTemplateIds.ANY_CREDENTIAL, | ||
); | ||
|
||
const result: any = await getCredentialProvider().isValid(CheqdCredentialNonZKP); | ||
|
||
expect(result).toBeTruthy(); | ||
|
||
const controller = await createVerificationController({ | ||
wallet, | ||
}); | ||
|
||
await controller.start({ | ||
template: proofRequest, | ||
}); | ||
|
||
controller.selectedCredentials.set(CheqdCredentialNonZKP.id, { | ||
credential: CheqdCredentialNonZKP, | ||
}); | ||
|
||
const presentation = await controller.createPresentation(); | ||
console.log('Presentation generated'); | ||
console.log(JSON.stringify(presentation, null, 2)); | ||
console.log('Sending presentation to Certs API'); | ||
|
||
let certsResponse; | ||
try { | ||
certsResponse = await controller.submitPresentation(presentation); | ||
console.log('CERTS response'); | ||
console.log(JSON.stringify(certsResponse, null, 2)); | ||
} catch (err) { | ||
certsResponse = err.response.data; | ||
console.log('Certs API returned an error'); | ||
console.log(JSON.stringify(certsResponse, null, 2)); | ||
} | ||
|
||
expect(certsResponse.verified).toBe(true); | ||
Check failure on line 53 in integration-tests/cheqd-credentials.test.ts GitHub Actions / Integration Test Reportintegration-tests/cheqd-credentials.test.ts ► Cheq integration tests ► should verify a non ZKP cheqd credential
Raw output
|
||
}); | ||
|
||
afterAll(() => closeWallet()); | ||
}); |
113 changes: 113 additions & 0 deletions
113
integration-tests/data/credentials/cheqd-credentials.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.