Skip to content

Commit

Permalink
Use configurable tags property.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jan 25, 2024
1 parent 9976028 commit 20c6c6d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/runner.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"tag": "eddsa-rdfc-2022"
"tags": ["eddsa-rdfc-2022"]
}
9 changes: 4 additions & 5 deletions tests/10-rdfc-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import {
bs58Decode, createInitialVc, getPublicKeyBytes, shouldBeBs58
bs58Decode, config, createInitialVc, getPublicKeyBytes, shouldBeBs58
} from './helpers.js';
import chai from 'chai';
import {
Expand All @@ -12,12 +12,10 @@ import {
import {documentLoader} from './documentLoader.js';
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
import {readFileSync} from 'fs';

const config = JSON.parse(readFileSync('./config/runner.json'));
const cryptosuite = ['eddsa-rdfc-2022', 'eddsa-jcs-2022'];
const {match} = endpoints.filterByTag({
tags: [config.tag],
tags: [...config.tags],
property: 'issuers'
});
const should = chai.should();
Expand All @@ -41,7 +39,8 @@ describe('eddsa-rdfc-2022 (create)', function() {
describe(columnId, function() {
const [issuer] = endpoints;
const verifier = implementation.verifiers.find(
v => v.tags.has(config.tag));
// FIXME use Set's isSubsetOf in the future
v => config.tags.every(tag => v.tags.has(tag)));
let issuedVc;
let proofs;
const verificationMethodDocuments = [];
Expand Down
4 changes: 2 additions & 2 deletions tests/20-rdfc-verify.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
*/
import {bs58Decode, bs58Encode} from './helpers.js';
import {bs58Decode, bs58Encode, config} from './helpers.js';
import {verificationFail, verificationSuccess} from './assertions.js';
import {
checkDataIntegrityProofVerifyErrors
Expand All @@ -11,7 +11,7 @@ import {generateTestData} from './vc-generator/index.js';

// only use implementations with `eddsa-rdfc-2022` verifiers.
const {match} = endpoints.filterByTag({
tags: ['eddsa-rdfc-2022'],
tags: [...config.tags],
property: 'verifiers'
});

Expand Down
7 changes: 3 additions & 4 deletions tests/30-rdfc-interop.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
/*!
* Copyright (c) 2022-2023 Digital Bazaar, Inc. All rights reserved.
*/
import {config, createInitialVc} from './helpers.js';
import chai from 'chai';
import {createInitialVc} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';

const should = chai.should();
const tag = 'eddsa-rdfc-2022';

// only use implementations with `eddsa-rdfc-2022` issuers.
const {
match: issuerMatches
} = endpoints.filterByTag({tags: [tag], property: 'issuers'});
} = endpoints.filterByTag({tags: [...config.tags], property: 'issuers'});
const {
match: verifierMatches
} = endpoints.filterByTag({tags: [tag], property: 'verifiers'});
} = endpoints.filterByTag({tags: [...config.tags], property: 'verifiers'});

describe('eddsa-rdfc-2022 (interop)', function() {
let validVc;
Expand Down
3 changes: 3 additions & 0 deletions tests/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import * as didKey from '@digitalbazaar/did-method-key';
import * as Ed25519Multikey from '@digitalbazaar/ed25519-multikey';
import {IdDecoder, IdEncoder} from 'bnid';
import {klona} from 'klona';
import {readFileSync} from 'fs';
import {v4 as uuidv4} from 'uuid';
import varint from 'varint';

export const config = JSON.parse(readFileSync('./config/runner.json'));

const multibaseMultikeyHeader = 'z6Mk';
const didKeyDriver = didKey.driver();
didKeyDriver.use({
Expand Down

0 comments on commit 20c6c6d

Please sign in to comment.