From 89c42be9d67a41ea3f01cb91239e3f22ea06ef6a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 21 Nov 2023 23:49:59 +0000 Subject: [PATCH] Adjust mandatoryPointers for v1 and v2 VCs. --- test/10-verify.spec.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/10-verify.spec.js b/test/10-verify.spec.js index 07268575..b181317a 100644 --- a/test/10-verify.spec.js +++ b/test/10-verify.spec.js @@ -215,12 +215,12 @@ for(const [version, mockCredential] of versionedCredentials) { it('should verify a derived vc', async () => { const proofId = `urn:uuid:${uuid()}`; + const mandatoryPointers = (version === '1.0') ? + ['/issuer', '/issuanceDate'] : ['/issuer']; // setup ecdsa-sd-2023 suite for signing selective disclosure VCs const ecdsaSdSignSuite = new DataIntegrityProof({ signer: ecdsaKeyPair.signer(), cryptosuite: createSignCryptosuite({ - mandatoryPointers: [ - '/issuer' - ] + mandatoryPointers }) }); ecdsaSdSignSuite.proof = {id: proofId}; @@ -381,13 +381,12 @@ for(const [version, mockCredential] of versionedCredentials) { }); it('should verify a changed derived vc', async () => { const proofId = `urn:uuid:${uuid()}`; + const mandatoryPointers = (version === '1.0') ? + ['/issuer', '/issuanceDate'] : ['/issuer']; // setup ecdsa-sd-2023 suite for signing selective disclosure VCs const ecdsaSdSignSuite = new DataIntegrityProof({ signer: ecdsaKeyPair.signer(), cryptosuite: createSignCryptosuite({ - mandatoryPointers: [ - '/issuanceDate', - '/issuer' - ] + mandatoryPointers }) }); ecdsaSdSignSuite.proof = {id: proofId}; @@ -531,7 +530,6 @@ for(const [version, mockCredential] of versionedCredentials) { credentialsCount: count, mockCredential }); - const result = await vc.verify({ documentLoader, presentation,