Skip to content

Commit

Permalink
Use vc.derive() instead of jsigs.derive().
Browse files Browse the repository at this point in the history
  • Loading branch information
JSAssassin committed Nov 14, 2023
1 parent b9f26a6 commit c91572f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
15 changes: 6 additions & 9 deletions test/mocha/20-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {createRequire} from 'node:module';
import {DataIntegrityProof} from '@digitalbazaar/data-integrity';
import {Ed25519Signature2020} from '@digitalbazaar/ed25519-signature-2020';
import {httpClient} from '@digitalbazaar/http-client';
import jsigs from 'jsonld-signatures';
import {klona} from 'klona';

import {mockData} from './mock.data.js';
Expand All @@ -30,8 +29,6 @@ const didKeyDriver = _didKeyDriver();
const mockCredentials = require('./mock-credentials.json');
const mockExpiredCredential = require('./mock-expired-credential.json');

const {purposes: {AssertionProofPurpose}} = jsigs;

describe('verify APIs', () => {
let capabilityAgent;
let verifierConfig;
Expand Down Expand Up @@ -152,12 +149,12 @@ describe('verify APIs', () => {
]
});
const suite = new DataIntegrityProof({cryptosuite});
const revealed = await jsigs.derive(verifiableCredential, {
const derivedVC = await vc.derive({
verifiableCredential,
suite,
purpose: new AssertionProofPurpose(),
documentLoader: brDocLoader
});
verifiableCredential = revealed;
verifiableCredential = derivedVC;
}
let error;
let result;
Expand Down Expand Up @@ -446,12 +443,12 @@ describe('verify APIs', () => {
]
});
const suite = new DataIntegrityProof({cryptosuite});
const revealed = await jsigs.derive(verifiableCredential, {
const derivedVC = await vc.derive({
verifiableCredential,
suite,
purpose: new AssertionProofPurpose(),
documentLoader: brDocLoader
});
verifiableCredential = revealed;
verifiableCredential = derivedVC;
}
const presentation = vc.createPresentation({
holder: 'did:test:foo',
Expand Down
3 changes: 1 addition & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,13 @@
"@digitalbazaar/edv-client": "^16.0.0",
"@digitalbazaar/ezcap": "^4.0.0",
"@digitalbazaar/http-client": "^4.0.0",
"@digitalbazaar/vc": "^6.0.0",
"@digitalbazaar/vc": "^6.1.0",
"@digitalbazaar/vc-status-list-context": "^3.0.1",
"@digitalbazaar/webkms-client": "^13.0.0",
"c8": "^7.11.3",
"cross-env": "^7.0.3",
"express": "^4.18.1",
"jose": "^4.8.3",
"jsonld-signatures": "^11.2.1",
"klona": "^2.0.5",
"vc-revocation-list-context": "^1.0.0"
},
Expand Down

0 comments on commit c91572f

Please sign in to comment.