From 34590b2d50dbfff4c60747ce23c33fdd155a4366 Mon Sep 17 00:00:00 2001 From: nitro-neal <5314059+nitro-neal@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:58:11 -0500 Subject: [PATCH] add web5-spec up to main (#851) * add web5-spec up to main * comment out status list cred vectors * remove status list cred test vector --- .../tests/status-list-credential.spec.ts | 65 +++++++++---------- web5-spec | 2 +- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/packages/credentials/tests/status-list-credential.spec.ts b/packages/credentials/tests/status-list-credential.spec.ts index 72887dde6..c53a75a28 100644 --- a/packages/credentials/tests/status-list-credential.spec.ts +++ b/packages/credentials/tests/status-list-credential.spec.ts @@ -6,8 +6,6 @@ import { DidJwk } from '@web5/dids'; import { VerifiableCredential } from '../src/verifiable-credential.js'; import { StatusList2021Entry, StatusListCredential, StatusPurpose } from '../src/status-list-credential.js'; -import StatusListCredentialsCreateTestVector from '../../../web5-spec/test-vectors/status_list_credentials/create.json' assert { type: 'json' }; - describe('Status List Credential Tests', () => { let issuerDid: BearerDid; let holderDid: BearerDid; @@ -234,35 +232,36 @@ describe('Status List Credential Tests', () => { }); }); - describe('Web5TestVectorsStatusListCredentials', () => { - it('create', async () => { - const vectors = StatusListCredentialsCreateTestVector.vectors; - - for (const vector of vectors) { - const { input, output } = vector; - - const vcWithCredStatus = await VerifiableCredential.create({ - type : input.credential.type, - issuer : input.credential.issuer, - subject : input.credential.subject, - data : input.credential.credentialSubject, - credentialStatus : input.credential.credentialStatus - }); - - const statusListCred = StatusListCredential.create({ - statusListCredentialId : input.statusListCredential.statusListCredentialId, - issuer : input.statusListCredential.issuer, - statusPurpose : input.statusListCredential.statusPurpose as StatusPurpose, - credentialsToDisable : [vcWithCredStatus] - }); - - expect(StatusListCredential.validateCredentialInStatusList(vcWithCredStatus, statusListCred)).to.be.true; - - const statusListCredSubject = statusListCred.vcDataModel.credentialSubject as any; - expect(statusListCredSubject['type']).to.equal('StatusList2021'); - expect(statusListCredSubject['statusPurpose']).to.equal(input.statusListCredential.statusPurpose); - expect(statusListCredSubject['encodedList']).to.equal(output.encodedList); - } - }); - }); + // TODO: Add tests for validateCredentialInStatusList once we create new vectors - https://github.com/TBD54566975/web5-spec/issues/169 + // describe('Web5TestVectorsStatusListCredentials', () => { + // it('create', async () => { + // const vectors = StatusListCredentialsCreateTestVector.vectors; + + // for (const vector of vectors) { + // const { input, output } = vector; + + // const vcWithCredStatus = await VerifiableCredential.create({ + // type : input.credential.type, + // issuer : input.credential.issuer, + // subject : input.credential.subject, + // data : input.credential.credentialSubject, + // credentialStatus : input.credential.credentialStatus + // }); + + // const statusListCred = StatusListCredential.create({ + // statusListCredentialId : input.statusListCredential.statusListCredentialId, + // issuer : input.statusListCredential.issuer, + // statusPurpose : input.statusListCredential.statusPurpose as StatusPurpose, + // credentialsToDisable : [vcWithCredStatus] + // }); + + // expect(StatusListCredential.validateCredentialInStatusList(vcWithCredStatus, statusListCred)).to.be.true; + + // const statusListCredSubject = statusListCred.vcDataModel.credentialSubject as any; + // expect(statusListCredSubject['type']).to.equal('StatusList2021'); + // expect(statusListCredSubject['statusPurpose']).to.equal(input.statusListCredential.statusPurpose); + // expect(statusListCredSubject['encodedList']).to.equal(output.encodedList); + // } + // }); + // }); }); \ No newline at end of file diff --git a/web5-spec b/web5-spec index 30ebc84ff..7c4e7fc52 160000 --- a/web5-spec +++ b/web5-spec @@ -1 +1 @@ -Subproject commit 30ebc84ffefc485dd35f12562279319f52ed0153 +Subproject commit 7c4e7fc5206ee3f50c05383e61be0046623f7dc9