Skip to content

Commit b4709ea

Browse files
committed
Add basic algorithms test.
1 parent ae91e1e commit b4709ea

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

tests/90-algorithms.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*!
2+
* Copyright 2024 Digital Bazaar, Inc.
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
import {ecdsaRdfc2019Algorithms} from './suites/algorithms.js';
6+
import {endpoints} from 'vc-test-suite-implementations';
7+
import {getSuiteConfig} from './test-config.js';
8+
9+
const cryptosuites = [
10+
'ecdsa-rdfc-2019',
11+
];
12+
13+
for(const suiteName of cryptosuites) {
14+
const {tags, credentials, vectors} = getSuiteConfig(suiteName);
15+
const {match: verifiers} = endpoints.filterByTag({
16+
tags: [...tags],
17+
property: 'verifiers'
18+
});
19+
for(const vcVersion of vectors.vcTypes) {
20+
const {
21+
document,
22+
mandatoryPointers,
23+
selectivePointers
24+
} = credentials.create[vcVersion];
25+
for(const keyType of vectors.keyTypes) {
26+
ecdsaRdfc2019Algorithms({
27+
verifiers,
28+
suiteName,
29+
keyType,
30+
vcVersion,
31+
credential: document,
32+
mandatoryPointers,
33+
selectivePointers
34+
});
35+
}
36+
}
37+
}

tests/suites/algorithms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ async function _setup({
211211
await issueCloned(_generateNoTypeCryptosuite({
212212
signer,
213213
suiteName,
214-
credential,
214+
credential: _credential,
215215
mandatoryPointers,
216216
selectivePointers
217217
})));
218218
return credentials;
219219
}
220220

221-
async function _generateNoTypeCryptosuite({
221+
function _generateNoTypeCryptosuite({
222222
signer,
223223
suiteName,
224224
credential,

0 commit comments

Comments
 (0)