Skip to content

Commit ae6a8fc

Browse files
author
William Brooks
committed
Extract CVCMerkleProof from the VC creation
This update separates the CvcMerkleProof from VC creation allowing for alternative proof mechanisms to be used. PR: #226 Signed-off-by: William Brooks <[email protected]> Reviewed-by: Julian Spring <[email protected]> Reviewed-by: Tighe Barris <[email protected]>
1 parent 4678f36 commit ae6a8fc

File tree

12 files changed

+112
-24555
lines changed

12 files changed

+112
-24555
lines changed

__integrations__/credentials/VerifiableCredential.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const uuidv4 = require('uuid/v4');
22
const { Claim } = require('claim/Claim');
3-
const VC = require('creds/VerifiableCredential');
43
const { schemaLoader, CVCSchemaLoader } = require('index');
54
const didTestUtil = require("../../__test__/lib/util/did");
65

@@ -58,7 +57,6 @@ describe('Integration Tests for Verifiable Credentials', () => {
5857
{ givenNames: 'Joao', otherNames: 'Barbosa', familyNames: 'Santos' });
5958

6059
const dob = await Claim.create('claim-cvc:Identity.dateOfBirth-v1', { day: 20, month: 3, year: 1978 });
61-
// const cred = await VC.create('credential-cvc:Identity-v3', uuidv4(), null, credentialSubject, [name, dob]);
6260

6361
const unsignedCred = await VerifiableCredential.create({
6462
issuer: didTestUtil.DID_CONTROLLER,

__test__/creds/VerifiableCredential.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fs = require('fs');
33
const uuidv4 = require('uuid/v4');
44
const sjcl = require('sjcl');
55
const {Claim} = require('claim/Claim');
6-
const VC = require('creds/VerifiableCredential');
76
const MiniCryptoManagerImpl = require('services/MiniCryptoManagerImpl');
87
const didTestUtil = require('../lib/util/did');
98
const solResolver = require('lib/did');

__test__/index.test.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const CredentialCommons = require('index');
22
const httpMock = require('services/__mocks__/httpService');
33

4-
const { Claim, VC } = CredentialCommons;
4+
const { Claim, VerifiableCredential } = CredentialCommons;
55

66
describe('Module Entry Point Tests', () => {
77
it('should access the entry point e see if the modules are declared', () => {
@@ -18,9 +18,10 @@ describe('Module Entry Point Tests', () => {
1818
passphrase: '',
1919
keychain: { prv: '' },
2020
};
21+
2122
CredentialCommons.init(confMock, httpMock);
2223
expect(Claim).toBeDefined();
23-
expect(VC).toBeDefined();
24+
expect(VerifiableCredential).toBeDefined();
2425
});
2526

2627
it('Should initialize with custom SecureRandom', () => {
@@ -42,6 +43,6 @@ describe('Module Entry Point Tests', () => {
4243

4344
CredentialCommons.init(confMock, httpMock, myCustomSecureRandom);
4445
expect(Claim).toBeDefined();
45-
expect(VC).toBeDefined();
46+
expect(VerifiableCredential).toBeDefined();
4647
});
4748
});

__test__/lib/resolver.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ describe("DiDResolver", () => {
8383
},
8484

8585
async verify(vc) {
86-
console.log(keypair);
8786
const verifier = keypair.verifier();
8887
return verifier.verify({
8988
data: vc.proof.merkleRoot,

0 commit comments

Comments
 (0)