Skip to content

Commit 50e0c76

Browse files
committed
Add invalidCreated generator to setup.
1 parent b58911f commit 50e0c76

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

tests/suites/algorithms-sd.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
* Copyright 2024 Digital Bazaar, Inc.
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
5+
import {
6+
assertions,
7+
generators,
8+
issueCloned
9+
} from 'data-integrity-test-suite-assertion';
510
import {
611
shouldBeBs64UrlNoPad,
712
shouldHaveHeaderBytes,
813
} from '../assertions.js';
9-
import {
10-
assertions,
11-
} from 'data-integrity-test-suite-assertion';
1214
import {createInitialVc} from '../helpers.js';
1315
import {expect} from 'chai';
16+
import {getMultiKey} from '../vc-generator/key-gen.js';
17+
import {getSuites} from './helpers.js';
1418

1519
export function sd2023Algorithms({
1620
credential,
@@ -323,6 +327,27 @@ export function sd2023Algorithms({
323327
});
324328
}
325329

326-
function _setup() {
327-
330+
async function _setup({
331+
credential,
332+
suiteName,
333+
keyType,
334+
mandatoryPointers,
335+
selectivePointers
336+
}) {
337+
const {invalidCreated} = generators?.dates;
338+
const credentials = new Map();
339+
const keyPair = await getMultiKey({keyType});
340+
const signer = keyPair.signer();
341+
const _credential = structuredClone(credential);
342+
_credential.issuer = keyPair.controller;
343+
credentials.set('invalidCreated', await issueCloned(invalidCreated({
344+
credential: structuredClone(_credential),
345+
...getSuites({
346+
signer,
347+
suiteName,
348+
selectivePointers,
349+
mandatoryPointers
350+
})
351+
})));
352+
return credentials;
328353
}

0 commit comments

Comments
 (0)